@agent402-dev/check-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/README.md +1 -2
- package/dist/server.js +4 -4
- package/dist/tools.d.ts +3 -3
- package/dist/tools.js +12 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@ MCP server (stdio) that returns **facts with evidence addresses** about a Solana
|
|
|
4
4
|
It does not judge or rate tokens and gives no investment advice.
|
|
5
5
|
|
|
6
6
|
> Factual information from public on-chain data. Not investment advice.
|
|
7
|
-
> 공개 온체인 데이터에 따른 사실 정보이며 투자 권유가 아닙니다.
|
|
8
7
|
|
|
9
8
|
Part of the [Agent402 toolkit](https://github.com/agent402-dev/agent402-toolkit) (Solana). Uses [`@agent402-dev/check-engine`](https://github.com/agent402-dev/agent402-toolkit/tree/main/packages/check-engine).
|
|
10
9
|
Not related to `agent402.tools`, `@agents402` or other similarly named sites, accounts or projects, including projects named "a402" on other chains.
|
|
@@ -43,4 +42,4 @@ Token amounts in results are in the token's smallest unit (raw integer) unless t
|
|
|
43
42
|
Apache-2.0. See [LICENSE](https://github.com/agent402-dev/agent402-toolkit/blob/main/LICENSE) and [NOTICE](https://github.com/agent402-dev/agent402-toolkit/blob/main/NOTICE).
|
|
44
43
|
|
|
45
44
|
---
|
|
46
|
-
Factual information from public on-chain data. Not investment advice.
|
|
45
|
+
Factual information from public on-chain data. Not investment advice.
|
package/dist/server.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// A402 Check MCP
|
|
3
|
-
// A402_CHECK_API —
|
|
4
|
-
// A402_CHECK_RPC_URL —
|
|
5
|
-
//
|
|
2
|
+
// A402 Check MCP server (stdio, free). Configured with environment variables:
|
|
3
|
+
// A402_CHECK_API — hosted API address (default: public Worker) — token_check_summary
|
|
4
|
+
// A402_CHECK_RPC_URL — your own Solana mainnet RPC — token_check (full local report). If unset, only explains how to set it up
|
|
5
|
+
// No payment features. RPC addresses and keys are never printed (stdout is for the MCP protocol only)
|
|
6
6
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
7
7
|
import { fetchChainReader } from '@agent402-dev/check-engine/rpc-lite';
|
|
8
8
|
import { createServer, DEFAULT_API } from './tools.js';
|
package/dist/tools.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import type { ChainReader, HistoryReader } from '@agent402-dev/check-engine/chai
|
|
|
3
3
|
export declare const DEFAULT_API = "https://a402-check.agent402-ebc.workers.dev";
|
|
4
4
|
export interface ToolDeps {
|
|
5
5
|
apiBase: string;
|
|
6
|
-
/**
|
|
6
|
+
/** fetch for calling the hosted API */
|
|
7
7
|
fetch: typeof fetch;
|
|
8
|
-
/**
|
|
8
|
+
/** Reader for the full local report (your RPC). If missing, token_check only explains how to set it up */
|
|
9
9
|
reader: (() => ChainReader & HistoryReader) | null;
|
|
10
10
|
now?: () => Date;
|
|
11
11
|
}
|
|
@@ -17,7 +17,7 @@ type ToolResult = {
|
|
|
17
17
|
isError?: boolean;
|
|
18
18
|
};
|
|
19
19
|
export declare function summaryTool(d: ToolDeps, mint: string): Promise<ToolResult>;
|
|
20
|
-
/**
|
|
20
|
+
/** Runs the full report on this computer (your RPC). RPC addresses and keys are never put in responses or errors */
|
|
21
21
|
export declare function fullTool(d: ToolDeps, mint: string): Promise<ToolResult>;
|
|
22
22
|
export declare function createServer(d: ToolDeps): McpServer;
|
|
23
23
|
export {};
|
package/dist/tools.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
// A402 Check MCP
|
|
2
|
-
// - token_check_summary:
|
|
3
|
-
// - token_check:
|
|
1
|
+
// A402 Check MCP tools (free):
|
|
2
|
+
// - token_check_summary: free summary from the hosted API (sections 1 to 4, no key needed, 20 per IP per day)
|
|
3
|
+
// - token_check: full report (sections 1 to 8) run locally with your own Solana RPC. No payment
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
6
|
import { checkFull, LOCAL_LIMITS } from '@agent402-dev/check-engine/full';
|
|
7
7
|
import { MintNotFoundError } from '@agent402-dev/check-engine/summary';
|
|
8
8
|
import { NotAMintError } from '@agent402-dev/check-engine/mint';
|
|
9
9
|
export const DEFAULT_API = 'https://a402-check.agent402-ebc.workers.dev';
|
|
10
|
-
const DISCLAIMER = '
|
|
10
|
+
const DISCLAIMER = 'Factual information from public on-chain data. Not investment advice.';
|
|
11
11
|
const MINT = z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/, 'Solana base58 mint address');
|
|
12
12
|
const text = (obj, isError = false) => ({ content: [{ type: 'text', text: JSON.stringify(obj, null, 2) }], ...(isError ? { isError } : {}) });
|
|
13
13
|
async function readJson(res) {
|
|
@@ -26,12 +26,12 @@ export async function summaryTool(d, mint) {
|
|
|
26
26
|
return text(body);
|
|
27
27
|
return text({ status: res.status, ...body, remainingToday: res.headers.get('x-ratelimit-remaining') }, true);
|
|
28
28
|
}
|
|
29
|
-
/**
|
|
29
|
+
/** Runs the full report on this computer (your RPC). RPC addresses and keys are never put in responses or errors */
|
|
30
30
|
export async function fullTool(d, mint) {
|
|
31
31
|
if (!d.reader) {
|
|
32
32
|
return text({
|
|
33
33
|
error: 'rpc_not_configured',
|
|
34
|
-
message: 'token_check
|
|
34
|
+
message: 'token_check runs on this computer with your own Solana mainnet RPC (free). Add A402_CHECK_RPC_URL to your MCP settings. Public RPCs without a key often block the calls used for sections 5 to 8 (getTokenLargestAccounts, getProgramAccounts). If you only need sections 1 to 4, use token_check_summary',
|
|
35
35
|
notes: [DISCLAIMER],
|
|
36
36
|
}, true);
|
|
37
37
|
}
|
|
@@ -41,15 +41,15 @@ export async function fullTool(d, mint) {
|
|
|
41
41
|
}
|
|
42
42
|
catch (e) {
|
|
43
43
|
if (e instanceof MintNotFoundError)
|
|
44
|
-
return text({ error: 'mint_not_found', message: '
|
|
44
|
+
return text({ error: 'mint_not_found', message: 'There is no account at this address', notes: [DISCLAIMER] }, true);
|
|
45
45
|
if (e instanceof NotAMintError)
|
|
46
|
-
return text({ error: 'not_a_mint', message: '
|
|
47
|
-
return text({ error: 'upstream_unavailable', message: '
|
|
46
|
+
return text({ error: 'not_a_mint', message: 'This address is not an SPL Token / Token-2022 mint', notes: [DISCLAIMER] }, true);
|
|
47
|
+
return text({ error: 'upstream_unavailable', message: 'Could not read on-chain data from the configured RPC. Check the RPC address and plan limits', notes: [DISCLAIMER] }, true);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
export function createServer(d) {
|
|
51
|
-
const server = new McpServer({ name: 'a402-check', version: '0.2.
|
|
52
|
-
server.tool('token_check_summary', 'Free factual check of a Solana token mint (items 1-4) via the hosted A402 Check API: mint authority, freeze authority, metadata update authority (Token-2022 and Metaplex), and Token-2022 extensions with their authority addresses. No API key needed; limited to 20 calls per IP per day. Returns facts and evidence addresses only — no judgments, ratings, or investment advice.', { mint: MINT }, async ({ mint }) => summaryTool(d, mint));
|
|
53
|
-
server.tool('token_check', 'Free full factual report on a Solana token mint (items 1-8), computed on this machine with your own Solana RPC (set A402_CHECK_RPC_URL): authorities, Token-2022 extensions, holder concentration (pools, locks, wallets separated), liquidity lock (Meteora DAMM v2, Raydium CPMM), operator locks (Streamflow), and buys right after trading opened. No payment. Returns facts and evidence addresses only — no judgments, ratings, or investment advice.', { mint: MINT }, async ({ mint }) => fullTool(d, mint));
|
|
51
|
+
const server = new McpServer({ name: 'a402-check', version: '0.2.1' });
|
|
52
|
+
server.tool('token_check_summary', 'Free factual check of a Solana token mint (items 1-4) via the hosted A402 Check API: mint authority, freeze authority, metadata update authority (Token-2022 and Metaplex), and Token-2022 extensions with their authority addresses. No API key needed; limited to 20 calls per IP per day. Returns facts and evidence addresses only — no judgments, ratings, or investment advice. Errors: HTTP 404 when no mint exists at the address, 429 when the daily limit is reached (remainingToday). For holders, liquidity locks and early buys use token_check.', { mint: MINT.describe('Solana token mint address (base58).') }, async ({ mint }) => summaryTool(d, mint));
|
|
53
|
+
server.tool('token_check', 'Free full factual report on a Solana token mint (items 1-8), computed on this machine with your own Solana RPC (set A402_CHECK_RPC_URL): authorities, Token-2022 extensions, holder concentration (pools, locks, wallets separated), liquidity lock (Meteora DAMM v2, Raydium CPMM), operator locks (Streamflow), and buys right after trading opened. No payment. Returns facts and evidence addresses only — no judgments, ratings, or investment advice. Errors: rpc_not_configured (no A402_CHECK_RPC_URL; use token_check_summary), mint_not_found, not_a_mint, upstream_unavailable (RPC failed or blocked the calls).', { mint: MINT.describe('Solana token mint address (base58).') }, async ({ mint }) => fullTool(d, mint));
|
|
54
54
|
return server;
|
|
55
55
|
}
|
package/package.json
CHANGED
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
23
|
-
"@agent402-dev/check-engine": "^0.
|
|
23
|
+
"@agent402-dev/check-engine": "^0.2.0",
|
|
24
24
|
"zod": "^4.6.7"
|
|
25
25
|
},
|
|
26
|
-
"version": "0.1
|
|
26
|
+
"version": "0.2.1",
|
|
27
27
|
"author": "Agent402",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"type": "module",
|