bytecode-intelligence-mcp 1.0.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/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # bytecode-intelligence-mcp
2
+
3
+ MCP server for EVM smart contract bytecode classification. Powered by [byteco.xyz](https://byteco.xyz).
4
+
5
+ Analyzes hex-encoded EVM bytecode and classifies it as a mixer, token, DEX, proxy, bridge, staking contract, or NFT — with a confidence score.
6
+
7
+ ## Tools
8
+
9
+ ### `analyze_bytecode`
10
+
11
+ Classifies EVM bytecode and returns a risk label with confidence.
12
+
13
+ **Input:**
14
+ - `bytecode` (string) — hex-encoded bytecode, with or without `0x` prefix
15
+ - `blockchain` (string, default `"evm"`) — chain family
16
+
17
+ **Output:**
18
+ ```
19
+ Label: mixer
20
+ Confidence: 91.3%
21
+ Meaning: Privacy/tumbler contract (e.g. Tornado Cash) — high risk
22
+
23
+ Family scores:
24
+ mixer 91.3%
25
+ proxy 6.1%
26
+ dex 1.8%
27
+ ...
28
+ ```
29
+
30
+ **Supported labels:** `mixer`, `erc20`, `erc721`, `proxy`, `dex`, `bridge`, `staking`, `unknown`
31
+
32
+ ### `get_supported_chains`
33
+
34
+ Lists supported blockchain networks (currently all EVM-compatible chains: Ethereum, BSC, Polygon, Arbitrum, Optimism, Base, Avalanche, and more).
35
+
36
+ ## Usage
37
+
38
+ ### Claude Desktop
39
+
40
+ Add to your `claude_desktop_config.json`:
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "bytecode-intelligence": {
46
+ "command": "npx",
47
+ "args": ["-y", "bytecode-intelligence-mcp"]
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ ### Other MCP clients
54
+
55
+ ```bash
56
+ npx bytecode-intelligence-mcp
57
+ ```
58
+
59
+ ## API
60
+
61
+ The server calls [https://byteco.xyz](https://byteco.xyz) — no API key required. Rate limit: 10 req/s per IP.
62
+
63
+ ## License
64
+
65
+ MIT
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { z } from "zod";
5
+ const API_BASE = "https://byteco.xyz";
6
+ const SUPPORTED_CHAINS = {
7
+ supported: [
8
+ {
9
+ id: "evm",
10
+ name: "EVM-compatible chains",
11
+ examples: ["Ethereum", "BSC", "Polygon", "Arbitrum", "Optimism", "Base", "Avalanche"],
12
+ },
13
+ ],
14
+ planned: ["solana", "tron"],
15
+ };
16
+ const CONTRACT_FAMILIES = {
17
+ mixer: "Privacy/tumbler contract (e.g. Tornado Cash) — high risk",
18
+ erc20: "Fungible token (ERC-20 standard)",
19
+ erc721: "Non-fungible token (ERC-721 NFT standard)",
20
+ proxy: "Upgradeable proxy contract",
21
+ dex: "Decentralized exchange or AMM",
22
+ bridge: "Cross-chain bridge contract",
23
+ staking: "Staking or rewards distribution contract",
24
+ unknown: "No family matched above confidence threshold",
25
+ };
26
+ const server = new McpServer({
27
+ name: "bytecode-intelligence",
28
+ version: "1.0.0",
29
+ });
30
+ server.tool("analyze_bytecode", `Analyze EVM smart contract bytecode to classify its family and assess risk.
31
+
32
+ Returns a primary label with confidence score, plus ranked scores for all families.
33
+ Families: mixer (Tornado Cash-style), erc20, erc721, proxy, dex, bridge, staking, unknown.
34
+ Confidence below 0.35 returns label "unknown".
35
+
36
+ Accepts any EVM-compatible chain bytecode (Ethereum, BSC, Polygon, Arbitrum, etc.).
37
+ Bytecode can be provided with or without 0x prefix. Constructor code and Solidity metadata are stripped automatically.`, {
38
+ bytecode: z
39
+ .string()
40
+ .min(2)
41
+ .describe("Hex-encoded EVM bytecode (with or without 0x prefix)"),
42
+ blockchain: z
43
+ .string()
44
+ .default("evm")
45
+ .describe("Blockchain network — currently 'evm' for all EVM-compatible chains"),
46
+ }, async ({ bytecode, blockchain }) => {
47
+ let response;
48
+ try {
49
+ response = await fetch(`${API_BASE}/v1/${blockchain}/analyze`, {
50
+ method: "POST",
51
+ headers: { "Content-Type": "application/json" },
52
+ body: JSON.stringify({ bytecode }),
53
+ });
54
+ }
55
+ catch (err) {
56
+ return {
57
+ content: [{ type: "text", text: `Network error: ${String(err)}` }],
58
+ isError: true,
59
+ };
60
+ }
61
+ if (!response.ok) {
62
+ const body = await response.text().catch(() => "");
63
+ return {
64
+ content: [
65
+ {
66
+ type: "text",
67
+ text: `API error ${response.status}: ${body || response.statusText}`,
68
+ },
69
+ ],
70
+ isError: true,
71
+ };
72
+ }
73
+ const result = (await response.json());
74
+ const description = CONTRACT_FAMILIES[result.label] ?? result.label;
75
+ const familyRows = result.families
76
+ .sort((a, b) => b.score - a.score)
77
+ .map((f) => ` ${f.family.padEnd(10)} ${(f.score * 100).toFixed(1)}%`)
78
+ .join("\n");
79
+ const summary = [
80
+ `Label: ${result.label}`,
81
+ `Confidence: ${(result.confidence * 100).toFixed(1)}%`,
82
+ `Meaning: ${description}`,
83
+ "",
84
+ "Family scores:",
85
+ familyRows,
86
+ ].join("\n");
87
+ return {
88
+ content: [{ type: "text", text: summary }],
89
+ };
90
+ });
91
+ server.tool("get_supported_chains", "List the blockchain networks supported for bytecode analysis, with examples of compatible chains.", {}, async () => {
92
+ const lines = [
93
+ "Supported chains:",
94
+ ...SUPPORTED_CHAINS.supported.map((c) => ` ${c.id} — ${c.name}\n Examples: ${c.examples.join(", ")}`),
95
+ "",
96
+ `Planned: ${SUPPORTED_CHAINS.planned.join(", ")}`,
97
+ ];
98
+ return {
99
+ content: [{ type: "text", text: lines.join("\n") }],
100
+ };
101
+ });
102
+ const transport = new StdioServerTransport();
103
+ await server.connect(transport);
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "bytecode-intelligence-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for EVM smart contract bytecode classification — detects mixers, DEXs, tokens, proxies, bridges, and more",
5
+ "keywords": [
6
+ "mcp",
7
+ "blockchain",
8
+ "ethereum",
9
+ "evm",
10
+ "smart-contracts",
11
+ "security",
12
+ "bytecode",
13
+ "defi",
14
+ "web3",
15
+ "model-context-protocol"
16
+ ],
17
+ "author": "Bytecode Intelligence",
18
+ "license": "MIT",
19
+ "homepage": "https://byteco.xyz",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/yoav-stezki/bytecode-intelligence-api"
23
+ },
24
+ "type": "module",
25
+ "main": "dist/index.js",
26
+ "bin": {
27
+ "bytecode-intelligence-mcp": "dist/index.js"
28
+ },
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "scripts": {
33
+ "build": "tsc",
34
+ "start": "node dist/index.js",
35
+ "prepublishOnly": "npm run build"
36
+ },
37
+ "dependencies": {
38
+ "@modelcontextprotocol/sdk": "^1.12.0",
39
+ "zod": "^3.23.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^22.0.0",
43
+ "typescript": "^5.5.0"
44
+ },
45
+ "engines": {
46
+ "node": ">=18"
47
+ }
48
+ }