@moneolabs/mcp 0.1.0 → 0.2.1

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/dist/cli.js CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ // src/cli.ts
4
+ import { createRequire } from "module";
5
+
3
6
  // src/sandbox.ts
4
7
  import { readFileSync } from "fs";
5
8
  import { fixedPrices, registerAsset } from "@moneolabs/core";
@@ -283,8 +286,9 @@ async function serveStdio(server2) {
283
286
  }
284
287
 
285
288
  // src/cli.ts
289
+ var { version } = createRequire(import.meta.url)("../package.json");
286
290
  var sandbox = await createSandbox();
287
- var server = createMcpServer({ ...sandbox, name: "moneo-sandbox" });
291
+ var server = createMcpServer({ ...sandbox, name: "moneo-sandbox", version });
288
292
  console.error(
289
293
  `[moneo-mcp] sandbox ledger for "${sandbox.wallet.agent}" \u2014 wallet ${sandbox.wallet.address}, policy ${sandbox.guard.policy.version}. Test funds only; nothing here moves real value.`
290
294
  );
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/sandbox.ts","../src/server.ts","../src/tools.ts","../src/cli.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { fixedPrices, registerAsset } from \"@moneolabs/core\";\nimport { createGuard, type Guard, type Policy } from \"@moneolabs/guard\";\nimport { createTrading, simulatedVenue, type Trading } from \"@moneolabs/trading\";\nimport { createWallet, localSigner, memoryRail, type Wallet } from \"@moneolabs/wallet\";\n\n/**\n * The zero-config environment `npx @moneolabs/mcp` serves: a funded wallet on\n * the in-memory rail, a deliberately cautious default policy, and a simulated\n * venue quoting a few tokenized equities. Nothing here touches real value —\n * it exists so an agent host can try the whole surface in one command.\n */\nexport interface SandboxOptions {\n /** Agent identity recorded on every decision. Env: MONEO_AGENT. */\n agent?: string;\n /** Starting balance. Env: MONEO_FUNDING. */\n funding?: string;\n /** Default asset. Env: MONEO_ASSET. */\n asset?: string;\n /** Path to a policy JSON file. Env: MONEO_POLICY. */\n policyPath?: string;\n}\n\nexport interface Sandbox {\n wallet: Wallet;\n guard: Guard;\n trading: Trading;\n}\n\n// Policy amounts are USD; the guard settles them against the dollar-pegged wallet.\nconst DEFAULT_POLICY: Policy = {\n perTransaction: { max: \"$500\" },\n rolling24h: { max: \"$2,000\" },\n velocity: { max: 20, per: \"1m\" },\n counterparties: \"allowlist-only\",\n allow: [\"x402:*\", \"venue:*\", \"vendor:*\"],\n escalate: { above: \"$1,000\" },\n};\n\n/** Simulated marks, in USDG per share. The venue quotes the inverse. */\nconst SANDBOX_PRICES: Record<string, number> = {\n AAPLX: 228.41,\n TSLAX: 312.76,\n NVDAX: 171.34,\n SPYX: 563.02,\n};\n\nexport async function createSandbox(options: SandboxOptions = {}): Promise<Sandbox> {\n const agent = options.agent ?? process.env.MONEO_AGENT ?? \"sandbox-agent\";\n const funding = options.funding ?? process.env.MONEO_FUNDING ?? \"5,000 USDG\";\n const asset = options.asset ?? process.env.MONEO_ASSET ?? \"USDG\";\n const policyPath = options.policyPath ?? process.env.MONEO_POLICY;\n\n const policy: Policy = policyPath\n ? (JSON.parse(readFileSync(policyPath, \"utf8\")) as Policy)\n : DEFAULT_POLICY;\n\n // The guard prices non-pegged assets in USD to enforce dollar limits, so it\n // gets the same marks the venue quotes from.\n const guard = createGuard(policy, { agent, prices: fixedPrices(SANDBOX_PRICES) });\n\n const wallet = await createWallet({\n agent,\n signer: localSigner(),\n rail: memoryRail(),\n asset,\n guard,\n funding,\n });\n\n const prices: Record<string, number> = {};\n for (const [symbol, usdg] of Object.entries(SANDBOX_PRICES)) {\n registerAsset({ symbol, decimals: 18 });\n prices[`${asset}/${symbol}`] = 1 / usdg; // how much of the share one USDG buys\n prices[`${symbol}/${asset}`] = usdg; // and the way back out\n }\n\n const trading = createTrading({\n agent,\n guard,\n quoteAsset: asset,\n venues: [simulatedVenue({ name: \"sandbox-pool\", prices, feeRate: 0.0005 })],\n });\n\n return { wallet, guard, trading };\n}\n","import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { CallToolRequestSchema, ListToolsRequestSchema } from \"@modelcontextprotocol/sdk/types.js\";\nimport { buildTools, type McpToolsOptions } from \"./tools.js\";\n\nexport interface McpServerOptions extends McpToolsOptions {\n /** Server name reported to the host. */\n name?: string;\n version?: string;\n}\n\n/**\n * Wrap a wallet (and optionally a guard and a trading instance) in an MCP\n * server. The transport is yours to choose; `serveStdio` covers the common\n * case of a host that spawns the server as a subprocess.\n */\nexport function createMcpServer(options: McpServerOptions): Server {\n const tools = buildTools(options);\n const server = new Server(\n { name: options.name ?? \"moneo\", version: options.version ?? \"0.1.0\" },\n { capabilities: { tools: {} } },\n );\n\n server.setRequestHandler(ListToolsRequestSchema, async () => ({\n tools: tools.definitions.map((d) => ({\n name: d.name,\n description: d.description,\n inputSchema: d.inputSchema,\n })),\n }));\n\n server.setRequestHandler(CallToolRequestSchema, async (request) => {\n try {\n const result = await tools.handle(\n request.params.name,\n (request.params.arguments ?? {}) as Record<string, unknown>,\n );\n return { content: [{ type: \"text\", text: JSON.stringify(result, null, 2) }] };\n } catch (error) {\n // Policy refusals never reach here: they come back as ordinary results\n // with a reason. This path is for genuinely broken calls.\n const message = error instanceof Error ? error.message : String(error);\n return {\n content: [{ type: \"text\", text: JSON.stringify({ error: message }) }],\n isError: true,\n };\n }\n });\n\n return server;\n}\n\n/** Connect a server to stdio and keep the process alive until the host hangs up. */\nexport async function serveStdio(server: Server): Promise<void> {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n","import { formatMoney } from \"@moneolabs/core\";\nimport { PolicyDeniedError, type Guard } from \"@moneolabs/guard\";\nimport type { OrderOptions, OrderResult, Trading } from \"@moneolabs/trading\";\nimport { toolkit, type ToolDefinition, type ToolName, type Wallet } from \"@moneolabs/wallet\";\n\n/**\n * One flat tool surface for an MCP host: the wallet toolkit as-is, plus the\n * trading calls when a trading instance is supplied. Same contract as the\n * toolkit: a refusal is a result with a reason, never an exception, so the\n * model reads why it was stopped instead of retrying blind.\n */\nexport interface McpToolsOptions {\n wallet: Wallet;\n guard?: Guard;\n trading?: Trading;\n /** Restrict the wallet tools. Trading tools ride on `trading` being set. */\n include?: readonly ToolName[];\n}\n\nexport interface McpTools {\n definitions: ToolDefinition[];\n handle(name: string, input: Record<string, unknown>): Promise<unknown>;\n}\n\nexport function buildTools(options: McpToolsOptions): McpTools {\n const walletTools = toolkit(options.wallet, {\n ...(options.guard ? { guard: options.guard } : {}),\n ...(options.include ? { include: options.include } : {}),\n });\n\n const trading = options.trading;\n const tradingTools: Record<string, { definition: ToolDefinition; run: Handler }> = trading\n ? {\n get_quote: {\n definition: {\n name: \"get_quote\",\n description:\n \"Price a trade across every venue that can fill it, without committing to anything. Returns the best route.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sell: { type: \"string\", description: 'Asset given up, for example \"USDG\".' },\n buy: { type: \"string\", description: 'Asset acquired, for example \"AAPLX\".' },\n notional: {\n type: \"string\",\n description: 'How much to spend, for example \"300 USDG\".',\n },\n },\n required: [\"sell\", \"buy\", \"notional\"],\n },\n },\n async run(input) {\n const quote = await trading.quote({\n sell: String(input.sell),\n buy: String(input.buy),\n notional: String(input.notional),\n });\n return {\n quoteId: quote.id,\n venue: quote.venue,\n sells: formatMoney(quote.sellAmount),\n buys: formatMoney(quote.buyAmount),\n price: quote.price,\n fee: formatMoney(quote.fee),\n impact: quote.impact,\n expiresAt: new Date(quote.expiresAt).toISOString(),\n };\n },\n },\n\n execute_order: {\n definition: {\n name: \"execute_order\",\n description:\n \"Quote and execute a trade. Policy runs before anything is signed: a refusal returns the reason and costs nothing. Attach takeProfit and stopLoss to ship the exit with the entry.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sell: { type: \"string\", description: \"Asset given up.\" },\n buy: { type: \"string\", description: \"Asset acquired.\" },\n notional: { type: \"string\", description: 'How much to spend, e.g. \"300 USDG\".' },\n type: {\n type: \"string\",\n enum: [\"market\", \"limit\", \"twap\", \"bracket\"],\n description: \"Order type. Defaults to market.\",\n },\n maxSlippage: {\n type: \"number\",\n description:\n \"Largest acceptable adverse move as a fraction, e.g. 0.003. Exceeding it rejects the order instead of filling it worse.\",\n },\n limitPrice: { type: \"number\", description: \"limit: price to rest at.\" },\n window: {\n type: \"string\",\n description: 'twap: window to spread across, e.g. \"30m\".',\n },\n takeProfit: { type: \"number\", description: \"bracket: exit price above.\" },\n stopLoss: { type: \"number\", description: \"bracket: exit price below.\" },\n },\n required: [\"sell\", \"buy\", \"notional\"],\n },\n },\n async run(input) {\n const orderOptions: OrderOptions = {\n ...(input.type ? { type: input.type as OrderOptions[\"type\"] } : {}),\n ...(typeof input.maxSlippage === \"number\" ? { maxSlippage: input.maxSlippage } : {}),\n ...(typeof input.limitPrice === \"number\" ? { limitPrice: input.limitPrice } : {}),\n ...(input.window ? { window: String(input.window) } : {}),\n ...(typeof input.takeProfit === \"number\" ? { takeProfit: input.takeProfit } : {}),\n ...(typeof input.stopLoss === \"number\" ? { stopLoss: input.stopLoss } : {}),\n };\n try {\n const quote = await trading.quote({\n sell: String(input.sell),\n buy: String(input.buy),\n notional: String(input.notional),\n });\n const order = await trading.execute(quote, orderOptions);\n return { ok: true, ...formatOrder(await order.settled()) };\n } catch (error) {\n if (error instanceof PolicyDeniedError) {\n return {\n ok: false,\n refused: true,\n reason: error.decision.reason,\n rule: error.decision.rule,\n hint: \"This limit is set by the wallet owner. Ask them to raise it rather than retrying.\",\n };\n }\n throw error;\n }\n },\n },\n\n list_positions: {\n definition: {\n name: \"list_positions\",\n description: \"Open positions with cost basis and unrealized P&L at the latest mark.\",\n inputSchema: { type: \"object\", properties: {} },\n },\n async run() {\n return trading.positions().map((p) => ({\n asset: p.asset,\n quantity: formatMoney(p.quantity),\n averageCost: p.averageCost,\n costBasis: formatMoney(p.costBasis),\n marketValue: formatMoney(p.marketValue),\n unrealized: formatMoney(p.unrealized),\n realized: formatMoney(p.realized),\n }));\n },\n },\n\n close_position: {\n definition: {\n name: \"close_position\",\n description:\n \"Exit a position with the same guarantees the entry had: policy first, slippage bound enforced.\",\n inputSchema: {\n type: \"object\",\n properties: {\n asset: { type: \"string\", description: \"Asset to close.\" },\n maxSlippage: {\n type: \"number\",\n description: \"Largest acceptable adverse move as a fraction.\",\n },\n },\n required: [\"asset\"],\n },\n },\n async run(input) {\n try {\n const order = await trading.close(String(input.asset), {\n type: \"market\",\n ...(typeof input.maxSlippage === \"number\"\n ? { maxSlippage: input.maxSlippage }\n : {}),\n });\n return { ok: true, ...formatOrder(await order.settled()) };\n } catch (error) {\n if (error instanceof PolicyDeniedError) {\n return {\n ok: false,\n refused: true,\n reason: error.decision.reason,\n rule: error.decision.rule,\n };\n }\n throw error;\n }\n },\n },\n }\n : {};\n\n return {\n definitions: [\n ...walletTools.definitions,\n ...Object.values(tradingTools).map((tool) => tool.definition),\n ],\n async handle(name, input) {\n const tradingTool = tradingTools[name];\n if (tradingTool) return tradingTool.run(input ?? {});\n return walletTools.handle(name, input ?? {});\n },\n };\n}\n\nfunction formatOrder(result: OrderResult) {\n return {\n orderId: result.id,\n status: result.status,\n type: result.type,\n sell: result.sell,\n buy: result.buy,\n filled: formatMoney(result.filled),\n received: formatMoney(result.received),\n averagePrice: result.averagePrice,\n slippage: result.slippage,\n fees: formatMoney(result.fees),\n ...(result.reason ? { reason: result.reason } : {}),\n ...(result.decision ? { policyVersion: result.decision.policyVersion } : {}),\n };\n}\n\ntype Handler = (input: Record<string, unknown>) => Promise<unknown>;\n","#!/usr/bin/env node\n/**\n * `npx @moneolabs/mcp` — serve the sandbox over stdio.\n *\n * Everything runs in this process against test funds. Configuration is\n * environment variables, because MCP host configs pass env, not flags:\n *\n * MONEO_AGENT agent identity on every decision (default sandbox-agent)\n * MONEO_FUNDING starting balance (default \"5,000 USDG\")\n * MONEO_ASSET default asset (default USDG)\n * MONEO_POLICY path to a policy JSON file (default: cautious built-in)\n *\n * Logs go to stderr. Stdout belongs to the protocol.\n */\nimport { createSandbox } from \"./sandbox.js\";\nimport { createMcpServer, serveStdio } from \"./server.js\";\n\nconst sandbox = await createSandbox();\nconst server = createMcpServer({ ...sandbox, name: \"moneo-sandbox\" });\n\nconsole.error(\n `[moneo-mcp] sandbox ledger for \"${sandbox.wallet.agent}\" — ` +\n `wallet ${sandbox.wallet.address}, policy ${sandbox.guard.policy.version}. ` +\n \"Test funds only; nothing here moves real value.\",\n);\n\nawait serveStdio(server);\n"],"mappings":";;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,aAAa,qBAAqB;AAC3C,SAAS,mBAA4C;AACrD,SAAS,eAAe,sBAAoC;AAC5D,SAAS,cAAc,aAAa,kBAA+B;AA0BnE,IAAM,iBAAyB;AAAA,EAC7B,gBAAgB,EAAE,KAAK,OAAO;AAAA,EAC9B,YAAY,EAAE,KAAK,SAAS;AAAA,EAC5B,UAAU,EAAE,KAAK,IAAI,KAAK,KAAK;AAAA,EAC/B,gBAAgB;AAAA,EAChB,OAAO,CAAC,UAAU,WAAW,UAAU;AAAA,EACvC,UAAU,EAAE,OAAO,SAAS;AAC9B;AAGA,IAAM,iBAAyC;AAAA,EAC7C,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AACR;AAEA,eAAsB,cAAc,UAA0B,CAAC,GAAqB;AAClF,QAAM,QAAQ,QAAQ,SAAS,QAAQ,IAAI,eAAe;AAC1D,QAAM,UAAU,QAAQ,WAAW,QAAQ,IAAI,iBAAiB;AAChE,QAAM,QAAQ,QAAQ,SAAS,QAAQ,IAAI,eAAe;AAC1D,QAAM,aAAa,QAAQ,cAAc,QAAQ,IAAI;AAErD,QAAM,SAAiB,aAClB,KAAK,MAAM,aAAa,YAAY,MAAM,CAAC,IAC5C;AAIJ,QAAM,QAAQ,YAAY,QAAQ,EAAE,OAAO,QAAQ,YAAY,cAAc,EAAE,CAAC;AAEhF,QAAM,SAAS,MAAM,aAAa;AAAA,IA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EACJ,EAAE;AAEF,EAAAA,QAAO,kBAAkB,uBAAuB,OAAO,YAAY;AACjE,QAAI;AACF,YAAM,SAAS,MAAM,MAAM;AAAA,QACzB,QAAQ,OAAO;AAAA,QACd,QAAQ,OAAO,aAAa,CAAC;AAAA,MAChC;AACA,aAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,KAAK,UAAU,QAAQ,MAAM,CAAC,EAAE,CAAC,EAAE;AAAA,IAC9E,SAAS,OAAO;AAGd,YAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACrE,aAAO;AAAA,QACL,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,KAAK,UAAU,EAAE,OAAO,QAAQ,CAAC,EAAE,CAAC;AAAA,QACpE,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF,CAAC;AAED,SAAOA;AACT;AAGA,eAAsB,WAAWA,SAA+B;AAC9D,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAMA,QAAO,QAAQ,SAAS;AAChC;;;AEvCA,IAAM,UAAU,MAAM,cAAc;AACpC,IAAM,SAAS,gBAAgB,EAAE,GAAG,SAAS,MAAM,gBAAgB,CAAC;AAEpE,QAAQ;AAAA,EACN,mCAAmC,QAAQ,OAAO,KAAK,mBAC3C,QAAQ,OAAO,OAAO,YAAY,QAAQ,MAAM,OAAO,OAAO;AAE5E;AAEA,MAAM,WAAW,MAAM;","names":["server"]}
1
+ {"version":3,"sources":["../src/cli.ts","../src/sandbox.ts","../src/server.ts","../src/tools.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * `npx @moneolabs/mcp` — serve the sandbox over stdio.\n *\n * Everything runs in this process against test funds. Configuration is\n * environment variables, because MCP host configs pass env, not flags:\n *\n * MONEO_AGENT agent identity on every decision (default sandbox-agent)\n * MONEO_FUNDING starting balance (default \"5,000 USDG\")\n * MONEO_ASSET default asset (default USDG)\n * MONEO_POLICY path to a policy JSON file (default: cautious built-in)\n *\n * Logs go to stderr. Stdout belongs to the protocol.\n */\nimport { createRequire } from \"node:module\";\nimport { createSandbox } from \"./sandbox.js\";\nimport { createMcpServer, serveStdio } from \"./server.js\";\n\n// dist/cli.js sits one level under the package root, so this resolves to our\n// own manifest and the handshake reports the version that was actually installed.\nconst { version } = createRequire(import.meta.url)(\"../package.json\") as { version: string };\n\nconst sandbox = await createSandbox();\nconst server = createMcpServer({ ...sandbox, name: \"moneo-sandbox\", version });\n\nconsole.error(\n `[moneo-mcp] sandbox ledger for \"${sandbox.wallet.agent}\" — ` +\n `wallet ${sandbox.wallet.address}, policy ${sandbox.guard.policy.version}. ` +\n \"Test funds only; nothing here moves real value.\",\n);\n\nawait serveStdio(server);\n","import { readFileSync } from \"node:fs\";\nimport { fixedPrices, registerAsset } from \"@moneolabs/core\";\nimport { createGuard, type Guard, type Policy } from \"@moneolabs/guard\";\nimport { createTrading, simulatedVenue, type Trading } from \"@moneolabs/trading\";\nimport { createWallet, localSigner, memoryRail, type Wallet } from \"@moneolabs/wallet\";\n\n/**\n * The zero-config environment `npx @moneolabs/mcp` serves: a funded wallet on\n * the in-memory rail, a deliberately cautious default policy, and a simulated\n * venue quoting a few tokenized equities. Nothing here touches real value —\n * it exists so an agent host can try the whole surface in one command.\n */\nexport interface SandboxOptions {\n /** Agent identity recorded on every decision. Env: MONEO_AGENT. */\n agent?: string;\n /** Starting balance. Env: MONEO_FUNDING. */\n funding?: string;\n /** Default asset. Env: MONEO_ASSET. */\n asset?: string;\n /** Path to a policy JSON file. Env: MONEO_POLICY. */\n policyPath?: string;\n}\n\nexport interface Sandbox {\n wallet: Wallet;\n guard: Guard;\n trading: Trading;\n}\n\n// Policy amounts are USD; the guard settles them against the dollar-pegged wallet.\nconst DEFAULT_POLICY: Policy = {\n perTransaction: { max: \"$500\" },\n rolling24h: { max: \"$2,000\" },\n velocity: { max: 20, per: \"1m\" },\n counterparties: \"allowlist-only\",\n allow: [\"x402:*\", \"venue:*\", \"vendor:*\"],\n escalate: { above: \"$1,000\" },\n};\n\n/** Simulated marks, in USDG per share. The venue quotes the inverse. */\nconst SANDBOX_PRICES: Record<string, number> = {\n AAPLX: 228.41,\n TSLAX: 312.76,\n NVDAX: 171.34,\n SPYX: 563.02,\n};\n\nexport async function createSandbox(options: SandboxOptions = {}): Promise<Sandbox> {\n const agent = options.agent ?? process.env.MONEO_AGENT ?? \"sandbox-agent\";\n const funding = options.funding ?? process.env.MONEO_FUNDING ?? \"5,000 USDG\";\n const asset = options.asset ?? process.env.MONEO_ASSET ?? \"USDG\";\n const policyPath = options.policyPath ?? process.env.MONEO_POLICY;\n\n const policy: Policy = policyPath\n ? (JSON.parse(readFileSync(policyPath, \"utf8\")) as Policy)\n : DEFAULT_POLICY;\n\n // The guard prices non-pegged assets in USD to enforce dollar limits, so it\n // gets the same marks the venue quotes from.\n const guard = createGuard(policy, { agent, prices: fixedPrices(SANDBOX_PRICES) });\n\n const wallet = await createWallet({\n agent,\n signer: localSigner(),\n rail: memoryRail(),\n asset,\n guard,\n funding,\n });\n\n const prices: Record<string, number> = {};\n for (const [symbol, usdg] of Object.entries(SANDBOX_PRICES)) {\n registerAsset({ symbol, decimals: 18 });\n prices[`${asset}/${symbol}`] = 1 / usdg; // how much of the share one USDG buys\n prices[`${symbol}/${asset}`] = usdg; // and the way back out\n }\n\n const trading = createTrading({\n agent,\n guard,\n quoteAsset: asset,\n venues: [simulatedVenue({ name: \"sandbox-pool\", prices, feeRate: 0.0005 })],\n });\n\n return { wallet, guard, trading };\n}\n","import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { CallToolRequestSchema, ListToolsRequestSchema } from \"@modelcontextprotocol/sdk/types.js\";\nimport { buildTools, type McpToolsOptions } from \"./tools.js\";\n\nexport interface McpServerOptions extends McpToolsOptions {\n /** Server name reported to the host. */\n name?: string;\n version?: string;\n}\n\n/**\n * Wrap a wallet (and optionally a guard and a trading instance) in an MCP\n * server. The transport is yours to choose; `serveStdio` covers the common\n * case of a host that spawns the server as a subprocess.\n */\nexport function createMcpServer(options: McpServerOptions): Server {\n const tools = buildTools(options);\n const server = new Server(\n { name: options.name ?? \"moneo\", version: options.version ?? \"0.1.0\" },\n { capabilities: { tools: {} } },\n );\n\n server.setRequestHandler(ListToolsRequestSchema, async () => ({\n tools: tools.definitions.map((d) => ({\n name: d.name,\n description: d.description,\n inputSchema: d.inputSchema,\n })),\n }));\n\n server.setRequestHandler(CallToolRequestSchema, async (request) => {\n try {\n const result = await tools.handle(\n request.params.name,\n (request.params.arguments ?? {}) as Record<string, unknown>,\n );\n return { content: [{ type: \"text\", text: JSON.stringify(result, null, 2) }] };\n } catch (error) {\n // Policy refusals never reach here: they come back as ordinary results\n // with a reason. This path is for genuinely broken calls.\n const message = error instanceof Error ? error.message : String(error);\n return {\n content: [{ type: \"text\", text: JSON.stringify({ error: message }) }],\n isError: true,\n };\n }\n });\n\n return server;\n}\n\n/** Connect a server to stdio and keep the process alive until the host hangs up. */\nexport async function serveStdio(server: Server): Promise<void> {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n","import { formatMoney } from \"@moneolabs/core\";\nimport { PolicyDeniedError, type Guard } from \"@moneolabs/guard\";\nimport type { OrderOptions, OrderResult, Trading } from \"@moneolabs/trading\";\nimport { toolkit, type ToolDefinition, type ToolName, type Wallet } from \"@moneolabs/wallet\";\n\n/**\n * One flat tool surface for an MCP host: the wallet toolkit as-is, plus the\n * trading calls when a trading instance is supplied. Same contract as the\n * toolkit: a refusal is a result with a reason, never an exception, so the\n * model reads why it was stopped instead of retrying blind.\n */\nexport interface McpToolsOptions {\n wallet: Wallet;\n guard?: Guard;\n trading?: Trading;\n /** Restrict the wallet tools. Trading tools ride on `trading` being set. */\n include?: readonly ToolName[];\n}\n\nexport interface McpTools {\n definitions: ToolDefinition[];\n handle(name: string, input: Record<string, unknown>): Promise<unknown>;\n}\n\nexport function buildTools(options: McpToolsOptions): McpTools {\n const walletTools = toolkit(options.wallet, {\n ...(options.guard ? { guard: options.guard } : {}),\n ...(options.include ? { include: options.include } : {}),\n });\n\n const trading = options.trading;\n const tradingTools: Record<string, { definition: ToolDefinition; run: Handler }> = trading\n ? {\n get_quote: {\n definition: {\n name: \"get_quote\",\n description:\n \"Price a trade across every venue that can fill it, without committing to anything. Returns the best route.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sell: { type: \"string\", description: 'Asset given up, for example \"USDG\".' },\n buy: { type: \"string\", description: 'Asset acquired, for example \"AAPLX\".' },\n notional: {\n type: \"string\",\n description: 'How much to spend, for example \"300 USDG\".',\n },\n },\n required: [\"sell\", \"buy\", \"notional\"],\n },\n },\n async run(input) {\n const quote = await trading.quote({\n sell: String(input.sell),\n buy: String(input.buy),\n notional: String(input.notional),\n });\n return {\n quoteId: quote.id,\n venue: quote.venue,\n sells: formatMoney(quote.sellAmount),\n buys: formatMoney(quote.buyAmount),\n price: quote.price,\n fee: formatMoney(quote.fee),\n impact: quote.impact,\n expiresAt: new Date(quote.expiresAt).toISOString(),\n };\n },\n },\n\n execute_order: {\n definition: {\n name: \"execute_order\",\n description:\n \"Quote and execute a trade. Policy runs before anything is signed: a refusal returns the reason and costs nothing. Attach takeProfit and stopLoss to ship the exit with the entry.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sell: { type: \"string\", description: \"Asset given up.\" },\n buy: { type: \"string\", description: \"Asset acquired.\" },\n notional: { type: \"string\", description: 'How much to spend, e.g. \"300 USDG\".' },\n type: {\n type: \"string\",\n enum: [\"market\", \"limit\", \"twap\", \"bracket\"],\n description: \"Order type. Defaults to market.\",\n },\n maxSlippage: {\n type: \"number\",\n description:\n \"Largest acceptable adverse move as a fraction, e.g. 0.003. Exceeding it rejects the order instead of filling it worse.\",\n },\n limitPrice: { type: \"number\", description: \"limit: price to rest at.\" },\n window: {\n type: \"string\",\n description: 'twap: window to spread across, e.g. \"30m\".',\n },\n takeProfit: { type: \"number\", description: \"bracket: exit price above.\" },\n stopLoss: { type: \"number\", description: \"bracket: exit price below.\" },\n },\n required: [\"sell\", \"buy\", \"notional\"],\n },\n },\n async run(input) {\n const orderOptions: OrderOptions = {\n ...(input.type ? { type: input.type as OrderOptions[\"type\"] } : {}),\n ...(typeof input.maxSlippage === \"number\" ? { maxSlippage: input.maxSlippage } : {}),\n ...(typeof input.limitPrice === \"number\" ? { limitPrice: input.limitPrice } : {}),\n ...(input.window ? { window: String(input.window) } : {}),\n ...(typeof input.takeProfit === \"number\" ? { takeProfit: input.takeProfit } : {}),\n ...(typeof input.stopLoss === \"number\" ? { stopLoss: input.stopLoss } : {}),\n };\n try {\n const quote = await trading.quote({\n sell: String(input.sell),\n buy: String(input.buy),\n notional: String(input.notional),\n });\n const order = await trading.execute(quote, orderOptions);\n return { ok: true, ...formatOrder(await order.settled()) };\n } catch (error) {\n if (error instanceof PolicyDeniedError) {\n return {\n ok: false,\n refused: true,\n reason: error.decision.reason,\n rule: error.decision.rule,\n hint: \"This limit is set by the wallet owner. Ask them to raise it rather than retrying.\",\n };\n }\n throw error;\n }\n },\n },\n\n list_positions: {\n definition: {\n name: \"list_positions\",\n description: \"Open positions with cost basis and unrealized P&L at the latest mark.\",\n inputSchema: { type: \"object\", properties: {} },\n },\n async run() {\n return trading.positions().map((p) => ({\n asset: p.asset,\n quantity: formatMoney(p.quantity),\n averageCost: p.averageCost,\n costBasis: formatMoney(p.costBasis),\n marketValue: formatMoney(p.marketValue),\n unrealized: formatMoney(p.unrealized),\n realized: formatMoney(p.realized),\n }));\n },\n },\n\n close_position: {\n definition: {\n name: \"close_position\",\n description:\n \"Exit a position with the same guarantees the entry had: policy first, slippage bound enforced.\",\n inputSchema: {\n type: \"object\",\n properties: {\n asset: { type: \"string\", description: \"Asset to close.\" },\n maxSlippage: {\n type: \"number\",\n description: \"Largest acceptable adverse move as a fraction.\",\n },\n },\n required: [\"asset\"],\n },\n },\n async run(input) {\n try {\n const order = await trading.close(String(input.asset), {\n type: \"market\",\n ...(typeof input.maxSlippage === \"number\"\n ? { maxSlippage: input.maxSlippage }\n : {}),\n });\n return { ok: true, ...formatOrder(await order.settled()) };\n } catch (error) {\n if (error instanceof PolicyDeniedError) {\n return {\n ok: false,\n refused: true,\n reason: error.decision.reason,\n rule: error.decision.rule,\n };\n }\n throw error;\n }\n },\n },\n }\n : {};\n\n return {\n definitions: [\n ...walletTools.definitions,\n ...Object.values(tradingTools).map((tool) => tool.definition),\n ],\n async handle(name, input) {\n const tradingTool = tradingTools[name];\n if (tradingTool) return tradingTool.run(input ?? {});\n return walletTools.handle(name, input ?? {});\n },\n };\n}\n\nfunction formatOrder(result: OrderResult) {\n return {\n orderId: result.id,\n status: result.status,\n type: result.type,\n sell: result.sell,\n buy: result.buy,\n filled: formatMoney(result.filled),\n received: formatMoney(result.received),\n averagePrice: result.averagePrice,\n slippage: result.slippage,\n fees: formatMoney(result.fees),\n ...(result.reason ? { reason: result.reason } : {}),\n ...(result.decision ? { policyVersion: result.decision.policyVersion } : {}),\n };\n}\n\ntype Handler = (input: Record<string, unknown>) => Promise<unknown>;\n"],"mappings":";;;AAcA,SAAS,qBAAqB;;;ACd9B,SAAS,oBAAoB;AAC7B,SAAS,aAAa,qBAAqB;AAC3C,SAAS,mBAA4C;AACrD,SAAS,eAAe,sBAAoC;AAC5D,SAAS,cAAc,aAAa,kBAA+B;AA0BnE,IAAM,iBAAyB;AAAA,EAC7B,gBAAgB,EAAE,KAAK,OAAO;AAAA,EAC9B,YAAY,EAAE,KAAK,SAAS;AAAA,EAC5B,UAAU,EAAE,KAAK,IAAI,KAAK,KAAK;AAAA,EAC/B,gBAAgB;AAAA,EAChB,OAAO,CAAC,UAAU,WAAW,UAAU;AAAA,EACvC,UAAU,EAAE,OAAO,SAAS;AAC9B;AAGA,IAAM,iBAAyC;AAAA,EAC7C,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AACR;AAEA,eAAsB,cAAc,UAA0B,CAAC,GAAqB;AAClF,QAAM,QAAQ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,KAAK,mBAC3C,QAAQ,OAAO,OAAO,YAAY,QAAQ,MAAM,OAAO,OAAO;AAE5E;AAEA,MAAM,WAAW,MAAM;","names":["server"]}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@moneolabs/mcp",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
+ "mcpName": "io.github.moneolabs/moneo",
4
5
  "description": "MCP server for Moneo: hand any agent host a guarded wallet and trading tools.",
5
6
  "license": "MIT",
6
7
  "type": "module",
@@ -60,9 +61,9 @@
60
61
  },
61
62
  "dependencies": {
62
63
  "@modelcontextprotocol/sdk": "^1.29.0",
63
- "@moneolabs/core": "0.1.0",
64
- "@moneolabs/guard": "0.1.0",
65
- "@moneolabs/trading": "0.1.0",
66
- "@moneolabs/wallet": "0.1.0"
64
+ "@moneolabs/core": "0.2.1",
65
+ "@moneolabs/guard": "0.2.1",
66
+ "@moneolabs/trading": "0.2.1",
67
+ "@moneolabs/wallet": "0.2.1"
67
68
  }
68
69
  }