{"_id":"@economyos-xyz/mcp","_rev":"3-60735f605824f122fae04317a4d4d6d8","name":"@economyos-xyz/mcp","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@economyos-xyz/mcp","version":"0.1.0","license":"MIT","_id":"@economyos-xyz/mcp@0.1.0","maintainers":[{"name":"economyos","email":"charvel.chedraui@gmail.com"}],"homepage":"https://github.com/CharvAI/EconomyOS/tree/main/mcp#readme","bugs":"https://github.com/CharvAI/EconomyOS/issues","bin":{"economyos-mcp":"./dist/index.js","economyos-mcp-http":"./dist/http.js"},"dist":{"shasum":"f5b394c4bcc141d9e035ee2c40201856db03ac1f","tarball":"https://registry.npmjs.org/@economyos-xyz/mcp/-/mcp-0.1.0.tgz","fileCount":10,"integrity":"sha512-PcBf3NvE5arJ6QllVQcyJf40Kkx1rIDU7pxmNdi/fiIWRsdpEJADNMv1tuSsDVofJzi89cQagwAEoZNGmzCXkQ==","signatures":[{"sig":"MEUCIAKNiWGfkOufwl4MV4N8yz5EuZptUrg2o//eAKtcCf45AiEA4mJe4ulj0EYD7p8tx+lh10UEBqsfkR9ewm64hksLeFg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":55986},"type":"module","scripts":{"dev":"tsx src/index.ts","build":"tsc -p tsconfig.json","start":"node dist/index.js","dev:http":"tsx src/http.ts","gate:http":"tsx test/http-gate.ts","typecheck":"tsc --noEmit","start:http":"node dist/http.js"},"_npmUser":{"name":"economyos","email":"charvel.chedraui@gmail.com"},"repository":{"url":"git+https://github.com/CharvAI/EconomyOS.git","type":"git","directory":"mcp"},"description":"Model Context Protocol server (stdio + Streamable HTTP) exposing EconomyOS — coins, prediction markets, bounties, identity, invoices, streams — as MCP tools, built on @economyos-xyz/sdk.","directories":{},"_nodeVersion":"24.18.0","dependencies":{"zod":"^3.24.2","viem":"^2.21.26","@economyos-xyz/sdk":"0.1.0","@modelcontextprotocol/sdk":"^1.19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","typescript":"^5.6.0","@types/node":"^20.11.0"},"_npmOperationalInternal":{"tmp":"tmp/mcp_0.1.0_1784343048257_0.39879326916241076","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@economyos-xyz/mcp","version":"0.1.1","license":"MIT","_id":"@economyos-xyz/mcp@0.1.1","maintainers":[{"name":"economyos","email":"charvel.chedraui@gmail.com"}],"homepage":"https://github.com/CharvAI/EconomyOS/tree/main/mcp#readme","bugs":"https://github.com/CharvAI/EconomyOS/issues","bin":{"economyos-mcp":"./dist/index.js","economyos-mcp-http":"./dist/http.js"},"dist":{"shasum":"738cea54125951b0ffdce046d2e1140746b0bb53","tarball":"https://registry.npmjs.org/@economyos-xyz/mcp/-/mcp-0.1.1.tgz","fileCount":10,"integrity":"sha512-+WsjmdWR6nNm8ZnTwQ6c50VqVLekXpH9LYjjk/8AzwAN6g1BURRuUvC8CroLcwYbjQcofsDhp8Ib3KcdH1wByg==","signatures":[{"sig":"MEQCIHMDwBZTvzdPVzht5jj8aYhPu6X1oNe2svwiwrfoHDiwAiB04oiZv1EaiTnlrinQ+yskBQmiaXhAPcHbq3gxdmAFTg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64306},"type":"module","scripts":{"dev":"tsx src/index.ts","test":"tsx --test test/*.test.ts","build":"tsc -p tsconfig.json","start":"node dist/index.js","dev:http":"tsx src/http.ts","gate:http":"tsx test/http-gate.ts","typecheck":"tsc --noEmit","start:http":"node dist/http.js"},"_npmUser":{"name":"economyos","email":"charvel.chedraui@gmail.com"},"repository":{"url":"git+https://github.com/CharvAI/EconomyOS.git","type":"git","directory":"mcp"},"description":"Model Context Protocol server (stdio + Streamable HTTP) exposing EconomyOS — coins, prediction markets, bounties, identity, invoices, streams — as MCP tools, built on @economyos-xyz/sdk.","directories":{},"_nodeVersion":"24.18.0","dependencies":{"zod":"^3.24.2","bs58":"^6.0.0","viem":"^2.21.26","@solana/web3.js":"^1.98.4","@economyos-xyz/sdk":"^0.2.0","@modelcontextprotocol/sdk":"^1.19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","typescript":"^5.6.0","@types/node":"^20.11.0"},"_npmOperationalInternal":{"tmp":"tmp/mcp_0.1.1_1784353928826_0.06893206202321034","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@economyos-xyz/mcp","version":"0.1.2","description":"Model Context Protocol server (stdio + Streamable HTTP) exposing EconomyOS — coins, prediction markets, bounties, identity, invoices, streams — as MCP tools, built on @economyos-xyz/sdk.","license":"MIT","type":"module","bin":{"economyos-mcp":"./dist/index.js","economyos-mcp-http":"./dist/http.js"},"dependencies":{"@economyos-xyz/sdk":"^0.3.0","@modelcontextprotocol/sdk":"^1.19.0","@solana/web3.js":"^1.98.4","bs58":"^6.0.0","viem":"^2.21.26","zod":"^3.24.2"},"devDependencies":{"@types/node":"^20.11.0","tsx":"^4.19.0","typescript":"^5.6.0"},"repository":{"type":"git","url":"git+https://github.com/CharvAI/EconomyOS.git","directory":"mcp"},"homepage":"https://github.com/CharvAI/EconomyOS/tree/main/mcp#readme","bugs":"https://github.com/CharvAI/EconomyOS/issues","publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit","start":"node dist/index.js","dev":"tsx src/index.ts","start:http":"node dist/http.js","dev:http":"tsx src/http.ts","gate:http":"tsx test/http-gate.ts","test":"tsx --test test/*.test.ts"},"_nodeVersion":"24.18.0","_id":"@economyos-xyz/mcp@0.1.2","dist":{"integrity":"sha512-JAw7epOx4+l03sJky6JLs2z/MQkN1+TF0DABFy6223BBl5z/vcS+kCwmlvlxJzt9VjBCys0OrpwTi5ONj0OGHA==","shasum":"156fc23d94edd16becb2c0ff47d40d06e479befe","tarball":"https://registry.npmjs.org/@economyos-xyz/mcp/-/mcp-0.1.2.tgz","fileCount":11,"unpackedSize":72963,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF5BALSqcPwplj7YWSylafmHpZ0PufxfyukislWNPDDKAiEA+kEj+8hImWfZYrJ88recHfNtpfG9Hk/bTyvONBKO6i0="}]},"_npmUser":{"name":"economyos","email":"charvel.chedraui@gmail.com"},"directories":{},"maintainers":[{"name":"economyos","email":"charvel.chedraui@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp_0.1.2_1784432468076_0.5478903226581981"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-18T02:50:48.061Z","modified":"2026-07-19T03:41:08.388Z","0.1.0":"2026-07-18T02:50:48.405Z","0.1.1":"2026-07-18T05:52:08.993Z","0.1.2":"2026-07-19T03:41:08.233Z"},"bugs":"https://github.com/CharvAI/EconomyOS/issues","license":"MIT","homepage":"https://github.com/CharvAI/EconomyOS/tree/main/mcp#readme","repository":{"type":"git","url":"git+https://github.com/CharvAI/EconomyOS.git","directory":"mcp"},"description":"Model Context Protocol server (stdio + Streamable HTTP) exposing EconomyOS — coins, prediction markets, bounties, identity, invoices, streams — as MCP tools, built on @economyos-xyz/sdk.","maintainers":[{"name":"economyos","email":"charvel.chedraui@gmail.com"}],"readme":"# @economyos-xyz/mcp\n\nA [Model Context Protocol](https://modelcontextprotocol.io) server that exposes\nEconomyOS — coins, prediction markets, bounties, the L0 primitives\n(agent identity/reputation, invoices, payment streams), a primitive marketplace,\nand outbound x402 buying — as **34 MCP tools** (11 read + 23 write), built on\n[`@economyos-xyz/sdk`](../sdk). Two transports, one toolset (`src/tools.ts`):\n\n- **stdio** (`src/index.ts`, the `economyos-mcp` bin) — local install, one\n  agent identity per process from env. Unchanged from day one.\n- **Streamable HTTP** (`src/http.ts`, the `economyos-mcp-http` bin) — a hosted\n  remote server any MCP client (claude.ai connectors, ChatGPT, Cursor, …)\n  reaches with just a URL. Per-connection identity, multi-tenant-safe.\n\nPoint any MCP client at either and the model can create markets, trade\noutcomes, mint coins, post bounties, invoice and stream payments to other\nagents over x402 — the server handles the whole payment handshake and EIP-712\nsigning. **Testnet/devnet only** (Base Sepolia + Solana devnet).\n\n## Tools\n\n| Tool | What it does |\n|---|---|\n| `economyos_get_info` | Chain contracts, USDC, min payment, Pyth feed ids |\n| `economyos_get_balance` | USDC balance (defaults to the agent) |\n| `economyos_get_coin` / `economyos_get_market` / `economyos_get_bounty` | Read state |\n| `economyos_quote` | Exact buy/sell quote on an outcome curve |\n| `economyos_create_coin` / `economyos_buy_coin` / `economyos_sell_coin` | Coins |\n| `economyos_create_market` | Create a Pyth or optimistic multi-outcome market (paid = seed) |\n| `economyos_buy_outcome` / `economyos_sell_outcome` | Trade outcome shares |\n| `economyos_resolve_market` / `economyos_redeem` | Settle + redeem |\n| `economyos_post_bounty` / `economyos_submit_claim` | Bounties |\n| `economyos_register_agent` / `economyos_rotate_agent_key` / `economyos_attest` | Agent identity + attestations |\n| `economyos_get_agent` / `economyos_get_reputation` | Read identity / reputation (free) |\n| `economyos_create_invoice` / `economyos_get_invoice` / `economyos_pay_invoice` (paid = amount) / `economyos_cancel_invoice` | Invoices |\n| `economyos_open_stream` (paid = deposit) / `economyos_get_stream` / `economyos_top_up_stream` (paid) / `economyos_withdraw_stream` / `economyos_cancel_stream` | Payment streams |\n| `economyos_find_primitive` (free) / `economyos_publish_primitive` / `economyos_pay_primitive` (paid) | Primitive marketplace — discover, publish (EPS-1 manifest), pay a discovered primitive |\n| `pay_x402_url` (paid) | Outbound: fetch and pay ANY x402-gated URL as this agent (`exact` scheme, `maxPayment` cap) |\n\n34 tools total: **11 read** (free) + **23 write**. Paid tools answer the x402 quote and settle automatically; reads and\npermissionless pushes are free. All amounts are atomic USDC / share units (6dp)\nas integer strings.\n\nPaid L0 tools take optional `payWithToken` / `payWithMaxIn` (any-token pay):\nthe x402 payment settles in that token instead of USDC, and a 402 quote above\n`payWithMaxIn` is refused before signing. Servers without any-token support\nquote plain USDC and the call proceeds unchanged.\n\n## Install & build\n\n```bash\ncd sdk && npm install && npm run build   # build the SDK the MCP links against\ncd ../mcp && npm install && npm run build\n```\n\n## Configure your MCP client\n\nThe server is one agent identity, configured by env. `ECONOMYOS_PRIVATE_KEY` is\nthe agent's key — **user-held, never logged, passed only via env**.\n\n**Claude Desktop** — `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"economyos\": {\n      \"command\": \"node\",\n      \"args\": [\"/absolute/path/to/EconomyOS/mcp/dist/index.js\"],\n      \"env\": {\n        \"ECONOMYOS_API_URL\": \"https://api.economyos.xyz\",\n        \"ECONOMYOS_CHAIN\": \"base-sepolia\",\n        \"ECONOMYOS_PRIVATE_KEY\": \"0xYOUR_AGENT_KEY\"\n      }\n    }\n  }\n}\n```\n\n**Claude Code** — same shape:\n\n```bash\nclaude mcp add economyos -- node /absolute/path/to/EconomyOS/mcp/dist/index.js\n# then set ECONOMYOS_* in the generated config's env block\n```\n\nAny MCP client that speaks stdio works — launch `node dist/index.js` (or the\n`economyos-mcp` bin) with the three env vars set.\n\n## Env\n\n| Var | Default | Notes |\n|---|---|---|\n| `ECONOMYOS_API_URL` | `https://api.economyos.xyz` | agent-api base URL |\n| `ECONOMYOS_CHAIN` | `base-sepolia` | chain key |\n| `ECONOMYOS_PRIVATE_KEY` | — | stdio only; the agent's EVM key (user-held) |\n\n## Remote server (Streamable HTTP)\n\n```bash\nnpm run dev:http                    # tsx, http://localhost:8788/mcp\nnpm run build && npm run start:http # node dist/http.js\nnpm run gate:http                   # launch gate: fresh MCP client over HTTP\n```\n\nEndpoints: `POST/GET/DELETE /mcp` (MCP; in stateless mode only `POST /mcp` —\nGET/DELETE answer 405), `GET /health`,\n`GET /.well-known/oauth-protected-resource` (RFC 9728, once OAuth is\nconfigured). Deploys next to agent-api on **Vercel** (root directory `mcp`,\nstateless mode is auto-forced) or **Docker** (`mcp/Dockerfile`, long-lived\nstateful mode) — see [`HOSTING.md`](../HOSTING.md).\n\n### Identity & auth (multi-tenant safety)\n\nThe server never stores keys beyond a live session and never custodies funds.\nThree rungs per connection:\n\n1. **Unauthenticated** — read tools only (11 free reads). `tools/list` shows\n   exactly what the connection can call.\n2. **Per-session credential** — send your own **testnet** agent key with the\n   connection: header `X-EconomyOS-Private-Key: 0x…` (plus optional\n   `X-EconomyOS-Chain`). Unlocks the full 34-tool set acting as that key. The\n   key lives only in the live session's in-memory signer — never logged,\n   never persisted; the session dies on DELETE, disconnect, or idle TTL\n   (`MCP_SESSION_TTL_SEC`, default 1800). Each request of the session must\n   re-present the same credential (constant-time fingerprint check), so a\n   leaked `Mcp-Session-Id` alone cannot act as the agent.\n3. **OAuth 2.1 bearer (scaffold)** — RFC 9728 protected-resource metadata +\n   RFC 7662 token introspection, enabled entirely by env\n   (`MCP_OAUTH_ISSUER`, `MCP_OAUTH_INTROSPECTION_URL`,\n   `MCP_OAUTH_CLIENT_ID/SECRET`). A verified bearer is authenticated but\n   **read-only**: a token can prove who's calling, but it cannot conjure a\n   signing key, and this server refuses to custody keys. OAuth-gated writes\n   need a per-tenant KMS/custodial signer — a user decision (provider +\n   custody model), tracked as BLOCKED-on-user.\n\nExample client (official SDK):\n\n```ts\nimport { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport { StreamableHTTPClientTransport } from \"@modelcontextprotocol/sdk/client/streamableHttp.js\";\nconst client = new Client({ name: \"me\", version: \"1.0.0\" });\nawait client.connect(new StreamableHTTPClientTransport(\n  new URL(\"https://mcp.economyos.xyz/mcp\"),\n  { requestInit: { headers: { \"x-economyos-private-key\": process.env.MY_TESTNET_KEY! } } },\n));\n```\n\n### HTTP env\n\n| Var | Default | Notes |\n|---|---|---|\n| `MCP_HTTP_PORT` | `8788` | listen port (standalone; falls back to `PORT`, then 8788) |\n| `MCP_STATELESS` | unset (`1` forced on Vercel) | fresh server per request, JSON responses |\n| `MCP_SESSION_TTL_SEC` | `1800` | stateful idle session expiry |\n| `MCP_PUBLIC_URL` | `https://mcp.economyos.xyz` | advertised in OAuth metadata |\n| `MCP_ALLOWED_ORIGINS` | `*` | CORS allowlist (comma-separated) |\n| `MCP_OAUTH_ISSUER` / `MCP_OAUTH_INTROSPECTION_URL` / `MCP_OAUTH_CLIENT_ID` / `MCP_OAUTH_CLIENT_SECRET` | unset | enable the OAuth scaffold |\n\n## Registry listings\n\nPrepared submission files (official MCP registry `server.json`, mcp.so,\nSmithery, Glama, PulseMCP, Anthropic connectors directory) live in\n[`registry/`](registry/) with a submission checklist — submissions themselves\nare user-gated (accounts/tokens).\n","readmeFilename":""}