@stellar-agent/mcp-server 0.4.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/LICENSE +21 -0
- package/README.md +16 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +698 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +11 -0
- package/dist/server.js.map +1 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 stellar-agent-bridge contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @stellar-agent/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP stdio server for `stellar-agent`.
|
|
4
|
+
|
|
5
|
+
The server exposes agent-safe tools for the existing CLI workflows instead of duplicating payment logic. Tools include Testnet init/doctor/Friendbot funding, issued-asset and contract-asset smoke scenarios, wallet creation and balances, trustline add/remove, fee-aware payment quote/send, guarded Testnet batch payments, local x402 and MPP HTTP payments, claimable balance create/list/claim, and Stellar CLI-backed contract operations including asset deploy, info, read, fetch, invoke, upload, deploy, extend, and restore.
|
|
6
|
+
|
|
7
|
+
Build and run from a checkout:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm build
|
|
11
|
+
STELLAR_AGENT_CLI=packages/cli/dist/index.js node packages/mcp-server/dist/server.js
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
When installed globally, `stellar-agent-mcp` uses the `stellar-agent` binary by default. Set `STELLAR_AGENT_CLI=/path/to/stellar-agent` or `STELLAR_AGENT_CLI=/path/to/packages/cli/dist/index.js` to override it.
|
|
15
|
+
|
|
16
|
+
Every tool calls `stellar-agent --json` and returns the parsed JSON output plus the CLI exit code.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
export interface JsonSchema {
|
|
3
|
+
type: "object";
|
|
4
|
+
properties: Record<string, unknown>;
|
|
5
|
+
required?: string[];
|
|
6
|
+
additionalProperties?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface McpTool {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
inputSchema: JsonSchema;
|
|
12
|
+
buildArgs(input: Record<string, unknown>): string[];
|
|
13
|
+
}
|
|
14
|
+
export interface CliExecutionResult {
|
|
15
|
+
status: number;
|
|
16
|
+
stdout: string;
|
|
17
|
+
stderr: string;
|
|
18
|
+
}
|
|
19
|
+
export type CliRunner = (args: string[]) => Promise<CliExecutionResult>;
|
|
20
|
+
export interface McpRequest {
|
|
21
|
+
jsonrpc?: string;
|
|
22
|
+
id?: string | number | null;
|
|
23
|
+
method: string;
|
|
24
|
+
params?: any;
|
|
25
|
+
}
|
|
26
|
+
export interface McpResponse {
|
|
27
|
+
jsonrpc: "2.0";
|
|
28
|
+
id?: string | number | null;
|
|
29
|
+
result?: unknown;
|
|
30
|
+
error?: {
|
|
31
|
+
code: number;
|
|
32
|
+
message: string;
|
|
33
|
+
data?: unknown;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export declare const MCP_TOOLS: McpTool[];
|
|
37
|
+
export declare function buildCliArgs(toolName: string, input?: Record<string, unknown>): string[];
|
|
38
|
+
export declare function callMcpTool(name: string, input: Record<string, unknown>, runner: CliRunner): Promise<{
|
|
39
|
+
content: Array<{
|
|
40
|
+
type: "text";
|
|
41
|
+
text: string;
|
|
42
|
+
}>;
|
|
43
|
+
isError?: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
export declare function handleMcpRequest(request: McpRequest, runner: CliRunner): Promise<McpResponse | undefined>;
|
|
46
|
+
export declare function createChildProcessCliRunner(cliBinary?: string): CliRunner;
|
|
47
|
+
export declare function encodeMcpMessage(message: unknown): string;
|
|
48
|
+
export declare function createMcpMessageParser(onMessage: (message: McpRequest) => void): (chunk: Buffer | string) => void;
|
|
49
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;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EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAahF;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAuB/G;AAED,wBAAgB,2BAA2B,CAAC,SAAS,SAAmD,GAAG,SAAS,CAuBnH;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAGzD;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAkBjH"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
import { redactSensitive } from "@stellar-agent/core";
|
|
2
|
+
import { Buffer } from "node:buffer";
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
const commonProperties = {
|
|
6
|
+
configPath: { type: "string", description: "Optional path to stellar-agent config.yaml." },
|
|
7
|
+
profile: { type: "string", enum: ["testnet", "mainnet", "local"], description: "Network profile name." },
|
|
8
|
+
policyPath: { type: "string", description: "Optional path to a policy YAML file." },
|
|
9
|
+
noCache: { type: "boolean", description: "Disable session caches for network lookups." }
|
|
10
|
+
};
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
const { version: MCP_VERSION } = require("../package.json");
|
|
13
|
+
export const MCP_TOOLS = [
|
|
14
|
+
tool("stellar_testnet_doctor", "Run Testnet readiness checks.", {}, (input) => [
|
|
15
|
+
"testnet",
|
|
16
|
+
"doctor",
|
|
17
|
+
...(bool(input, "live") ? ["--live"] : [])
|
|
18
|
+
], { live: { type: "boolean" } }),
|
|
19
|
+
tool("stellar_testnet_init", "Initialize local Testnet wallets, config, policy, logs, and receipts.", {}, (input) => [
|
|
20
|
+
"testnet",
|
|
21
|
+
"init",
|
|
22
|
+
...(bool(input, "fund") === false ? ["--no-fund"] : []),
|
|
23
|
+
...(bool(input, "overwritePolicy") ? ["--overwrite-policy"] : [])
|
|
24
|
+
], { fund: { type: "boolean" }, overwritePolicy: { type: "boolean" } }),
|
|
25
|
+
tool("stellar_testnet_fund", "Fund a Testnet account or local wallet with Friendbot.", {}, (input) => [
|
|
26
|
+
"testnet",
|
|
27
|
+
"fund",
|
|
28
|
+
...(string(input, "address") ? ["--address", requiredString(input, "address")] : ["--account", string(input, "account") ?? "agent"])
|
|
29
|
+
], { account: { type: "string" }, address: { type: "string" } }),
|
|
30
|
+
tool("stellar_testnet_scenario_issued_asset_payment", "Run the issued-asset trustline and payment Testnet scenario.", {}, (input) => [
|
|
31
|
+
"testnet",
|
|
32
|
+
"scenario",
|
|
33
|
+
"issued-asset-payment",
|
|
34
|
+
"--issuer",
|
|
35
|
+
string(input, "issuer") ?? "issuer",
|
|
36
|
+
"--recipient",
|
|
37
|
+
string(input, "recipient") ?? "merchant",
|
|
38
|
+
"--amount",
|
|
39
|
+
string(input, "amount") ?? "0.0000001",
|
|
40
|
+
"--memo",
|
|
41
|
+
string(input, "memo") ?? "issued-asset scenario",
|
|
42
|
+
...option(input, "assetCode", "--asset-code"),
|
|
43
|
+
...(bool(input, "fund") === false ? ["--no-fund"] : []),
|
|
44
|
+
...(bool(input, "dryRun") ? ["--dry-run"] : [])
|
|
45
|
+
], {
|
|
46
|
+
issuer: { type: "string" },
|
|
47
|
+
recipient: { type: "string" },
|
|
48
|
+
assetCode: { type: "string" },
|
|
49
|
+
amount: { type: "string" },
|
|
50
|
+
memo: { type: "string" },
|
|
51
|
+
fund: { type: "boolean" },
|
|
52
|
+
dryRun: { type: "boolean" }
|
|
53
|
+
}),
|
|
54
|
+
tool("stellar_testnet_scenario_contract_asset_smoke", "Run the Stellar CLI-backed asset contract Testnet smoke scenario.", {}, (input) => [
|
|
55
|
+
"testnet",
|
|
56
|
+
"scenario",
|
|
57
|
+
"contract-asset-smoke",
|
|
58
|
+
"--source",
|
|
59
|
+
string(input, "source") ?? "agent",
|
|
60
|
+
"--asset",
|
|
61
|
+
string(input, "asset") ?? "native",
|
|
62
|
+
"--ledgers-to-extend",
|
|
63
|
+
String(number(input, "ledgersToExtend") ?? 535679),
|
|
64
|
+
...option(input, "alias", "--alias"),
|
|
65
|
+
...option(input, "stellarBinary", "--stellar-binary"),
|
|
66
|
+
...option(input, "stellarConfigDir", "--stellar-config-dir"),
|
|
67
|
+
...(bool(input, "stellarNoCache") ? ["--stellar-no-cache"] : []),
|
|
68
|
+
...(bool(input, "fund") === false ? ["--no-fund"] : []),
|
|
69
|
+
...(bool(input, "dryRun") ? ["--dry-run"] : [])
|
|
70
|
+
], {
|
|
71
|
+
source: { type: "string" },
|
|
72
|
+
asset: { type: "string" },
|
|
73
|
+
alias: { type: "string" },
|
|
74
|
+
ledgersToExtend: { type: "number" },
|
|
75
|
+
stellarBinary: { type: "string" },
|
|
76
|
+
stellarConfigDir: { type: "string" },
|
|
77
|
+
stellarNoCache: { type: "boolean" },
|
|
78
|
+
fund: { type: "boolean" },
|
|
79
|
+
dryRun: { type: "boolean" }
|
|
80
|
+
}),
|
|
81
|
+
tool("stellar_wallet_create_testnet", "Create or load a named local Testnet wallet.", {}, (input) => [
|
|
82
|
+
"wallet",
|
|
83
|
+
"create-testnet",
|
|
84
|
+
string(input, "name") ?? "agent",
|
|
85
|
+
...(bool(input, "fund") ? ["--fund"] : [])
|
|
86
|
+
], { name: { type: "string" }, fund: { type: "boolean" } }),
|
|
87
|
+
tool("stellar_wallet_balance", "Read balances for a local wallet.", {}, (input) => [
|
|
88
|
+
"wallet",
|
|
89
|
+
"balance",
|
|
90
|
+
"--account",
|
|
91
|
+
string(input, "account") ?? "agent"
|
|
92
|
+
], { account: { type: "string" } }),
|
|
93
|
+
tool("stellar_wallet_trustline_list", "List issued-asset trustlines for a local wallet.", {}, (input) => [
|
|
94
|
+
"wallet",
|
|
95
|
+
"trustline",
|
|
96
|
+
"list",
|
|
97
|
+
"--account",
|
|
98
|
+
string(input, "account") ?? "merchant"
|
|
99
|
+
], { account: { type: "string" } }),
|
|
100
|
+
tool("stellar_wallet_trustline_add", "Add or update an issued-asset trustline.", { asset: true }, (input) => [
|
|
101
|
+
"wallet",
|
|
102
|
+
"trustline",
|
|
103
|
+
"add",
|
|
104
|
+
"--asset",
|
|
105
|
+
requiredString(input, "asset"),
|
|
106
|
+
"--account",
|
|
107
|
+
string(input, "account") ?? "merchant",
|
|
108
|
+
...(string(input, "limit") ? ["--limit", requiredString(input, "limit")] : [])
|
|
109
|
+
], { asset: { type: "string" }, account: { type: "string" }, limit: { type: "string" } }),
|
|
110
|
+
tool("stellar_wallet_trustline_remove", "Remove an issued-asset trustline by setting its limit to zero.", { asset: true }, (input) => [
|
|
111
|
+
"wallet",
|
|
112
|
+
"trustline",
|
|
113
|
+
"remove",
|
|
114
|
+
"--asset",
|
|
115
|
+
requiredString(input, "asset"),
|
|
116
|
+
"--account",
|
|
117
|
+
string(input, "account") ?? "merchant"
|
|
118
|
+
], { asset: { type: "string" }, account: { type: "string" } }),
|
|
119
|
+
tool("stellar_approval_create_payment", "Create a local payment approval request.", { to: true, amount: true }, (input) => [
|
|
120
|
+
"approval",
|
|
121
|
+
"create-payment",
|
|
122
|
+
"--to",
|
|
123
|
+
requiredString(input, "to"),
|
|
124
|
+
"--amount",
|
|
125
|
+
requiredString(input, "amount"),
|
|
126
|
+
"--asset",
|
|
127
|
+
string(input, "asset") ?? "XLM",
|
|
128
|
+
"--from",
|
|
129
|
+
string(input, "from") ?? "agent",
|
|
130
|
+
...option(input, "memo", "--memo")
|
|
131
|
+
], { ...paymentProperties(), from: { type: "string" } }),
|
|
132
|
+
tool("stellar_approval_create_transaction", "Create a local transaction-XDR approval request for browser-wallet signing.", { xdr: true }, (input) => [
|
|
133
|
+
"approval",
|
|
134
|
+
"create-transaction",
|
|
135
|
+
"--xdr",
|
|
136
|
+
requiredString(input, "xdr"),
|
|
137
|
+
"--summary",
|
|
138
|
+
string(input, "summary") ?? "Approve transaction XDR",
|
|
139
|
+
...option(input, "network", "--network")
|
|
140
|
+
], { xdr: { type: "string" }, summary: { type: "string" }, network: { type: "string", enum: ["testnet", "mainnet", "local"] } }),
|
|
141
|
+
tool("stellar_approval_list", "List local approval requests.", {}, () => ["approval", "list"], {}),
|
|
142
|
+
tool("stellar_approval_decide", "Approve or deny a local approval request.", { id: true, decision: true }, (input) => [
|
|
143
|
+
"approval",
|
|
144
|
+
"decide",
|
|
145
|
+
requiredString(input, "id"),
|
|
146
|
+
approvalDecisionFlag(input),
|
|
147
|
+
...option(input, "reason", "--reason")
|
|
148
|
+
], {
|
|
149
|
+
id: { type: "string" },
|
|
150
|
+
decision: { type: "string", enum: ["approve", "deny"] },
|
|
151
|
+
reason: { type: "string" }
|
|
152
|
+
}),
|
|
153
|
+
tool("stellar_approval_record_signed_transaction", "Record signed transaction XDR on an approval request.", { id: true, signerPublicKey: true, signedTransactionXdr: true }, (input) => [
|
|
154
|
+
"approval",
|
|
155
|
+
"decide",
|
|
156
|
+
requiredString(input, "id"),
|
|
157
|
+
"--signer-public-key",
|
|
158
|
+
requiredString(input, "signerPublicKey"),
|
|
159
|
+
"--signed-transaction-xdr",
|
|
160
|
+
requiredString(input, "signedTransactionXdr"),
|
|
161
|
+
...option(input, "reason", "--reason")
|
|
162
|
+
], {
|
|
163
|
+
id: { type: "string" },
|
|
164
|
+
signerPublicKey: { type: "string" },
|
|
165
|
+
signedTransactionXdr: { type: "string" },
|
|
166
|
+
reason: { type: "string" }
|
|
167
|
+
}),
|
|
168
|
+
tool("stellar_tx_submit_xdr", "Submit signed transaction XDR to Horizon on Testnet or guarded Mainnet.", { xdr: true }, (input) => [
|
|
169
|
+
"tx",
|
|
170
|
+
"submit-xdr",
|
|
171
|
+
"--xdr",
|
|
172
|
+
requiredString(input, "xdr"),
|
|
173
|
+
...realFundsFlags(input)
|
|
174
|
+
], { xdr: { type: "string" }, ...realFundsProperties() }),
|
|
175
|
+
tool("stellar_tx_build_payment", "Build unsigned payment transaction XDR for browser-wallet signing on Testnet or guarded Mainnet.", { to: true, amount: true }, (input) => [
|
|
176
|
+
"tx",
|
|
177
|
+
"build-payment",
|
|
178
|
+
"--to",
|
|
179
|
+
requiredString(input, "to"),
|
|
180
|
+
"--amount",
|
|
181
|
+
requiredString(input, "amount"),
|
|
182
|
+
"--asset",
|
|
183
|
+
string(input, "asset") ?? "XLM",
|
|
184
|
+
"--from",
|
|
185
|
+
string(input, "from") ?? "agent",
|
|
186
|
+
...option(input, "memo", "--memo"),
|
|
187
|
+
...realFundsFlags(input)
|
|
188
|
+
], { ...paymentProperties(), from: { type: "string" }, ...realFundsProperties() }),
|
|
189
|
+
tool("stellar_tx_request_payment_signature", "Build payment XDR and create a transaction approval request.", { to: true, amount: true }, (input) => [
|
|
190
|
+
"tx",
|
|
191
|
+
"request-payment-signature",
|
|
192
|
+
"--to",
|
|
193
|
+
requiredString(input, "to"),
|
|
194
|
+
"--amount",
|
|
195
|
+
requiredString(input, "amount"),
|
|
196
|
+
"--asset",
|
|
197
|
+
string(input, "asset") ?? "XLM",
|
|
198
|
+
"--from",
|
|
199
|
+
string(input, "from") ?? "agent",
|
|
200
|
+
...option(input, "memo", "--memo"),
|
|
201
|
+
...option(input, "summary", "--summary"),
|
|
202
|
+
...realFundsFlags(input)
|
|
203
|
+
], { ...paymentProperties(), from: { type: "string" }, summary: { type: "string" }, ...realFundsProperties() }),
|
|
204
|
+
tool("stellar_tx_submit_approval", "Submit signed transaction XDR from a local approval request on Testnet or guarded Mainnet.", { id: true }, (input) => [
|
|
205
|
+
"tx",
|
|
206
|
+
"submit-approval",
|
|
207
|
+
requiredString(input, "id"),
|
|
208
|
+
...realFundsFlags(input)
|
|
209
|
+
], { id: { type: "string" }, ...realFundsProperties() }),
|
|
210
|
+
tool("stellar_pay_quote", "Quote and policy-check a payment without submitting it.", { to: true, amount: true }, (input) => [
|
|
211
|
+
"pay",
|
|
212
|
+
"quote",
|
|
213
|
+
"--to",
|
|
214
|
+
requiredString(input, "to"),
|
|
215
|
+
"--amount",
|
|
216
|
+
requiredString(input, "amount"),
|
|
217
|
+
"--asset",
|
|
218
|
+
string(input, "asset") ?? "XLM",
|
|
219
|
+
...option(input, "memo", "--memo"),
|
|
220
|
+
...option(input, "feeStrategy", "--fee-strategy")
|
|
221
|
+
], paymentProperties()),
|
|
222
|
+
tool("stellar_pay_send", "Submit a Testnet payment after policy allows it.", { to: true, amount: true }, (input) => [
|
|
223
|
+
"pay",
|
|
224
|
+
"send",
|
|
225
|
+
"--to",
|
|
226
|
+
requiredString(input, "to"),
|
|
227
|
+
"--amount",
|
|
228
|
+
requiredString(input, "amount"),
|
|
229
|
+
"--asset",
|
|
230
|
+
string(input, "asset") ?? "XLM",
|
|
231
|
+
"--from",
|
|
232
|
+
string(input, "from") ?? "agent",
|
|
233
|
+
...option(input, "approvalId", "--approval-id"),
|
|
234
|
+
...option(input, "memo", "--memo"),
|
|
235
|
+
...option(input, "feeStrategy", "--fee-strategy"),
|
|
236
|
+
...(bool(input, "dryRun") ? ["--dry-run"] : [])
|
|
237
|
+
], { ...paymentProperties(), from: { type: "string" }, approvalId: { type: "string" }, dryRun: { type: "boolean" } }),
|
|
238
|
+
tool("stellar_pay_batch", "Submit multiple guarded Testnet payments in one transaction.", { file: true }, (input) => [
|
|
239
|
+
"pay",
|
|
240
|
+
"batch",
|
|
241
|
+
"--file",
|
|
242
|
+
requiredString(input, "file"),
|
|
243
|
+
"--from",
|
|
244
|
+
string(input, "from") ?? "agent",
|
|
245
|
+
...option(input, "memo", "--memo"),
|
|
246
|
+
...option(input, "feeStrategy", "--fee-strategy"),
|
|
247
|
+
...(bool(input, "dryRun") ? ["--dry-run"] : [])
|
|
248
|
+
], {
|
|
249
|
+
file: { type: "string" },
|
|
250
|
+
from: { type: "string" },
|
|
251
|
+
memo: { type: "string" },
|
|
252
|
+
feeStrategy: { type: "string", enum: ["base", "low", "medium", "high", "p95"] },
|
|
253
|
+
dryRun: { type: "boolean" }
|
|
254
|
+
}),
|
|
255
|
+
tool("stellar_pay_x402", "Pay a local x402-style HTTP 402 resource on Testnet.", { url: true }, (input) => [
|
|
256
|
+
"pay",
|
|
257
|
+
"x402",
|
|
258
|
+
requiredString(input, "url"),
|
|
259
|
+
"--from",
|
|
260
|
+
string(input, "from") ?? "agent",
|
|
261
|
+
...(bool(input, "allowLocalhostDemo") ? ["--allow-localhost-demo"] : []),
|
|
262
|
+
...(bool(input, "dryRun") ? ["--dry-run"] : [])
|
|
263
|
+
], httpPaymentProperties()),
|
|
264
|
+
tool("stellar_pay_mpp", "Pay a local MPP one-time charge resource on Testnet.", { url: true }, (input) => [
|
|
265
|
+
"pay",
|
|
266
|
+
"mpp",
|
|
267
|
+
requiredString(input, "url"),
|
|
268
|
+
"--from",
|
|
269
|
+
string(input, "from") ?? "agent",
|
|
270
|
+
...(bool(input, "allowLocalhostDemo") ? ["--allow-localhost-demo"] : []),
|
|
271
|
+
...(bool(input, "dryRun") ? ["--dry-run"] : [])
|
|
272
|
+
], httpPaymentProperties()),
|
|
273
|
+
tool("stellar_pay_mpp_session", "Pay and use a local MPP session-budget resource on Testnet.", { url: true }, (input) => [
|
|
274
|
+
"pay",
|
|
275
|
+
"mpp-session",
|
|
276
|
+
requiredString(input, "url"),
|
|
277
|
+
"--from",
|
|
278
|
+
string(input, "from") ?? "agent",
|
|
279
|
+
"--requests",
|
|
280
|
+
String(number(input, "requests") ?? 2),
|
|
281
|
+
...(bool(input, "allowLocalhostDemo") ? ["--allow-localhost-demo"] : []),
|
|
282
|
+
...(bool(input, "dryRun") ? ["--dry-run"] : [])
|
|
283
|
+
], {
|
|
284
|
+
url: { type: "string" },
|
|
285
|
+
from: { type: "string" },
|
|
286
|
+
requests: { type: "number" },
|
|
287
|
+
allowLocalhostDemo: { type: "boolean" },
|
|
288
|
+
dryRun: { type: "boolean" }
|
|
289
|
+
}),
|
|
290
|
+
tool("stellar_claimable_create", "Create a Testnet claimable balance.", { to: true, amount: true }, (input) => [
|
|
291
|
+
"claimable",
|
|
292
|
+
"create",
|
|
293
|
+
"--to",
|
|
294
|
+
requiredString(input, "to"),
|
|
295
|
+
"--amount",
|
|
296
|
+
requiredString(input, "amount"),
|
|
297
|
+
"--asset",
|
|
298
|
+
string(input, "asset") ?? "XLM",
|
|
299
|
+
"--from",
|
|
300
|
+
string(input, "from") ?? "agent",
|
|
301
|
+
...stringArray(input, "claimants").flatMap((claimant) => ["--claimant", claimant]),
|
|
302
|
+
...option(input, "claimableAfter", "--claimable-after"),
|
|
303
|
+
...option(input, "claimableBefore", "--claimable-before")
|
|
304
|
+
], {
|
|
305
|
+
to: { type: "string" },
|
|
306
|
+
amount: { type: "string" },
|
|
307
|
+
asset: { type: "string" },
|
|
308
|
+
from: { type: "string" },
|
|
309
|
+
claimants: { type: "array", items: { type: "string" } },
|
|
310
|
+
claimableAfter: { type: "string" },
|
|
311
|
+
claimableBefore: { type: "string" }
|
|
312
|
+
}),
|
|
313
|
+
tool("stellar_claimable_list", "List claimable balances for an account or address.", {}, (input) => [
|
|
314
|
+
"claimable",
|
|
315
|
+
"list",
|
|
316
|
+
...(string(input, "address") ? ["--address", requiredString(input, "address")] : ["--account", string(input, "account") ?? "merchant"])
|
|
317
|
+
], { account: { type: "string" }, address: { type: "string" } }),
|
|
318
|
+
tool("stellar_claimable_claim", "Claim a claimable balance by id.", { balanceId: true }, (input) => [
|
|
319
|
+
"claimable",
|
|
320
|
+
"claim",
|
|
321
|
+
"--balance-id",
|
|
322
|
+
requiredString(input, "balanceId"),
|
|
323
|
+
"--account",
|
|
324
|
+
string(input, "account") ?? "merchant"
|
|
325
|
+
], { balanceId: { type: "string" }, account: { type: "string" } }),
|
|
326
|
+
tool("stellar_contract_doctor", "Check whether the Stellar CLI is available.", {}, (input) => [
|
|
327
|
+
"contract",
|
|
328
|
+
"doctor",
|
|
329
|
+
...option(input, "stellarBinary", "--stellar-binary")
|
|
330
|
+
], { stellarBinary: { type: "string" } }),
|
|
331
|
+
tool("stellar_contract_invoke", "Invoke a deployed Soroban contract through Stellar CLI.", { id: true, source: true, fn: true }, (input) => [
|
|
332
|
+
"contract",
|
|
333
|
+
"invoke",
|
|
334
|
+
"--id",
|
|
335
|
+
requiredString(input, "id"),
|
|
336
|
+
"--source",
|
|
337
|
+
requiredString(input, "source"),
|
|
338
|
+
"--fn",
|
|
339
|
+
requiredString(input, "fn"),
|
|
340
|
+
...contractArgs(input),
|
|
341
|
+
...networkAndStellarBinary(input)
|
|
342
|
+
], contractProperties({ id: true, source: true, fn: true, arg: true })),
|
|
343
|
+
tool("stellar_contract_upload", "Upload contract Wasm bytecode through Stellar CLI.", { source: true, wasm: true }, (input) => [
|
|
344
|
+
"contract",
|
|
345
|
+
"upload",
|
|
346
|
+
"--source",
|
|
347
|
+
requiredString(input, "source"),
|
|
348
|
+
"--wasm",
|
|
349
|
+
requiredString(input, "wasm"),
|
|
350
|
+
...networkAndStellarBinary(input)
|
|
351
|
+
], contractProperties({ source: true, wasm: true })),
|
|
352
|
+
tool("stellar_contract_deploy", "Deploy a Wasm contract through Stellar CLI.", { source: true }, (input) => [
|
|
353
|
+
"contract",
|
|
354
|
+
"deploy",
|
|
355
|
+
"--source",
|
|
356
|
+
requiredString(input, "source"),
|
|
357
|
+
...option(input, "wasm", "--wasm"),
|
|
358
|
+
...option(input, "wasmHash", "--wasm-hash"),
|
|
359
|
+
...option(input, "alias", "--alias"),
|
|
360
|
+
...contractArgs(input),
|
|
361
|
+
...networkAndStellarBinary(input)
|
|
362
|
+
], contractProperties({ source: true, wasm: true, wasmHash: true, alias: true, arg: true })),
|
|
363
|
+
tool("stellar_contract_asset_deploy", "Deploy a Stellar Asset Contract through Stellar CLI.", { source: true, asset: true }, (input) => [
|
|
364
|
+
"contract",
|
|
365
|
+
"asset-deploy",
|
|
366
|
+
"--source",
|
|
367
|
+
requiredString(input, "source"),
|
|
368
|
+
"--asset",
|
|
369
|
+
requiredString(input, "asset"),
|
|
370
|
+
...option(input, "alias", "--alias"),
|
|
371
|
+
...networkAndStellarBinary(input)
|
|
372
|
+
], contractProperties({ source: true, asset: true, alias: true })),
|
|
373
|
+
tool("stellar_contract_asset_id", "Calculate a Stellar Asset Contract id through Stellar CLI.", { asset: true }, (input) => [
|
|
374
|
+
"contract",
|
|
375
|
+
"asset-id",
|
|
376
|
+
"--asset",
|
|
377
|
+
requiredString(input, "asset"),
|
|
378
|
+
...networkAndStellarBinary(input)
|
|
379
|
+
], contractProperties({ asset: true })),
|
|
380
|
+
tool("stellar_contract_info", "Read contract interface, metadata, build info, env metadata, or hash through Stellar CLI.", {}, (input) => [
|
|
381
|
+
"contract",
|
|
382
|
+
"info",
|
|
383
|
+
"--kind",
|
|
384
|
+
string(input, "kind") ?? "interface",
|
|
385
|
+
...option(input, "id", "--id"),
|
|
386
|
+
...option(input, "wasm", "--wasm"),
|
|
387
|
+
...option(input, "wasmHash", "--wasm-hash"),
|
|
388
|
+
...networkAndStellarBinary(input)
|
|
389
|
+
], contractProperties({ id: true, wasm: true, wasmHash: true, kind: true })),
|
|
390
|
+
tool("stellar_contract_read", "Read contract instance, storage, or Wasm ledger data through Stellar CLI.", {}, (input) => [
|
|
391
|
+
"contract",
|
|
392
|
+
"read",
|
|
393
|
+
...footprintArgs(input),
|
|
394
|
+
...option(input, "output", "--output"),
|
|
395
|
+
...networkAndStellarBinary(input)
|
|
396
|
+
], contractProperties({ footprint: true, output: true })),
|
|
397
|
+
tool("stellar_contract_fetch", "Fetch contract Wasm bytecode through Stellar CLI.", {}, (input) => [
|
|
398
|
+
"contract",
|
|
399
|
+
"fetch",
|
|
400
|
+
...option(input, "id", "--id"),
|
|
401
|
+
...option(input, "wasmHash", "--wasm-hash"),
|
|
402
|
+
...option(input, "outFile", "--out-file"),
|
|
403
|
+
...networkAndStellarBinary(input)
|
|
404
|
+
], contractProperties({ id: true, wasmHash: true, outFile: true })),
|
|
405
|
+
tool("stellar_contract_extend", "Extend contract instance, storage, or Wasm TTL through Stellar CLI.", { source: true, ledgersToExtend: true }, (input) => [
|
|
406
|
+
"contract",
|
|
407
|
+
"extend",
|
|
408
|
+
"--source",
|
|
409
|
+
requiredString(input, "source"),
|
|
410
|
+
"--ledgers-to-extend",
|
|
411
|
+
String(requiredNumber(input, "ledgersToExtend")),
|
|
412
|
+
...footprintArgs(input),
|
|
413
|
+
...(bool(input, "ttlLedgerOnly") ? ["--ttl-ledger-only"] : []),
|
|
414
|
+
...networkAndStellarBinary(input)
|
|
415
|
+
], contractProperties({ source: true, ledgersToExtend: true, footprint: true, ttlLedgerOnly: true })),
|
|
416
|
+
tool("stellar_contract_restore", "Restore archived contract instance, storage, or Wasm through Stellar CLI.", { source: true }, (input) => [
|
|
417
|
+
"contract",
|
|
418
|
+
"restore",
|
|
419
|
+
"--source",
|
|
420
|
+
requiredString(input, "source"),
|
|
421
|
+
...footprintArgs(input),
|
|
422
|
+
...networkAndStellarBinary(input)
|
|
423
|
+
], contractProperties({ source: true, footprint: true }))
|
|
424
|
+
];
|
|
425
|
+
export function buildCliArgs(toolName, input = {}) {
|
|
426
|
+
const found = MCP_TOOLS.find((candidate) => candidate.name === toolName);
|
|
427
|
+
if (!found)
|
|
428
|
+
throw new Error(`Unknown MCP tool '${toolName}'.`);
|
|
429
|
+
return [
|
|
430
|
+
...option(input, "configPath", "--config"),
|
|
431
|
+
...option(input, "profile", "--profile"),
|
|
432
|
+
...option(input, "policyPath", "--policy"),
|
|
433
|
+
...(bool(input, "noCache") ? ["--no-cache"] : []),
|
|
434
|
+
"--json",
|
|
435
|
+
...found.buildArgs(input)
|
|
436
|
+
];
|
|
437
|
+
}
|
|
438
|
+
export async function callMcpTool(name, input, runner) {
|
|
439
|
+
const args = buildCliArgs(name, input);
|
|
440
|
+
const result = await runner(args);
|
|
441
|
+
const payload = {
|
|
442
|
+
command: ["stellar-agent", ...redactSensitive(args)],
|
|
443
|
+
exitCode: result.status,
|
|
444
|
+
stdout: parseJsonOrText(result.stdout),
|
|
445
|
+
stderr: result.stderr.trim()
|
|
446
|
+
};
|
|
447
|
+
return {
|
|
448
|
+
content: [{ type: "text", text: JSON.stringify(redactSensitive(payload), null, 2) }],
|
|
449
|
+
...(result.status === 0 ? {} : { isError: true })
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
export async function handleMcpRequest(request, runner) {
|
|
453
|
+
if (request.id === undefined && request.method.startsWith("notifications/"))
|
|
454
|
+
return undefined;
|
|
455
|
+
if (request.method === "initialize") {
|
|
456
|
+
return response(request, {
|
|
457
|
+
protocolVersion: "2024-11-05",
|
|
458
|
+
capabilities: { tools: {} },
|
|
459
|
+
serverInfo: { name: "stellar-agent-mcp", version: MCP_VERSION }
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
if (request.method === "tools/list") {
|
|
463
|
+
return response(request, {
|
|
464
|
+
tools: MCP_TOOLS.map(({ name, description, inputSchema }) => ({ name, description, inputSchema }))
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
if (request.method === "tools/call") {
|
|
468
|
+
const params = request.params ?? {};
|
|
469
|
+
try {
|
|
470
|
+
return response(request, await callMcpTool(params.name, params.arguments ?? {}, runner));
|
|
471
|
+
}
|
|
472
|
+
catch (error) {
|
|
473
|
+
return mcpError(request, -32602, error instanceof Error ? error.message : "Invalid tool call.");
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return mcpError(request, -32601, `Method '${request.method}' is not supported.`);
|
|
477
|
+
}
|
|
478
|
+
export function createChildProcessCliRunner(cliBinary = process.env.STELLAR_AGENT_CLI ?? "stellar-agent") {
|
|
479
|
+
return async (args) => new Promise((resolve) => {
|
|
480
|
+
const executable = cliBinary.endsWith(".js") ? process.execPath : cliBinary;
|
|
481
|
+
const childArgs = cliBinary.endsWith(".js") ? [cliBinary, ...args] : args;
|
|
482
|
+
const child = spawn(executable, childArgs, { stdio: ["ignore", "pipe", "pipe"] });
|
|
483
|
+
let stdout = "";
|
|
484
|
+
let stderr = "";
|
|
485
|
+
child.stdout.setEncoding("utf8");
|
|
486
|
+
child.stderr.setEncoding("utf8");
|
|
487
|
+
child.stdout.on("data", (chunk) => {
|
|
488
|
+
stdout += chunk;
|
|
489
|
+
});
|
|
490
|
+
child.stderr.on("data", (chunk) => {
|
|
491
|
+
stderr += chunk;
|
|
492
|
+
});
|
|
493
|
+
child.on("error", (error) => {
|
|
494
|
+
resolve({ status: 127, stdout, stderr: `${stderr}${error.message}` });
|
|
495
|
+
});
|
|
496
|
+
child.on("close", (status) => {
|
|
497
|
+
resolve({ status: status ?? 1, stdout, stderr });
|
|
498
|
+
});
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
export function encodeMcpMessage(message) {
|
|
502
|
+
const json = JSON.stringify(message);
|
|
503
|
+
return `Content-Length: ${Buffer.byteLength(json, "utf8")}\r\n\r\n${json}`;
|
|
504
|
+
}
|
|
505
|
+
export function createMcpMessageParser(onMessage) {
|
|
506
|
+
let buffer = "";
|
|
507
|
+
return (chunk) => {
|
|
508
|
+
buffer += chunk.toString();
|
|
509
|
+
for (;;) {
|
|
510
|
+
const headerEnd = buffer.indexOf("\r\n\r\n");
|
|
511
|
+
if (headerEnd < 0)
|
|
512
|
+
return;
|
|
513
|
+
const header = buffer.slice(0, headerEnd);
|
|
514
|
+
const lengthMatch = /content-length:\s*(\d+)/i.exec(header);
|
|
515
|
+
if (!lengthMatch?.[1])
|
|
516
|
+
throw new Error("Missing MCP Content-Length header.");
|
|
517
|
+
const length = Number.parseInt(lengthMatch[1], 10);
|
|
518
|
+
const bodyStart = headerEnd + 4;
|
|
519
|
+
const bodyEnd = bodyStart + length;
|
|
520
|
+
if (buffer.length < bodyEnd)
|
|
521
|
+
return;
|
|
522
|
+
onMessage(JSON.parse(buffer.slice(bodyStart, bodyEnd)));
|
|
523
|
+
buffer = buffer.slice(bodyEnd);
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
function tool(name, description, required, buildArgs, properties) {
|
|
528
|
+
return {
|
|
529
|
+
name,
|
|
530
|
+
description,
|
|
531
|
+
inputSchema: {
|
|
532
|
+
type: "object",
|
|
533
|
+
properties: { ...commonProperties, ...properties },
|
|
534
|
+
required: Object.keys(required),
|
|
535
|
+
additionalProperties: false
|
|
536
|
+
},
|
|
537
|
+
buildArgs
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
function paymentProperties() {
|
|
541
|
+
return {
|
|
542
|
+
to: { type: "string" },
|
|
543
|
+
amount: { type: "string" },
|
|
544
|
+
asset: { type: "string" },
|
|
545
|
+
memo: { type: "string" },
|
|
546
|
+
feeStrategy: { type: "string", enum: ["base", "low", "medium", "high", "p95"] }
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
function httpPaymentProperties() {
|
|
550
|
+
return {
|
|
551
|
+
url: { type: "string" },
|
|
552
|
+
from: { type: "string" },
|
|
553
|
+
allowLocalhostDemo: { type: "boolean" },
|
|
554
|
+
dryRun: { type: "boolean" }
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
function realFundsProperties() {
|
|
558
|
+
return {
|
|
559
|
+
allowRealFunds: { type: "boolean" },
|
|
560
|
+
iUnderstandRealFunds: { type: "boolean" }
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
function contractProperties(flags) {
|
|
564
|
+
return {
|
|
565
|
+
...(flags.id ? { id: { type: "string" } } : {}),
|
|
566
|
+
...(flags.source ? { source: { type: "string" } } : {}),
|
|
567
|
+
...(flags.asset ? { asset: { type: "string" } } : {}),
|
|
568
|
+
...(flags.fn ? { fn: { type: "string" } } : {}),
|
|
569
|
+
...(flags.kind ? { kind: { type: "string", enum: ["interface", "meta", "env-meta", "build", "hash"] } } : {}),
|
|
570
|
+
...(flags.wasm ? { wasm: { type: "string" } } : {}),
|
|
571
|
+
...(flags.wasmHash ? { wasmHash: { type: "string" } } : {}),
|
|
572
|
+
...(flags.outFile ? { outFile: { type: "string" } } : {}),
|
|
573
|
+
...(flags.alias ? { alias: { type: "string" } } : {}),
|
|
574
|
+
...(flags.arg ? { arg: { type: "object", additionalProperties: { type: "string" } } } : {}),
|
|
575
|
+
...(flags.ledgersToExtend ? { ledgersToExtend: { type: "number" } } : {}),
|
|
576
|
+
...(flags.output ? { output: { type: "string", enum: ["string", "json", "xdr"] } } : {}),
|
|
577
|
+
...(flags.footprint
|
|
578
|
+
? {
|
|
579
|
+
id: { type: "string" },
|
|
580
|
+
key: { type: "string" },
|
|
581
|
+
keyXdr: { type: "string" },
|
|
582
|
+
wasm: { type: "string" },
|
|
583
|
+
wasmHash: { type: "string" },
|
|
584
|
+
durability: { type: "string", enum: ["persistent", "temporary"] }
|
|
585
|
+
}
|
|
586
|
+
: {}),
|
|
587
|
+
...(flags.ttlLedgerOnly ? { ttlLedgerOnly: { type: "boolean" } } : {}),
|
|
588
|
+
network: { type: "string" },
|
|
589
|
+
stellarBinary: { type: "string" },
|
|
590
|
+
stellarConfigDir: { type: "string" },
|
|
591
|
+
stellarNoCache: { type: "boolean" }
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
function option(input, key, flag) {
|
|
595
|
+
const value = string(input, key);
|
|
596
|
+
return value === undefined ? [] : [flag, value];
|
|
597
|
+
}
|
|
598
|
+
function realFundsFlags(input) {
|
|
599
|
+
return [
|
|
600
|
+
...(bool(input, "allowRealFunds") ? ["--allow-real-funds"] : []),
|
|
601
|
+
...(bool(input, "iUnderstandRealFunds") ? ["--i-understand-real-funds"] : [])
|
|
602
|
+
];
|
|
603
|
+
}
|
|
604
|
+
function networkAndStellarBinary(input) {
|
|
605
|
+
return [
|
|
606
|
+
...option(input, "network", "--network"),
|
|
607
|
+
...option(input, "stellarBinary", "--stellar-binary"),
|
|
608
|
+
...option(input, "stellarConfigDir", "--stellar-config-dir"),
|
|
609
|
+
...(bool(input, "stellarNoCache") ? ["--stellar-no-cache"] : [])
|
|
610
|
+
];
|
|
611
|
+
}
|
|
612
|
+
function contractArgs(input) {
|
|
613
|
+
const raw = input.arg;
|
|
614
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
615
|
+
return [];
|
|
616
|
+
return Object.entries(raw).flatMap(([key, value]) => ["--arg", `${key}=${String(value)}`]);
|
|
617
|
+
}
|
|
618
|
+
function footprintArgs(input) {
|
|
619
|
+
return [
|
|
620
|
+
...option(input, "id", "--id"),
|
|
621
|
+
...option(input, "key", "--key"),
|
|
622
|
+
...option(input, "keyXdr", "--key-xdr"),
|
|
623
|
+
...option(input, "wasm", "--wasm"),
|
|
624
|
+
...option(input, "wasmHash", "--wasm-hash"),
|
|
625
|
+
...option(input, "durability", "--durability")
|
|
626
|
+
];
|
|
627
|
+
}
|
|
628
|
+
function approvalDecisionFlag(input) {
|
|
629
|
+
const decision = requiredString(input, "decision");
|
|
630
|
+
if (decision === "approve")
|
|
631
|
+
return "--approve";
|
|
632
|
+
if (decision === "deny")
|
|
633
|
+
return "--deny";
|
|
634
|
+
throw new Error("decision must be approve or deny.");
|
|
635
|
+
}
|
|
636
|
+
function string(input, key) {
|
|
637
|
+
const value = input[key];
|
|
638
|
+
if (value === undefined || value === null || value === "")
|
|
639
|
+
return undefined;
|
|
640
|
+
if (typeof value !== "string")
|
|
641
|
+
throw new Error(`${key} must be a string.`);
|
|
642
|
+
return value;
|
|
643
|
+
}
|
|
644
|
+
function stringArray(input, key) {
|
|
645
|
+
const value = input[key];
|
|
646
|
+
if (value === undefined || value === null)
|
|
647
|
+
return [];
|
|
648
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) {
|
|
649
|
+
throw new Error(`${key} must be an array of strings.`);
|
|
650
|
+
}
|
|
651
|
+
return value.filter((item) => item !== "");
|
|
652
|
+
}
|
|
653
|
+
function requiredString(input, key) {
|
|
654
|
+
const value = string(input, key);
|
|
655
|
+
if (!value)
|
|
656
|
+
throw new Error(`${key} is required.`);
|
|
657
|
+
return value;
|
|
658
|
+
}
|
|
659
|
+
function requiredNumber(input, key) {
|
|
660
|
+
const value = input[key];
|
|
661
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
662
|
+
throw new Error(`${key} must be a number.`);
|
|
663
|
+
return value;
|
|
664
|
+
}
|
|
665
|
+
function number(input, key) {
|
|
666
|
+
const value = input[key];
|
|
667
|
+
if (value === undefined || value === null)
|
|
668
|
+
return undefined;
|
|
669
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
670
|
+
throw new Error(`${key} must be a number.`);
|
|
671
|
+
return value;
|
|
672
|
+
}
|
|
673
|
+
function bool(input, key) {
|
|
674
|
+
const value = input[key];
|
|
675
|
+
if (value === undefined || value === null)
|
|
676
|
+
return undefined;
|
|
677
|
+
if (typeof value !== "boolean")
|
|
678
|
+
throw new Error(`${key} must be a boolean.`);
|
|
679
|
+
return value;
|
|
680
|
+
}
|
|
681
|
+
function parseJsonOrText(value) {
|
|
682
|
+
const trimmed = value.trim();
|
|
683
|
+
if (!trimmed)
|
|
684
|
+
return "";
|
|
685
|
+
try {
|
|
686
|
+
return JSON.parse(trimmed);
|
|
687
|
+
}
|
|
688
|
+
catch {
|
|
689
|
+
return trimmed;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
function response(request, result) {
|
|
693
|
+
return { jsonrpc: "2.0", id: request.id ?? null, result };
|
|
694
|
+
}
|
|
695
|
+
function mcpError(request, code, message, data) {
|
|
696
|
+
return { jsonrpc: "2.0", id: request.id ?? null, error: { code, message, ...(data === undefined ? {} : { data }) } };
|
|
697
|
+
}
|
|
698
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAA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OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;AACvH,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":""}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createChildProcessCliRunner, createMcpMessageParser, encodeMcpMessage, handleMcpRequest } from "./index.js";
|
|
3
|
+
const runner = createChildProcessCliRunner();
|
|
4
|
+
const parse = createMcpMessageParser((request) => {
|
|
5
|
+
void handleMcpRequest(request, runner).then((response) => {
|
|
6
|
+
if (response)
|
|
7
|
+
process.stdout.write(encodeMcpMessage(response));
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
process.stdin.on("data", parse);
|
|
11
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,GAAG,2BAA2B,EAAE,CAAC;AAC7C,MAAM,KAAK,GAAG,sBAAsB,CAAC,CAAC,OAAO,EAAE,EAAE;IAC/C,KAAK,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;QACvD,IAAI,QAAQ;YAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stellar-agent/mcp-server",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "MCP stdio server that exposes Stellar Agent Bridge CLI workflows as agent tools.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+ssh://git@github.com/someone-in-texas/Stellar-Agent.git",
|
|
10
|
+
"directory": "packages/mcp-server"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/someone-in-texas/Stellar-Agent/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/someone-in-texas/Stellar-Agent#readme",
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=22"
|
|
18
|
+
},
|
|
19
|
+
"bin": {
|
|
20
|
+
"stellar-agent-mcp": "./dist/server.js"
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc -b",
|
|
35
|
+
"test": "vitest run"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@stellar-agent/core": "0.4.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/node": "^22.15.24"
|
|
42
|
+
}
|
|
43
|
+
}
|