@agentoracle.ai/mcp-server 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AgentOracle
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,117 @@
1
+ # @agentoracle.ai/mcp-server
2
+
3
+ Model Context Protocol (MCP) server for **[AgentOracle](https://aiagentoracle.ai)** — real-time on-chain crypto market data, pay-per-call USDC on Base via x402.
4
+
5
+ Plug AgentOracle into any MCP-compatible host (Claude Desktop, Cursor, Continue, Cline, Zed, etc.) and your agent can query token prices, volume, liquidity, market cap, top movers, and per-symbol lookups — paying $0.01 USDC per call automatically. No API keys.
6
+
7
+ ## Tools exposed
8
+
9
+ | Tool | Purpose |
10
+ | --- | --- |
11
+ | `agentoracle_status` | Service heartbeat: token count, last ingestion, uptime, version |
12
+ | `agentoracle_list_tokens` | List tokens with filters (chain, min liquidity, min volume, min market cap, limit, offset) |
13
+ | `agentoracle_top_tokens` | Top N tokens by market cap (limit 1–100, default 20) |
14
+ | `agentoracle_movers` | Top 10 gainers + top 10 losers by 24h price change |
15
+ | `agentoracle_get_token` | Single-token lookup by ticker (case-insensitive: `ETH`, `BTC`, `SOL`, …) |
16
+
17
+ Every call costs **$0.01 USDC** on Base mainnet, settled via the official Coinbase CDP Facilitator.
18
+
19
+ ## Install
20
+
21
+ You don't need to install anything — `npx` handles it.
22
+
23
+ ## Configure: Claude Desktop
24
+
25
+ Edit your Claude Desktop config:
26
+
27
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
28
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
29
+
30
+ Add the `agentoracle` entry under `mcpServers`:
31
+
32
+ ```json
33
+ {
34
+ "mcpServers": {
35
+ "agentoracle": {
36
+ "command": "npx",
37
+ "args": ["-y", "@agentoracle.ai/mcp-server"],
38
+ "env": {
39
+ "WALLET_PRIVATE_KEY": "0xYOUR_BASE_WALLET_PRIVATE_KEY"
40
+ }
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ Restart Claude Desktop. The five tools will appear in the MCP tool palette.
47
+
48
+ ## Configure: Cursor
49
+
50
+ Cursor → Settings → MCP → Add new MCP server:
51
+
52
+ ```json
53
+ {
54
+ "name": "agentoracle",
55
+ "command": "npx",
56
+ "args": ["-y", "@agentoracle.ai/mcp-server"],
57
+ "env": {
58
+ "WALLET_PRIVATE_KEY": "0xYOUR_BASE_WALLET_PRIVATE_KEY"
59
+ }
60
+ }
61
+ ```
62
+
63
+ ## Configure: Continue, Cline, Zed, others
64
+
65
+ Any MCP host that supports stdio transport works — point it at `npx -y @agentoracle.ai/mcp-server` and pass `WALLET_PRIVATE_KEY` in the env block.
66
+
67
+ ## Wallet setup
68
+
69
+ You need a Base mainnet wallet with USDC. Cheap options:
70
+
71
+ 1. **Coinbase Wallet** → export private key → fund with $5 of USDC on Base. That's 500 calls.
72
+ 2. **MetaMask** → switch to Base network → bridge USDC from Ethereum or Polygon, or buy directly.
73
+ 3. **Programmatic** — generate a key with `viem`'s `generatePrivateKey()`, fund via Coinbase Onramp.
74
+
75
+ The private key never leaves your machine; the MCP server uses it locally to sign EIP-3009 USDC transfers.
76
+
77
+ ## Environment variables
78
+
79
+ | Variable | Required | Default | Purpose |
80
+ | --- | --- | --- | --- |
81
+ | `WALLET_PRIVATE_KEY` | Yes (for paid calls) | — | Hex private key of a Base wallet with USDC. Without it, every call returns HTTP 402. |
82
+ | `AGENTORACLE_BASE_URL` | No | `https://aiagentoracle.ai` | Override the API base URL (useful for self-hosted forks). |
83
+
84
+ ## Try it (without payment)
85
+
86
+ You can list the tools without any wallet:
87
+
88
+ ```bash
89
+ WALLET_PRIVATE_KEY="" npx -y @agentoracle.ai/mcp-server
90
+ ```
91
+
92
+ Then send `{"jsonrpc":"2.0","id":1,"method":"tools/list"}` over stdin — every paid tool call will return HTTP 402 explaining what's needed.
93
+
94
+ ## Build from source
95
+
96
+ ```bash
97
+ git clone https://github.com/agentoracle/mcp-server.git
98
+ cd mcp-server
99
+ npm install
100
+ npm run build
101
+ node dist/index.js
102
+ ```
103
+
104
+ ## Pricing
105
+
106
+ Every call is $0.01 USDC on Base. Settled per request — there are no subscriptions, accounts, or invoices. The pay-to address is published in the canonical x402 manifest at <https://aiagentoracle.ai/.well-known/x402>.
107
+
108
+ ## License
109
+
110
+ MIT
111
+
112
+ ## Links
113
+
114
+ - AgentOracle: <https://aiagentoracle.ai>
115
+ - x402 manifest: <https://aiagentoracle.ai/.well-known/x402>
116
+ - x402 protocol: <https://x402.org>
117
+ - Model Context Protocol: <https://modelcontextprotocol.io>
package/dist/index.js ADDED
@@ -0,0 +1,197 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { CallToolRequestSchema, ListToolsRequestSchema, ErrorCode, McpError, } from "@modelcontextprotocol/sdk/types.js";
5
+ import { createPublicClient, http } from "viem";
6
+ import { privateKeyToAccount } from "viem/accounts";
7
+ import { base } from "viem/chains";
8
+ import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
9
+ import { ExactEvmScheme, toClientEvmSigner } from "@x402/evm";
10
+ const BASE_URL = process.env.AGENTORACLE_BASE_URL ?? "https://aiagentoracle.ai";
11
+ const PRIVATE_KEY = process.env.WALLET_PRIVATE_KEY;
12
+ function buildFetch() {
13
+ if (!PRIVATE_KEY)
14
+ return fetch;
15
+ const pk = PRIVATE_KEY.startsWith("0x") ? PRIVATE_KEY : `0x${PRIVATE_KEY}`;
16
+ const account = privateKeyToAccount(pk);
17
+ const publicClient = createPublicClient({ chain: base, transport: http() });
18
+ // toClientEvmSigner composes the viem account (signTypedData) with a
19
+ // publicClient (readContract) into the ClientEvmSigner shape ExactEvmScheme
20
+ // expects. ExactEvmScheme handles EIP-3009 (USDC), the scheme AgentOracle accepts.
21
+ const signer = toClientEvmSigner(account, publicClient);
22
+ const client = new x402Client().register("eip155:8453", new ExactEvmScheme(signer));
23
+ return wrapFetchWithPayment(fetch, client);
24
+ }
25
+ const paidFetch = buildFetch();
26
+ function buildUrl(path, query) {
27
+ const url = new URL(path, BASE_URL);
28
+ if (query) {
29
+ for (const [k, v] of Object.entries(query)) {
30
+ if (v === undefined || v === null || v === "")
31
+ continue;
32
+ url.searchParams.set(k, String(v));
33
+ }
34
+ }
35
+ return url.toString();
36
+ }
37
+ async function callEndpoint(path, query) {
38
+ const url = buildUrl(path, query);
39
+ let res;
40
+ try {
41
+ res = await paidFetch(url, { method: "GET" });
42
+ }
43
+ catch (err) {
44
+ const msg = err instanceof Error ? err.message : String(err);
45
+ throw new McpError(ErrorCode.InternalError, `AgentOracle request failed: ${msg}. ` +
46
+ (PRIVATE_KEY
47
+ ? ""
48
+ : "No WALLET_PRIVATE_KEY env var set — paid endpoints will return HTTP 402."));
49
+ }
50
+ const text = await res.text();
51
+ let payload;
52
+ try {
53
+ payload = text ? JSON.parse(text) : null;
54
+ }
55
+ catch {
56
+ payload = text;
57
+ }
58
+ if (!res.ok) {
59
+ if (res.status === 402) {
60
+ throw new McpError(ErrorCode.InternalError, "HTTP 402 Payment Required from AgentOracle. " +
61
+ "Set WALLET_PRIVATE_KEY env var (a Base wallet with USDC) so the MCP server can settle x402 payments. " +
62
+ "Each call costs $0.01 USDC on Base.");
63
+ }
64
+ if (res.status === 404) {
65
+ throw new McpError(ErrorCode.InvalidParams, `Not found: ${url}`);
66
+ }
67
+ if (res.status === 429) {
68
+ throw new McpError(ErrorCode.InternalError, "Rate limited by AgentOracle (60 req/min per wallet). Back off and retry.");
69
+ }
70
+ throw new McpError(ErrorCode.InternalError, `AgentOracle returned HTTP ${res.status}: ${typeof payload === "string" ? payload : JSON.stringify(payload)}`);
71
+ }
72
+ return payload;
73
+ }
74
+ const TOOLS = [
75
+ {
76
+ name: "agentoracle_status",
77
+ description: "Get AgentOracle service heartbeat: tracked-token count, last ingestion timestamp, ingestion error counter, process uptime, and API version. Use as a cheap probe before larger queries. Costs $0.01 USDC on Base.",
78
+ inputSchema: {
79
+ type: "object",
80
+ properties: {},
81
+ additionalProperties: false,
82
+ },
83
+ },
84
+ {
85
+ name: "agentoracle_list_tokens",
86
+ description: "List on-chain crypto tokens sorted by market cap, with optional filters and pagination. Returns price, 24h volume, market cap, liquidity, 24h price change, confidence score, and last-updated timestamp for each token. Costs $0.01 USDC on Base.",
87
+ inputSchema: {
88
+ type: "object",
89
+ properties: {
90
+ chain: {
91
+ type: "string",
92
+ description: "Filter by chain (e.g. 'ethereum', 'base', 'solana', 'bsc').",
93
+ },
94
+ min_liquidity: { type: "number", description: "Minimum liquidity in USD." },
95
+ min_volume_24h: { type: "number", description: "Minimum 24h volume in USD." },
96
+ min_market_cap: { type: "number", description: "Minimum market cap in USD." },
97
+ limit: {
98
+ type: "integer",
99
+ minimum: 1,
100
+ maximum: 500,
101
+ description: "Max results to return (default 100, max 500).",
102
+ },
103
+ offset: {
104
+ type: "integer",
105
+ minimum: 0,
106
+ description: "Pagination offset.",
107
+ },
108
+ },
109
+ additionalProperties: false,
110
+ },
111
+ },
112
+ {
113
+ name: "agentoracle_top_tokens",
114
+ description: "Get the top N on-chain crypto tokens by market cap. Same per-token shape as list_tokens. Costs $0.01 USDC on Base.",
115
+ inputSchema: {
116
+ type: "object",
117
+ properties: {
118
+ limit: {
119
+ type: "integer",
120
+ minimum: 1,
121
+ maximum: 100,
122
+ description: "Number of top tokens to return (default 20, max 100).",
123
+ },
124
+ },
125
+ additionalProperties: false,
126
+ },
127
+ },
128
+ {
129
+ name: "agentoracle_movers",
130
+ description: "Get the top 10 gainers and top 10 losers by 24h price change percentage across all tracked on-chain tokens. Returns { gainers, losers, asOf }. Costs $0.01 USDC on Base.",
131
+ inputSchema: {
132
+ type: "object",
133
+ properties: {},
134
+ additionalProperties: false,
135
+ },
136
+ },
137
+ {
138
+ name: "agentoracle_get_token",
139
+ description: "Look up a single on-chain crypto token by its ticker symbol (case-insensitive, e.g. 'ETH', 'BTC', 'SOL', 'USDC'). Returns the full token snapshot, or HTTP 404 if the symbol is unknown. Costs $0.01 USDC on Base. 404s do NOT consume payment.",
140
+ inputSchema: {
141
+ type: "object",
142
+ properties: {
143
+ symbol: {
144
+ type: "string",
145
+ minLength: 1,
146
+ maxLength: 16,
147
+ description: "Token ticker symbol (case-insensitive).",
148
+ },
149
+ },
150
+ required: ["symbol"],
151
+ additionalProperties: false,
152
+ },
153
+ },
154
+ ];
155
+ const server = new Server({ name: "agentoracle-mcp", version: "0.1.0" }, { capabilities: { tools: {} } });
156
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
157
+ server.setRequestHandler(CallToolRequestSchema, async (req) => {
158
+ const { name, arguments: args = {} } = req.params;
159
+ const a = args;
160
+ let result;
161
+ switch (name) {
162
+ case "agentoracle_status":
163
+ result = await callEndpoint("/api/v1/status");
164
+ break;
165
+ case "agentoracle_list_tokens":
166
+ result = await callEndpoint("/api/v1/tokens", a);
167
+ break;
168
+ case "agentoracle_top_tokens":
169
+ result = await callEndpoint("/api/v1/tokens/top", a);
170
+ break;
171
+ case "agentoracle_movers":
172
+ result = await callEndpoint("/api/v1/tokens/movers");
173
+ break;
174
+ case "agentoracle_get_token": {
175
+ const symbol = String(a.symbol ?? "").trim();
176
+ if (!symbol) {
177
+ throw new McpError(ErrorCode.InvalidParams, "symbol is required");
178
+ }
179
+ result = await callEndpoint(`/api/v1/token/${encodeURIComponent(symbol)}`);
180
+ break;
181
+ }
182
+ default:
183
+ throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
184
+ }
185
+ return {
186
+ content: [
187
+ {
188
+ type: "text",
189
+ text: JSON.stringify(result, null, 2),
190
+ },
191
+ ],
192
+ };
193
+ });
194
+ const transport = new StdioServerTransport();
195
+ await server.connect(transport);
196
+ process.stderr.write(`[agentoracle-mcp] connected. base=${BASE_URL} payments=${PRIVATE_KEY ? "enabled" : "DISABLED (set WALLET_PRIVATE_KEY)"}\n`);
197
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,SAAS,EACT,QAAQ,GACT,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC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AAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;aACtC;SACF;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAEhC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,qCAAqC,QAAQ,aAC3C,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,mCAC5B,IAAI,CACL,CAAC"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@agentoracle.ai/mcp-server",
3
+ "version": "0.1.0",
4
+ "description": "Model Context Protocol server for AgentOracle — real-time on-chain crypto market data, pay-per-call USDC on Base via x402.",
5
+ "type": "module",
6
+ "bin": {
7
+ "agentoracle-mcp": "./dist/index.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "files": [
11
+ "dist",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc",
17
+ "dev": "tsx src/index.ts",
18
+ "start": "node dist/index.js",
19
+ "smoke": "node scripts/smoke.mjs",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "keywords": [
23
+ "mcp",
24
+ "model-context-protocol",
25
+ "x402",
26
+ "agentoracle",
27
+ "crypto",
28
+ "base",
29
+ "usdc",
30
+ "ai-agents",
31
+ "claude"
32
+ ],
33
+ "author": "AgentOracle",
34
+ "license": "MIT",
35
+ "homepage": "https://aiagentoracle.ai",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/agentoracle/mcp-server.git"
39
+ },
40
+ "dependencies": {
41
+ "@modelcontextprotocol/sdk": "^1.0.4",
42
+ "@x402/fetch": "^2.11.0",
43
+ "@x402/core": "^2.11.0",
44
+ "@x402/evm": "^2.11.0",
45
+ "viem": "^2.21.0"
46
+ },
47
+ "devDependencies": {
48
+ "@types/node": "^22.10.0",
49
+ "tsx": "^4.19.0",
50
+ "typescript": "^5.7.0"
51
+ },
52
+ "engines": {
53
+ "node": ">=20"
54
+ }
55
+ }