finoptima 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +49 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* EcoChain MCP Server (DEC-2026-043)
|
|
4
4
|
*
|
|
5
5
|
* Model Context Protocol server for AI agent access to EcoChain.
|
|
6
|
-
* Provides
|
|
6
|
+
* Provides 30 tools: 1 login + 29 platform tools.
|
|
7
7
|
*
|
|
8
8
|
* Authentication: EcoAuth login flow (no hardcoded credentials)
|
|
9
9
|
* 1. AI asks user for their phone number
|
|
@@ -117,16 +117,63 @@ const loginTool = {
|
|
|
117
117
|
// All tools: login first, then platform tools
|
|
118
118
|
const allToolsWithLogin = [loginTool, ...allTools];
|
|
119
119
|
|
|
120
|
+
// Server instructions — shown to the AI to explain how to use FINOPTIMA
|
|
121
|
+
const SERVER_INSTRUCTIONS = `FINOPTIMA — EcoChain AI Finance Agent (v1.2.0, 30 tools)
|
|
122
|
+
|
|
123
|
+
## Setup
|
|
124
|
+
If the user doesn't have FINOPTIMA installed, they can add it to their MCP config:
|
|
125
|
+
\`\`\`json
|
|
126
|
+
{
|
|
127
|
+
"mcpServers": {
|
|
128
|
+
"ecochain": {
|
|
129
|
+
"command": "npx",
|
|
130
|
+
"args": ["-y", "finoptima"],
|
|
131
|
+
"env": { "ECOCHAIN_API_URL": "https://api.toutcreer.com" }
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
\`\`\`
|
|
136
|
+
|
|
137
|
+
## Authentication
|
|
138
|
+
1. Ask the user for their phone number (format: +33...)
|
|
139
|
+
2. Call the \`login\` tool — a push notification is sent to their EcoAuth mobile app
|
|
140
|
+
3. The user approves on their phone — JWT session is established
|
|
141
|
+
4. All other tools are now active
|
|
142
|
+
|
|
143
|
+
## Available Capabilities
|
|
144
|
+
- **Portfolio**: get_balances, get_portfolio, get_prices, get_lp_positions, get_transaction_history
|
|
145
|
+
- **Market**: get_pools, get_pool_details, get_orderbook, get_ticker, get_candles, get_trading_pairs
|
|
146
|
+
- **Trading**: place_order, cancel_order, get_my_orders, get_trade_history
|
|
147
|
+
- **Swap (AMM)**: get_swap_quote, execute_swap (0.3% fee)
|
|
148
|
+
- **Liquidity**: add_liquidity, remove_liquidity
|
|
149
|
+
- **Transfer**: send_funds
|
|
150
|
+
- **AI Strategies**: create_strategy, list_strategies, get_strategy, activate_strategy, pause_strategy
|
|
151
|
+
- **Intents**: create_intent, list_intents
|
|
152
|
+
- **Performance**: get_strategy_performance
|
|
153
|
+
|
|
154
|
+
## AI Trading Strategies
|
|
155
|
+
3 automated strategies available: LP Yield, DCA, BTC Hedge.
|
|
156
|
+
Pipeline: Create (draft) → Activate → Runner evaluates every 60s → Creates intents → Policy validation (8 rules) → Auto-approve if < 0.01 BTC, else manual approval → Execute.
|
|
157
|
+
Modes: "auto" (auto-approve small trades) or "watch" (all manual approval).
|
|
158
|
+
|
|
159
|
+
## Rules
|
|
160
|
+
- Always call \`login\` first before any other tool
|
|
161
|
+
- Always confirm financial actions (trade, swap, send) with the user before executing
|
|
162
|
+
- Use \`get_swap_quote\` before \`execute_swap\` to show expected outcome
|
|
163
|
+
- Platform: https://www.toutcreer.com/trading
|
|
164
|
+
`;
|
|
165
|
+
|
|
120
166
|
// Create MCP server
|
|
121
167
|
const server = new Server(
|
|
122
168
|
{
|
|
123
169
|
name: 'ecochain',
|
|
124
|
-
version: '1.
|
|
170
|
+
version: '1.2.0',
|
|
125
171
|
},
|
|
126
172
|
{
|
|
127
173
|
capabilities: {
|
|
128
174
|
tools: {},
|
|
129
175
|
},
|
|
176
|
+
instructions: SERVER_INSTRUCTIONS,
|
|
130
177
|
}
|
|
131
178
|
);
|
|
132
179
|
|
package/package.json
CHANGED