@elfa-ai/mcp 2.0.0 → 3.0.0
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/CHANGELOG.md +12 -0
- package/README.md +9 -18
- package/dist/index.js +110 -177
- package/manifest.json +19 -21
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Removed
|
|
6
|
+
|
|
7
|
+
- **The `auto_exchanges` tool is gone.** Exchange connections are no longer part of the documented Auto surface, so listing, connecting and disconnecting venues is no longer exposed here. The three operations are recorded in `manifest.json` under `unexposed`, so the drift check still accounts for every documented `/v2` operation. The endpoints remain reachable over the API for anyone who needs them.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **`validate_symbol` moved to `auto_validate`.** It is now `auto_validate` with `method=symbol`, taking `exchange` and `symbol`, and returns `valid: true/false` with the unsupported case reported as a validation error. The default `method=query` behaviour is unchanged.
|
|
12
|
+
- **Eleven tools**, down from twelve.
|
|
13
|
+
- Signing guidance everywhere — server instructions, `auto_query_write`, README, install docs, the desktop bundle and the registry entry — now describes `ELFA_HMAC_SECRET` as signing Auto mutations that are not plain notifications, rather than exchange linking and order placement.
|
|
14
|
+
|
|
3
15
|
## 2.0.0
|
|
4
16
|
|
|
5
17
|
### Changed
|
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ Ask *"what's trending in crypto right now?"* to confirm it works.
|
|
|
48
48
|
| Variable | Required | Purpose |
|
|
49
49
|
| --- | --- | --- |
|
|
50
50
|
| `ELFA_API_KEY` | yes | Authenticates every request |
|
|
51
|
-
| `ELFA_HMAC_SECRET` | no | Signs Auto
|
|
51
|
+
| `ELFA_HMAC_SECRET` | no | Signs Auto mutations when signing is required. Notification-only query mutations do not need it |
|
|
52
52
|
| `ELFA_TIMEOUT` | no | Request timeout in ms, default `120000` |
|
|
53
53
|
| `ELFA_RETRIES` | no | Retries on failure, default `0` |
|
|
54
54
|
| `ELFA_MCP_MAX_RESPONSE_CHARS` | no | Response size ceiling, default `60000` |
|
|
@@ -58,13 +58,13 @@ The timeout is high and retries are off on purpose. The interpretation endpoints
|
|
|
58
58
|
|
|
59
59
|
Some MCP clients apply their own timeout, often around 60 seconds. `narratives` and `market_chat` can exceed that; the request still completes and is still charged, even if the client gives up first.
|
|
60
60
|
|
|
61
|
-
Without `ELFA_HMAC_SECRET`
|
|
61
|
+
Without `ELFA_HMAC_SECRET` notification-only Auto mutations still work. Anything else returns a message telling you what to set.
|
|
62
62
|
|
|
63
63
|
## Tools
|
|
64
64
|
|
|
65
65
|
<!-- tools:start -->
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
11 tools, mapped to every documented `/v2` operation.
|
|
68
68
|
|
|
69
69
|
| Tool | Mode | Cost | What it does |
|
|
70
70
|
| --- | --- | --- | --- |
|
|
@@ -75,17 +75,19 @@ Without `ELFA_HMAC_SECRET` everything still works except exchange linking and or
|
|
|
75
75
|
| `account_stats` | read | 1 per call | Smart follower and engagement stats for an X account. |
|
|
76
76
|
| `market_chat` | read | Varies by speed | Ask for written market analysis. Supports conversational chat, macro overview, quick summary, token intro, token analysis and account analysis. |
|
|
77
77
|
| `auto_build` | read | 1 plus LLM usage | Turn a plain-language monitoring request into an EQL query. Returns a draft to validate and activate, it does not activate anything itself. |
|
|
78
|
-
| `auto_validate` | read | Free | Check EQL syntax and get a cost estimate before activating
|
|
78
|
+
| `auto_validate` | read | Free | Check EQL syntax and get a cost estimate before activating, or check that a symbol has market data on a venue. |
|
|
79
79
|
| `auto_query` | read | Free | Read side of Auto: list queries, poll one query, and read its executions and LLM sessions. |
|
|
80
80
|
| `auto_query_write` | write | 5 plus LLM usage to create, free to cancel or delete | Activate, cancel or delete an Auto query. Activated queries run unattended and fire their action when conditions are met. |
|
|
81
81
|
| `auto_draft` | write | Free, except convert which costs the same as creating a query | Manage inactive Auto drafts. Drafts do not evaluate until converted into an active query. |
|
|
82
|
-
| `auto_exchanges` | write | Free | List, connect and disconnect the exchange accounts Auto uses for order actions, and check whether a symbol is tradeable. |
|
|
83
82
|
|
|
84
83
|
Not exposed as tools:
|
|
85
84
|
|
|
86
85
|
- `chat-stream-v2` — A tool call returns one result, so streaming adds nothing. market_chat covers the same analysis.
|
|
87
86
|
- `auto-stream-queries-v2` — Long lived streams have no tool equivalent. Poll with auto_query.
|
|
88
87
|
- `auto-stream-query-v2` — Long lived streams have no tool equivalent. Poll with auto_query.
|
|
88
|
+
- `auto-list-exchanges-v2` — Exchange connections are no longer part of the documented Auto surface.
|
|
89
|
+
- `auto-connect-exchange-v2` — Exchange connections are no longer part of the documented Auto surface.
|
|
90
|
+
- `auto-disconnect-exchange-v2` — Exchange connections are no longer part of the documented Auto surface.
|
|
89
91
|
|
|
90
92
|
<!-- tools:end -->
|
|
91
93
|
|
|
@@ -114,18 +116,7 @@ The flow is three steps:
|
|
|
114
116
|
2. `auto_validate` — check the syntax and get the credit cost
|
|
115
117
|
3. `auto_query_write` — activate it
|
|
116
118
|
|
|
117
|
-
Actions can notify you, call a webhook, message a Telegram bot, run an LLM analysis
|
|
118
|
-
|
|
119
|
-
### Connecting an exchange
|
|
120
|
-
|
|
121
|
-
| Venue | Connect from here | Credentials |
|
|
122
|
-
| --- | --- | --- |
|
|
123
|
-
| `binance` | yes | `apiKey`, `secret` |
|
|
124
|
-
| `pacifica` | yes | `privateKey`, `walletAddress` |
|
|
125
|
-
| `hyperliquid` | no, wallet is set up in the Elfa app | none |
|
|
126
|
-
| `gmx` | no, wallet is set up in the Elfa app | none |
|
|
127
|
-
|
|
128
|
-
Credentials are verified on connect, so a wrong value fails there rather than when an order fires. They are ordinary tool arguments, so they pass through the model and land in the client's transcript.
|
|
119
|
+
Actions can notify you, call a webhook, message a Telegram bot, or run an LLM analysis.
|
|
129
120
|
|
|
130
121
|
There is no push channel over MCP. Poll `auto_query` with `method=get`, and wait for the returned `pollAfterSeconds` between calls.
|
|
131
122
|
|
|
@@ -144,7 +135,7 @@ It is stateless — no sessions, one server instance per request, safe behind a
|
|
|
144
135
|
`api_status` is the fastest way to tell an auth problem from a credit problem.
|
|
145
136
|
|
|
146
137
|
|
|
147
|
-
Mentions, news and narratives return third-party social text that anyone can write. The server marks it as untrusted in every response, and the server instructions tell the model to treat it as data. Keep that in mind before letting an agent chain from that content into `auto_query_write
|
|
138
|
+
Mentions, news and narratives return third-party social text that anyone can write. The server marks it as untrusted in every response, and the server instructions tell the model to treat it as data. Keep that in mind before letting an agent chain from that content into `auto_query_write`.
|
|
148
139
|
|
|
149
140
|
## Development
|
|
150
141
|
|
package/dist/index.js
CHANGED
|
@@ -148,10 +148,10 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
148
148
|
// package.json
|
|
149
149
|
var package_default = {
|
|
150
150
|
name: "@elfa-ai/mcp",
|
|
151
|
-
version: "
|
|
151
|
+
version: "3.0.0",
|
|
152
152
|
description: "Model Context Protocol server for the Elfa API - crypto social intelligence and the Auto condition engine",
|
|
153
153
|
license: "MIT",
|
|
154
|
-
author: "Elfa
|
|
154
|
+
author: "Elfa AI",
|
|
155
155
|
type: "module",
|
|
156
156
|
mcpName: "ai.elfa/mcp",
|
|
157
157
|
main: "dist/index.js",
|
|
@@ -541,98 +541,8 @@ function registerAutoDraft(server, deps) {
|
|
|
541
541
|
);
|
|
542
542
|
}
|
|
543
543
|
|
|
544
|
-
// src/tools/autoExchanges.ts
|
|
545
|
-
import { z as z5 } from "zod";
|
|
546
|
-
var EXCHANGES = ["hyperliquid", "gmx", "binance", "pacifica"];
|
|
547
|
-
function registerAutoExchanges(server, deps) {
|
|
548
|
-
server.registerTool(
|
|
549
|
-
"auto_exchanges",
|
|
550
|
-
{
|
|
551
|
-
title: "Auto exchange connections",
|
|
552
|
-
description: "The exchange accounts Auto uses when a query's action places an order. Free. method=validate_symbol checks a symbol is tradeable before you build a query around it. Connecting and disconnecting change what Auto can trade with, so confirm with the user first, and both need request signing. binance and pacifica connect from here with credentials. hyperliquid and gmx use a wallet set up in the Elfa app, so use method=list to confirm those rather than trying to connect them.",
|
|
553
|
-
inputSchema: {
|
|
554
|
-
method: z5.enum(["list", "connect", "disconnect", "validate_symbol"]).describe("Which action to perform."),
|
|
555
|
-
exchange: z5.enum(EXCHANGES).optional().describe("Required for connect, disconnect and validate_symbol."),
|
|
556
|
-
symbol: z5.string().optional().describe("Required for method=validate_symbol."),
|
|
557
|
-
credentialType: z5.string().optional().describe(
|
|
558
|
-
"Credential type for method=connect, as documented per venue. Read it off an existing connection with method=list if you are unsure."
|
|
559
|
-
),
|
|
560
|
-
metadata: z5.record(z5.unknown()).optional().describe("Non-secret connection metadata for method=connect."),
|
|
561
|
-
credentials: z5.record(z5.unknown()).optional().describe(
|
|
562
|
-
"Venue credentials for method=connect. binance needs apiKey and secret, pacifica needs privateKey and walletAddress. They are verified on connect, so a wrong value fails here rather than at trade time. They also pass through the conversation and are written to the client transcript, so tell the user that before asking for them."
|
|
563
|
-
)
|
|
564
|
-
},
|
|
565
|
-
outputSchema: {
|
|
566
|
-
method: z5.string(),
|
|
567
|
-
data: z5.unknown()
|
|
568
|
-
},
|
|
569
|
-
annotations: {
|
|
570
|
-
readOnlyHint: false,
|
|
571
|
-
destructiveHint: true,
|
|
572
|
-
idempotentHint: false,
|
|
573
|
-
openWorldHint: false
|
|
574
|
-
}
|
|
575
|
-
},
|
|
576
|
-
async (args) => {
|
|
577
|
-
const needsExchange = args.method !== "list";
|
|
578
|
-
if (needsExchange && !args.exchange) {
|
|
579
|
-
return fail(
|
|
580
|
-
`method=${args.method} needs exchange, one of ${EXCHANGES.join(", ")}.`
|
|
581
|
-
);
|
|
582
|
-
}
|
|
583
|
-
if (args.method === "validate_symbol" && !args.symbol) {
|
|
584
|
-
return fail('method=validate_symbol needs symbol, for example symbol: "BTC".');
|
|
585
|
-
}
|
|
586
|
-
if ((args.method === "connect" || args.method === "disconnect") && !deps.hasHmac) {
|
|
587
|
-
return fail(missingCredential("hmacSecret"));
|
|
588
|
-
}
|
|
589
|
-
if (args.method === "connect" && !args.credentialType) {
|
|
590
|
-
return fail(
|
|
591
|
-
"method=connect needs credentialType. See https://docs.elfa.ai/auto/trading-execution for the value each venue expects."
|
|
592
|
-
);
|
|
593
|
-
}
|
|
594
|
-
return run(deps, async () => {
|
|
595
|
-
switch (args.method) {
|
|
596
|
-
case "connect":
|
|
597
|
-
return {
|
|
598
|
-
method: args.method,
|
|
599
|
-
data: await deps.sdk.auto.connectExchange(
|
|
600
|
-
pickDefined({
|
|
601
|
-
exchange: args.exchange,
|
|
602
|
-
credentialType: args.credentialType,
|
|
603
|
-
metadata: args.metadata,
|
|
604
|
-
credentials: args.credentials
|
|
605
|
-
})
|
|
606
|
-
)
|
|
607
|
-
};
|
|
608
|
-
case "disconnect":
|
|
609
|
-
return {
|
|
610
|
-
method: args.method,
|
|
611
|
-
data: await deps.sdk.auto.disconnectExchange(
|
|
612
|
-
args.exchange
|
|
613
|
-
)
|
|
614
|
-
};
|
|
615
|
-
case "validate_symbol":
|
|
616
|
-
return {
|
|
617
|
-
method: args.method,
|
|
618
|
-
data: await deps.sdk.auto.validateSymbol(
|
|
619
|
-
args.exchange,
|
|
620
|
-
args.symbol
|
|
621
|
-
)
|
|
622
|
-
};
|
|
623
|
-
default:
|
|
624
|
-
return {
|
|
625
|
-
method: "list",
|
|
626
|
-
data: await deps.sdk.auto.listExchanges()
|
|
627
|
-
};
|
|
628
|
-
}
|
|
629
|
-
});
|
|
630
|
-
}
|
|
631
|
-
);
|
|
632
|
-
}
|
|
633
|
-
|
|
634
544
|
// src/tools/autoQuery.ts
|
|
635
|
-
import { z as
|
|
545
|
+
import { z as z5 } from "zod";
|
|
636
546
|
var ACTIVE = /* @__PURE__ */ new Set(["active", "pending", "running", "armed"]);
|
|
637
547
|
function registerAutoQuery(server, deps) {
|
|
638
548
|
server.registerTool(
|
|
@@ -641,7 +551,7 @@ function registerAutoQuery(server, deps) {
|
|
|
641
551
|
title: "Read Auto queries",
|
|
642
552
|
description: "Read side of Auto. Free. method=list browses queries, method=get polls one query and returns its latest evaluation, method=executions and method=execution show what fired, method=sessions and method=session return the LLM analysis attached to a query. There is no push channel here, poll with method=get and respect pollAfterSeconds.",
|
|
643
553
|
inputSchema: {
|
|
644
|
-
method:
|
|
554
|
+
method: z5.enum([
|
|
645
555
|
"list",
|
|
646
556
|
"get",
|
|
647
557
|
"executions",
|
|
@@ -649,19 +559,19 @@ function registerAutoQuery(server, deps) {
|
|
|
649
559
|
"sessions",
|
|
650
560
|
"session"
|
|
651
561
|
]).describe("Which read to perform."),
|
|
652
|
-
queryId:
|
|
653
|
-
sessionId:
|
|
654
|
-
executionId:
|
|
655
|
-
status:
|
|
656
|
-
type:
|
|
657
|
-
search:
|
|
658
|
-
limit:
|
|
659
|
-
offset:
|
|
562
|
+
queryId: z5.string().optional().describe("Required for get, sessions and session."),
|
|
563
|
+
sessionId: z5.string().optional().describe("Required for method=session."),
|
|
564
|
+
executionId: z5.string().optional().describe("Required for method=execution."),
|
|
565
|
+
status: z5.string().optional().describe("Filter by status."),
|
|
566
|
+
type: z5.string().optional().describe("Filter executions by type."),
|
|
567
|
+
search: z5.string().optional().describe("Free text filter for method=list."),
|
|
568
|
+
limit: z5.number().int().min(1).max(50).default(10).describe("Page size for list style methods."),
|
|
569
|
+
offset: z5.number().int().min(0).default(0).describe("Pagination offset.")
|
|
660
570
|
},
|
|
661
571
|
outputSchema: {
|
|
662
|
-
method:
|
|
663
|
-
data:
|
|
664
|
-
pollAfterSeconds:
|
|
572
|
+
method: z5.string(),
|
|
573
|
+
data: z5.unknown(),
|
|
574
|
+
pollAfterSeconds: z5.number().nullable()
|
|
665
575
|
},
|
|
666
576
|
annotations: {
|
|
667
577
|
readOnlyHint: true,
|
|
@@ -740,25 +650,25 @@ function registerAutoQuery(server, deps) {
|
|
|
740
650
|
}
|
|
741
651
|
|
|
742
652
|
// src/tools/autoQueryWrite.ts
|
|
743
|
-
import { z as
|
|
653
|
+
import { z as z6 } from "zod";
|
|
744
654
|
function registerAutoQueryWrite(server, deps) {
|
|
745
655
|
server.registerTool(
|
|
746
656
|
"auto_query_write",
|
|
747
657
|
{
|
|
748
658
|
title: "Write Auto queries",
|
|
749
|
-
description: "Activate, cancel or delete an Auto query. Creating costs 5 credits plus LLM usage, cancel and delete are free. An activated query runs unattended and fires its action without asking again, so validate it with auto_validate and confirm the cost and the action with the user before calling this. Queries whose action
|
|
659
|
+
description: "Activate, cancel or delete an Auto query. Creating costs 5 credits plus LLM usage, cancel and delete are free. An activated query runs unattended and fires its action without asking again, so validate it with auto_validate and confirm the cost and the action with the user before calling this. Queries whose action is not a plain notification also need request signing.",
|
|
750
660
|
inputSchema: {
|
|
751
|
-
method:
|
|
661
|
+
method: z6.enum(["create", "cancel", "delete"]).describe(
|
|
752
662
|
"create activates a new query. cancel stops an active one. delete removes one that has already finished."
|
|
753
663
|
),
|
|
754
664
|
query: eqlQueryArg.optional(),
|
|
755
|
-
title:
|
|
756
|
-
description:
|
|
757
|
-
queryId:
|
|
665
|
+
title: z6.string().max(120).optional().describe("Short title shown in the notification when this fires."),
|
|
666
|
+
description: z6.string().max(500).optional().describe("Why this was set up, shown alongside the title."),
|
|
667
|
+
queryId: z6.string().optional().describe("Required for cancel and delete.")
|
|
758
668
|
},
|
|
759
669
|
outputSchema: {
|
|
760
|
-
method:
|
|
761
|
-
data:
|
|
670
|
+
method: z6.string(),
|
|
671
|
+
data: z6.unknown()
|
|
762
672
|
},
|
|
763
673
|
annotations: {
|
|
764
674
|
readOnlyHint: false,
|
|
@@ -797,25 +707,29 @@ function registerAutoQueryWrite(server, deps) {
|
|
|
797
707
|
}
|
|
798
708
|
|
|
799
709
|
// src/tools/autoValidate.ts
|
|
800
|
-
import { z as
|
|
710
|
+
import { z as z7 } from "zod";
|
|
711
|
+
var EXCHANGES = ["hyperliquid", "gmx", "binance", "pacifica"];
|
|
801
712
|
function registerAutoValidate(server, deps) {
|
|
802
713
|
server.registerTool(
|
|
803
714
|
"auto_validate",
|
|
804
715
|
{
|
|
805
716
|
title: "Validate Auto query",
|
|
806
|
-
description: "Check EQL syntax and get a cost estimate before anything is activated. Free. Always run this before auto_query_write, and show the estimated cost to the user. Pass either an inline query or a draftId.",
|
|
717
|
+
description: "Check EQL syntax and get a cost estimate before anything is activated. Free. Always run this before auto_query_write, and show the estimated cost to the user. Pass either an inline query or a draftId. method=symbol instead checks that a symbol has market data on a venue, before you build price or ta conditions around it.",
|
|
807
718
|
inputSchema: {
|
|
719
|
+
method: z7.enum(["query", "symbol"]).default("query").describe("query validates EQL, symbol checks symbol support."),
|
|
808
720
|
query: eqlQueryArg.optional(),
|
|
809
|
-
draftId:
|
|
810
|
-
title:
|
|
811
|
-
description:
|
|
721
|
+
draftId: z7.string().optional().describe("Validate a stored draft instead of an inline query."),
|
|
722
|
+
title: z7.string().max(120).optional().describe("Title to validate with the query."),
|
|
723
|
+
description: z7.string().max(500).optional().describe("Description to validate with the query."),
|
|
724
|
+
exchange: z7.enum(EXCHANGES).optional().describe("Required for method=symbol."),
|
|
725
|
+
symbol: z7.string().optional().describe('Required for method=symbol, for example "BTC".')
|
|
812
726
|
},
|
|
813
727
|
outputSchema: {
|
|
814
|
-
valid:
|
|
815
|
-
errors:
|
|
816
|
-
warnings:
|
|
817
|
-
estimatedCredits:
|
|
818
|
-
estimatedCost:
|
|
728
|
+
valid: z7.boolean(),
|
|
729
|
+
errors: z7.array(z7.unknown()),
|
|
730
|
+
warnings: z7.array(z7.unknown()),
|
|
731
|
+
estimatedCredits: z7.number().nullable(),
|
|
732
|
+
estimatedCost: z7.record(z7.unknown()).nullable()
|
|
819
733
|
},
|
|
820
734
|
annotations: {
|
|
821
735
|
readOnlyHint: true,
|
|
@@ -825,6 +739,26 @@ function registerAutoValidate(server, deps) {
|
|
|
825
739
|
}
|
|
826
740
|
},
|
|
827
741
|
async (args) => {
|
|
742
|
+
if (args.method === "symbol") {
|
|
743
|
+
if (!args.exchange || !args.symbol) {
|
|
744
|
+
return fail(
|
|
745
|
+
`method=symbol needs exchange, one of ${EXCHANGES.join(", ")}, and symbol.`
|
|
746
|
+
);
|
|
747
|
+
}
|
|
748
|
+
const exchange = args.exchange;
|
|
749
|
+
const symbol = args.symbol;
|
|
750
|
+
return run(deps, async () => {
|
|
751
|
+
const response = await deps.sdk.auto.validateSymbol(exchange, symbol);
|
|
752
|
+
const supported = response.supported === "true";
|
|
753
|
+
return {
|
|
754
|
+
valid: supported,
|
|
755
|
+
errors: supported ? [] : [`${symbol} has no market data on ${exchange}.`],
|
|
756
|
+
warnings: [],
|
|
757
|
+
estimatedCredits: null,
|
|
758
|
+
estimatedCost: null
|
|
759
|
+
};
|
|
760
|
+
});
|
|
761
|
+
}
|
|
828
762
|
if (!args.query && !args.draftId) {
|
|
829
763
|
return fail("Pass either query or draftId. Retry with one of them set.");
|
|
830
764
|
}
|
|
@@ -849,7 +783,7 @@ function registerAutoValidate(server, deps) {
|
|
|
849
783
|
}
|
|
850
784
|
|
|
851
785
|
// src/tools/chat.ts
|
|
852
|
-
import { z as
|
|
786
|
+
import { z as z8 } from "zod";
|
|
853
787
|
function registerChat(server, deps) {
|
|
854
788
|
server.registerTool(
|
|
855
789
|
"market_chat",
|
|
@@ -857,7 +791,7 @@ function registerChat(server, deps) {
|
|
|
857
791
|
title: "Market chat",
|
|
858
792
|
description: "Ask Elfa for written market analysis grounded in its social data. Costs credits and varies by speed, so fast is the cheaper option. Pass sessionId from a previous reply to continue the same conversation.",
|
|
859
793
|
inputSchema: {
|
|
860
|
-
analysisType:
|
|
794
|
+
analysisType: z8.enum([
|
|
861
795
|
"chat",
|
|
862
796
|
"macro",
|
|
863
797
|
"summary",
|
|
@@ -867,20 +801,20 @@ function registerChat(server, deps) {
|
|
|
867
801
|
]).default("chat").describe(
|
|
868
802
|
"chat needs message. tokenIntro and tokenAnalysis need symbol, or chain plus contractAddress. accountAnalysis needs username. macro and summary need nothing else."
|
|
869
803
|
),
|
|
870
|
-
message:
|
|
871
|
-
sessionId:
|
|
872
|
-
speed:
|
|
804
|
+
message: z8.string().optional().describe("The question, required for analysisType=chat."),
|
|
805
|
+
sessionId: z8.string().optional().describe("Continue an earlier conversation."),
|
|
806
|
+
speed: z8.enum(["fast", "expert", "adaptive"]).default("fast").describe(
|
|
873
807
|
"Defaults to fast, which is cheaper and shallower. Ask for expert when the answer needs deeper reasoning."
|
|
874
808
|
),
|
|
875
|
-
symbol:
|
|
876
|
-
chain:
|
|
877
|
-
contractAddress:
|
|
878
|
-
username:
|
|
809
|
+
symbol: z8.string().optional().describe("Token symbol, for token analysis."),
|
|
810
|
+
chain: z8.string().optional().describe("Chain, paired with contractAddress."),
|
|
811
|
+
contractAddress: z8.string().optional().describe("Contract address, paired with chain."),
|
|
812
|
+
username: z8.string().optional().describe("X username, for analysisType=accountAnalysis.")
|
|
879
813
|
},
|
|
880
814
|
outputSchema: {
|
|
881
|
-
message:
|
|
882
|
-
sessionId:
|
|
883
|
-
creditsConsumed:
|
|
815
|
+
message: z8.string(),
|
|
816
|
+
sessionId: z8.string().nullable(),
|
|
817
|
+
creditsConsumed: z8.number().nullable()
|
|
884
818
|
},
|
|
885
819
|
annotations: {
|
|
886
820
|
readOnlyHint: true,
|
|
@@ -929,7 +863,7 @@ function registerChat(server, deps) {
|
|
|
929
863
|
}
|
|
930
864
|
|
|
931
865
|
// src/tools/mentions.ts
|
|
932
|
-
import { z as
|
|
866
|
+
import { z as z9 } from "zod";
|
|
933
867
|
function registerMentions(server, deps) {
|
|
934
868
|
server.registerTool(
|
|
935
869
|
"mentions",
|
|
@@ -937,32 +871,32 @@ function registerMentions(server, deps) {
|
|
|
937
871
|
title: "Mentions",
|
|
938
872
|
description: "Social mentions from X and Telegram. 1 credit per call. Returns engagement metrics and a link per post, not the post text. mode=top ranks one ticker's mentions by engagement. mode=search filters by keywords or by account. mode=news returns the token news feed.",
|
|
939
873
|
inputSchema: {
|
|
940
|
-
mode:
|
|
874
|
+
mode: z9.enum(["top", "search", "news"]).describe(
|
|
941
875
|
"top needs ticker. search needs keywords or accountName. news is a feed and needs neither."
|
|
942
876
|
),
|
|
943
|
-
ticker:
|
|
944
|
-
keywords:
|
|
945
|
-
accountName:
|
|
946
|
-
coinIds:
|
|
947
|
-
searchType:
|
|
877
|
+
ticker: z9.string().optional().describe('Ticker for mode=top, for example "BTC" or "$SOL".'),
|
|
878
|
+
keywords: z9.string().optional().describe("Up to 5 comma separated keywords for mode=search."),
|
|
879
|
+
accountName: z9.string().optional().describe("X username for mode=search, without the @."),
|
|
880
|
+
coinIds: z9.string().optional().describe("Comma separated CoinGecko coin ids to filter mode=news."),
|
|
881
|
+
searchType: z9.enum(["and", "or"]).optional().describe("How multiple keywords combine in mode=search."),
|
|
948
882
|
timeWindow: timeWindowArg,
|
|
949
|
-
from:
|
|
883
|
+
from: z9.number().int().optional().describe(
|
|
950
884
|
"Start of an absolute range, unix seconds. Use with to. For mode=search the range must span at least 1 day and at most 30."
|
|
951
885
|
),
|
|
952
886
|
to: toArg,
|
|
953
887
|
page: pageArg,
|
|
954
888
|
pageSize: pageSizeArg,
|
|
955
|
-
limit:
|
|
956
|
-
cursor:
|
|
889
|
+
limit: z9.number().int().min(1).max(30).default(10).describe("Result count for mode=search."),
|
|
890
|
+
cursor: z9.string().optional().describe("Pagination cursor from a previous mode=search response."),
|
|
957
891
|
reposts: repostsArg,
|
|
958
892
|
verbosity: verbosityArg
|
|
959
893
|
},
|
|
960
894
|
outputSchema: {
|
|
961
|
-
mode:
|
|
962
|
-
notice:
|
|
963
|
-
total:
|
|
964
|
-
next:
|
|
965
|
-
mentions:
|
|
895
|
+
mode: z9.string(),
|
|
896
|
+
notice: z9.string(),
|
|
897
|
+
total: z9.number().nullable(),
|
|
898
|
+
next: z9.string().nullable(),
|
|
899
|
+
mentions: z9.array(z9.record(z9.unknown()))
|
|
966
900
|
},
|
|
967
901
|
annotations: {
|
|
968
902
|
readOnlyHint: true,
|
|
@@ -1068,7 +1002,7 @@ function registerMentions(server, deps) {
|
|
|
1068
1002
|
}
|
|
1069
1003
|
|
|
1070
1004
|
// src/tools/narratives.ts
|
|
1071
|
-
import { z as
|
|
1005
|
+
import { z as z10 } from "zod";
|
|
1072
1006
|
function registerNarratives(server, deps) {
|
|
1073
1007
|
server.registerTool(
|
|
1074
1008
|
"narratives",
|
|
@@ -1076,22 +1010,22 @@ function registerNarratives(server, deps) {
|
|
|
1076
1010
|
title: "Narratives",
|
|
1077
1011
|
description: "Written narrative analysis with source links, for when counts are not enough. 5 credits per call, so prefer trending or mentions when metrics will do. scope=market extracts the narratives moving the market. scope=keywords summarises events for keywords you supply, and can take over a minute to return.",
|
|
1078
1012
|
inputSchema: {
|
|
1079
|
-
scope:
|
|
1080
|
-
keywords:
|
|
1081
|
-
searchType:
|
|
1082
|
-
timeFrame:
|
|
1083
|
-
maxNarratives:
|
|
1084
|
-
maxTweetsPerNarrative:
|
|
1013
|
+
scope: z10.enum(["market", "keywords"]).default("market").describe("market is a broad sweep. keywords needs the keywords argument."),
|
|
1014
|
+
keywords: z10.string().optional().describe("Up to 5 comma separated keywords for scope=keywords."),
|
|
1015
|
+
searchType: z10.enum(["and", "or"]).optional().describe("How multiple keywords combine for scope=keywords."),
|
|
1016
|
+
timeFrame: z10.enum(["day", "week"]).optional().describe("Lookback for scope=market."),
|
|
1017
|
+
maxNarratives: z10.number().int().min(1).max(20).optional().describe("Cap the narratives returned for scope=market."),
|
|
1018
|
+
maxTweetsPerNarrative: z10.number().int().min(1).max(20).optional().describe("Cap the sources per narrative for scope=market."),
|
|
1085
1019
|
timeWindow: timeWindowArg,
|
|
1086
1020
|
from: fromArg,
|
|
1087
1021
|
to: toArg
|
|
1088
1022
|
},
|
|
1089
1023
|
outputSchema: {
|
|
1090
|
-
scope:
|
|
1091
|
-
notice:
|
|
1092
|
-
items:
|
|
1093
|
-
matched:
|
|
1094
|
-
note:
|
|
1024
|
+
scope: z10.string(),
|
|
1025
|
+
notice: z10.string(),
|
|
1026
|
+
items: z10.array(z10.record(z10.unknown())),
|
|
1027
|
+
matched: z10.number().nullable(),
|
|
1028
|
+
note: z10.string().nullable()
|
|
1095
1029
|
},
|
|
1096
1030
|
annotations: {
|
|
1097
1031
|
readOnlyHint: true,
|
|
@@ -1164,7 +1098,7 @@ function registerNarratives(server, deps) {
|
|
|
1164
1098
|
}
|
|
1165
1099
|
|
|
1166
1100
|
// src/tools/status.ts
|
|
1167
|
-
import { z as
|
|
1101
|
+
import { z as z11 } from "zod";
|
|
1168
1102
|
var REPORTED = [
|
|
1169
1103
|
"tier",
|
|
1170
1104
|
"status",
|
|
@@ -1200,9 +1134,9 @@ function registerStatus(server, deps) {
|
|
|
1200
1134
|
description: "Check the Elfa API key tier, credit usage and remaining requests, and confirm the API is reachable. Free. Call this first when a request fails with an auth or credit error.",
|
|
1201
1135
|
inputSchema: {},
|
|
1202
1136
|
outputSchema: {
|
|
1203
|
-
reachable:
|
|
1204
|
-
key:
|
|
1205
|
-
problem:
|
|
1137
|
+
reachable: z11.boolean(),
|
|
1138
|
+
key: z11.record(z11.unknown()).nullable(),
|
|
1139
|
+
problem: z11.string().nullable()
|
|
1206
1140
|
},
|
|
1207
1141
|
annotations: {
|
|
1208
1142
|
readOnlyHint: true,
|
|
@@ -1226,7 +1160,7 @@ function registerStatus(server, deps) {
|
|
|
1226
1160
|
}
|
|
1227
1161
|
|
|
1228
1162
|
// src/tools/trending.ts
|
|
1229
|
-
import { z as
|
|
1163
|
+
import { z as z12 } from "zod";
|
|
1230
1164
|
function registerTrending(server, deps) {
|
|
1231
1165
|
server.registerTool(
|
|
1232
1166
|
"trending",
|
|
@@ -1234,22 +1168,22 @@ function registerTrending(server, deps) {
|
|
|
1234
1168
|
title: "Trending",
|
|
1235
1169
|
description: "What is gaining social attention right now. 1 credit per call. scope=tokens returns tickers ranked by mention volume with the change against the previous window. scope=contracts_twitter and scope=contracts_telegram return trending contract addresses.",
|
|
1236
1170
|
inputSchema: {
|
|
1237
|
-
scope:
|
|
1238
|
-
timeWindow:
|
|
1171
|
+
scope: z12.enum(["tokens", "contracts_twitter", "contracts_telegram"]).default("tokens").describe("Which trending list to return."),
|
|
1172
|
+
timeWindow: z12.string().optional().describe(
|
|
1239
1173
|
'Relative window such as "24h" or "7d". Defaults to 24h unless both from and to are given.'
|
|
1240
1174
|
),
|
|
1241
1175
|
from: fromArg,
|
|
1242
1176
|
to: toArg,
|
|
1243
1177
|
page: pageArg,
|
|
1244
1178
|
pageSize: pageSizeArg,
|
|
1245
|
-
minMentions:
|
|
1179
|
+
minMentions: z12.number().int().min(1).default(5).describe("Drop entries below this mention count.")
|
|
1246
1180
|
},
|
|
1247
1181
|
outputSchema: {
|
|
1248
|
-
scope:
|
|
1249
|
-
page:
|
|
1250
|
-
pageSize:
|
|
1251
|
-
total:
|
|
1252
|
-
items:
|
|
1182
|
+
scope: z12.string(),
|
|
1183
|
+
page: z12.number().nullable(),
|
|
1184
|
+
pageSize: z12.number().nullable(),
|
|
1185
|
+
total: z12.number().nullable(),
|
|
1186
|
+
items: z12.array(z12.record(z12.unknown()))
|
|
1253
1187
|
},
|
|
1254
1188
|
annotations: {
|
|
1255
1189
|
readOnlyHint: true,
|
|
@@ -1308,7 +1242,7 @@ var INSTRUCTIONS = `Elfa gives you crypto social intelligence plus Auto, a condi
|
|
|
1308
1242
|
|
|
1309
1243
|
Start cheap. trending, mentions and account_stats cost 1 credit. narratives costs 5 and market_chat costs more, so reach for them only when metrics are not enough. If a call fails on auth or credits, check api_status.
|
|
1310
1244
|
|
|
1311
|
-
Auto is a three step flow: auto_build drafts EQL from plain language, auto_validate checks it and returns the cost, auto_query_write activates it. Never activate without showing the user the estimated cost and the action that will fire.
|
|
1245
|
+
Auto is a three step flow: auto_build drafts EQL from plain language, auto_validate checks it and returns the cost, auto_query_write activates it. Never activate without showing the user the estimated cost and the action that will fire. Some Auto mutations need ELFA_HMAC_SECRET set; notification-only ones do not.
|
|
1312
1246
|
|
|
1313
1247
|
Auto has no push channel here. Poll auto_query with method=get and wait for pollAfterSeconds between calls.
|
|
1314
1248
|
|
|
@@ -1329,7 +1263,6 @@ function createServer(deps) {
|
|
|
1329
1263
|
registerAutoQuery(server, deps);
|
|
1330
1264
|
registerAutoQueryWrite(server, deps);
|
|
1331
1265
|
registerAutoDraft(server, deps);
|
|
1332
|
-
registerAutoExchanges(server, deps);
|
|
1333
1266
|
return server;
|
|
1334
1267
|
}
|
|
1335
1268
|
|
package/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"server": {
|
|
3
3
|
"name": "elfa",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"docs": "https://docs.elfa.ai",
|
|
6
6
|
"spec": "https://docs.elfa.ai/swagger/swagger.json",
|
|
7
7
|
"specScope": "/v2"
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
{
|
|
122
122
|
"name": "auto_validate",
|
|
123
123
|
"title": "Validate Auto query",
|
|
124
|
-
"summary": "Check EQL syntax and get a cost estimate before activating
|
|
124
|
+
"summary": "Check EQL syntax and get a cost estimate before activating, or check that a symbol has market data on a venue.",
|
|
125
125
|
"credits": "Free",
|
|
126
126
|
"annotations": {
|
|
127
127
|
"readOnlyHint": true,
|
|
@@ -131,7 +131,8 @@
|
|
|
131
131
|
},
|
|
132
132
|
"operations": [
|
|
133
133
|
"auto-validate-query-v2",
|
|
134
|
-
"auto-validate-query-draft-v2"
|
|
134
|
+
"auto-validate-query-draft-v2",
|
|
135
|
+
"auto-validate-symbol-v2"
|
|
135
136
|
]
|
|
136
137
|
},
|
|
137
138
|
{
|
|
@@ -189,24 +190,6 @@
|
|
|
189
190
|
"auto-delete-query-draft-v2",
|
|
190
191
|
"auto-convert-query-draft-v2"
|
|
191
192
|
]
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
"name": "auto_exchanges",
|
|
195
|
-
"title": "Auto exchange connections",
|
|
196
|
-
"summary": "List, connect and disconnect the exchange accounts Auto uses for order actions, and check whether a symbol is tradeable.",
|
|
197
|
-
"credits": "Free",
|
|
198
|
-
"annotations": {
|
|
199
|
-
"readOnlyHint": false,
|
|
200
|
-
"destructiveHint": true,
|
|
201
|
-
"idempotentHint": false,
|
|
202
|
-
"openWorldHint": false
|
|
203
|
-
},
|
|
204
|
-
"operations": [
|
|
205
|
-
"auto-list-exchanges-v2",
|
|
206
|
-
"auto-connect-exchange-v2",
|
|
207
|
-
"auto-disconnect-exchange-v2",
|
|
208
|
-
"auto-validate-symbol-v2"
|
|
209
|
-
]
|
|
210
193
|
}
|
|
211
194
|
],
|
|
212
195
|
"unexposed": [
|
|
@@ -224,6 +207,21 @@
|
|
|
224
207
|
"operationId": "auto-stream-query-v2",
|
|
225
208
|
"reason": "sse",
|
|
226
209
|
"note": "Long lived streams have no tool equivalent. Poll with auto_query."
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"operationId": "auto-list-exchanges-v2",
|
|
213
|
+
"reason": "not-advertised",
|
|
214
|
+
"note": "Exchange connections are no longer part of the documented Auto surface."
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"operationId": "auto-connect-exchange-v2",
|
|
218
|
+
"reason": "not-advertised",
|
|
219
|
+
"note": "Exchange connections are no longer part of the documented Auto surface."
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"operationId": "auto-disconnect-exchange-v2",
|
|
223
|
+
"reason": "not-advertised",
|
|
224
|
+
"note": "Exchange connections are no longer part of the documented Auto surface."
|
|
227
225
|
}
|
|
228
226
|
]
|
|
229
227
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elfa-ai/mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Model Context Protocol server for the Elfa API - crypto social intelligence and the Auto condition engine",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"author": "Elfa
|
|
6
|
+
"author": "Elfa AI",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"mcpName": "ai.elfa/mcp",
|
|
9
9
|
"main": "dist/index.js",
|