athena-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 +477 -0
- package/install.js +327 -0
- package/mcp/servers.json +100 -0
- package/mcp/tools/README.md +64 -0
- package/mcp/tools/__init__.py +1 -0
- package/mcp/tools/aderyn_runner.py +226 -0
- package/mcp/tools/eas_attest.py +404 -0
- package/mcp/tools/evidence_chain.py +363 -0
- package/mcp/tools/exploit_simulator.py +545 -0
- package/mcp/tools/fuzz_runner.py +440 -0
- package/mcp/tools/gev_analyzer.py +362 -0
- package/mcp/tools/halmos_runner.py +408 -0
- package/mcp/tools/incremental_auditor.py +441 -0
- package/mcp/tools/knowledge_base.py +378 -0
- package/mcp/tools/poc_generator.py +479 -0
- package/mcp/tools/protocol_scanner.py +456 -0
- package/mcp/tools/repair_validator.py +421 -0
- package/mcp/tools/slither_runner.py +221 -0
- package/package.json +52 -0
- package/requirements.txt +20 -0
- package/skills/glm-audit-skill/SKILL.md +73 -0
- package/skills/glm-audit-skill/references/audit-agents/access-control-agent.md +42 -0
- package/skills/glm-audit-skill/references/audit-agents/asymmetry-agent.md +42 -0
- package/skills/glm-audit-skill/references/audit-agents/boundary-agent.md +42 -0
- package/skills/glm-audit-skill/references/audit-agents/economic-security-agent.md +42 -0
- package/skills/glm-audit-skill/references/audit-agents/execution-trace-agent.md +42 -0
- package/skills/glm-audit-skill/references/audit-agents/first-principles-agent.md +42 -0
- package/skills/glm-audit-skill/references/audit-agents/flow-gap-agent.md +38 -0
- package/skills/glm-audit-skill/references/audit-agents/invariant-agent.md +37 -0
- package/skills/glm-audit-skill/references/audit-agents/math-precision-agent.md +37 -0
- package/skills/glm-audit-skill/references/audit-agents/numerical-gap-agent.md +37 -0
- package/skills/glm-audit-skill/references/audit-agents/periphery-agent.md +37 -0
- package/skills/glm-audit-skill/references/audit-agents/shared-rules.md +37 -0
- package/skills/glm-audit-skill/references/audit-agents/trust-gap-agent.md +39 -0
- package/skills/glm-audit-skill/references/judging.md +45 -0
- package/skills/glm-audit-skill/references/report-formatting.md +22 -0
- package/skills/glm-audit-skill/references/senior-auditor-sop.md +34 -0
package/install.js
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* athena-mcp install script
|
|
4
|
+
*
|
|
5
|
+
* Installs Athena MCP tools + Skills for Claude Code.
|
|
6
|
+
* This is a pure installer — the actual tools are Python scripts.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* npx athena-mcp install
|
|
10
|
+
* npx athena-mcp install --skip-deps
|
|
11
|
+
* npx athena-mcp install --skip-claude
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const { execSync, spawn } = require('child_process');
|
|
15
|
+
const fs = require('fs');
|
|
16
|
+
const path = require('path');
|
|
17
|
+
const os = require('os');
|
|
18
|
+
|
|
19
|
+
// ── Config ──────────────────────────────────────────────────────────────────
|
|
20
|
+
const GITHUB_REPO = 'https://github.com/tiyadegure/Athena.git';
|
|
21
|
+
const INSTALL_DIR = path.join(os.homedir(), '.athena');
|
|
22
|
+
const SKILL_NAME = 'athena-audit-skill';
|
|
23
|
+
const SKILL_SOURCE = path.join(INSTALL_DIR, 'skills', 'glm-audit-skill');
|
|
24
|
+
const SKILL_DEST = path.join(os.homedir(), '.claude', 'skills', SKILL_NAME);
|
|
25
|
+
const SERVERS_JSON = path.join(INSTALL_DIR, 'mcp', 'servers.json');
|
|
26
|
+
|
|
27
|
+
// ── Helpers ─────────────────────────────────────────────────────────────────
|
|
28
|
+
const GREEN = '\x1b[32m';
|
|
29
|
+
const RED = '\x1b[31m';
|
|
30
|
+
const YELLOW = '\x1b[33m';
|
|
31
|
+
const CYAN = '\x1b[36m';
|
|
32
|
+
const BOLD = '\x1b[1m';
|
|
33
|
+
const DIM = '\x1b[2m';
|
|
34
|
+
const RESET = '\x1b[0m';
|
|
35
|
+
|
|
36
|
+
function log(msg) { console.log(`${GREEN}✓${RESET} ${msg}`); }
|
|
37
|
+
function warn(msg) { console.log(`${YELLOW}⚠${RESET} ${msg}`); }
|
|
38
|
+
function error(msg) { console.log(`${RED}✗${RESET} ${msg}`); }
|
|
39
|
+
function info(msg) { console.log(`${CYAN}ℹ${RESET} ${msg}`); }
|
|
40
|
+
function header(msg) { console.log(`\n${BOLD}${msg}${RESET}`); }
|
|
41
|
+
|
|
42
|
+
function run(cmd, opts = {}) {
|
|
43
|
+
try {
|
|
44
|
+
const result = execSync(cmd, { encoding: 'utf-8', stdio: opts.silent ? 'pipe' : 'inherit', ...opts });
|
|
45
|
+
return result ? result.trim() : '';
|
|
46
|
+
} catch (e) {
|
|
47
|
+
if (!opts.optional) throw e;
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function commandExists(cmd) {
|
|
53
|
+
try {
|
|
54
|
+
execSync(os.platform() === 'win32' ? `where ${cmd}` : `command -v ${cmd}`, { stdio: 'pipe' });
|
|
55
|
+
return true;
|
|
56
|
+
} catch { return false; }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ── Parse args ──────────────────────────────────────────────────────────────
|
|
60
|
+
const args = process.argv.slice(2);
|
|
61
|
+
const skipDeps = args.includes('--skip-deps');
|
|
62
|
+
const skipClaude = args.includes('--skip-claude');
|
|
63
|
+
const skipSystem = args.includes('--skip-system');
|
|
64
|
+
const help = args.includes('--help') || args.includes('-h');
|
|
65
|
+
|
|
66
|
+
if (help) {
|
|
67
|
+
console.log(`
|
|
68
|
+
${BOLD}athena-mcp install${RESET}
|
|
69
|
+
|
|
70
|
+
Installs Athena MCP tools + Skills for Claude Code.
|
|
71
|
+
|
|
72
|
+
${BOLD}Options:${RESET}
|
|
73
|
+
--skip-deps Skip Python dependency installation
|
|
74
|
+
--skip-system Skip system tool installation (slither, aderyn, foundry)
|
|
75
|
+
--skip-claude Skip Claude Code MCP configuration
|
|
76
|
+
-h, --help Show this help
|
|
77
|
+
|
|
78
|
+
${BOLD}What gets installed:${RESET}
|
|
79
|
+
1. Athena repo → ~/.athena/
|
|
80
|
+
2. Python deps from requirements.txt
|
|
81
|
+
3. System tools: slither, aderyn, foundry
|
|
82
|
+
4. Skill files → ~/.claude/skills/athena-audit-skill/
|
|
83
|
+
5. MCP server config for Claude Code
|
|
84
|
+
`);
|
|
85
|
+
process.exit(0);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// ── Banner ──────────────────────────────────────────────────────────────────
|
|
89
|
+
console.log(`
|
|
90
|
+
${CYAN}${BOLD}
|
|
91
|
+
╔═══════════════════════════════════════╗
|
|
92
|
+
║ Athena MCP Installer ║
|
|
93
|
+
║ Smart Contract Security Audit Tools ║
|
|
94
|
+
╚═══════════════════════════════════════╝${RESET}
|
|
95
|
+
`);
|
|
96
|
+
|
|
97
|
+
// ── Step 1: Clone / update repo ─────────────────────────────────────────────
|
|
98
|
+
header('Step 1/5: Clone Athena repository');
|
|
99
|
+
if (fs.existsSync(path.join(INSTALL_DIR, '.git'))) {
|
|
100
|
+
info('Athena repo already exists, pulling latest...');
|
|
101
|
+
run(`cd ${INSTALL_DIR} && git pull --ff-only`, { optional: true });
|
|
102
|
+
log('Repository updated');
|
|
103
|
+
} else {
|
|
104
|
+
info(`Cloning to ${INSTALL_DIR}...`);
|
|
105
|
+
run(`git clone --depth 1 ${GITHUB_REPO} ${INSTALL_DIR}`);
|
|
106
|
+
log('Repository cloned');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ── Step 2: Python dependencies ─────────────────────────────────────────────
|
|
110
|
+
header('Step 2/5: Install Python dependencies');
|
|
111
|
+
if (skipDeps) {
|
|
112
|
+
warn('Skipping Python deps (--skip-deps)');
|
|
113
|
+
} else {
|
|
114
|
+
if (!commandExists('python3')) {
|
|
115
|
+
error('python3 not found. Please install Python 3.8+');
|
|
116
|
+
process.exit(1);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const pyVersion = run('python3 --version', { silent: true });
|
|
120
|
+
info(`Found ${pyVersion}`);
|
|
121
|
+
|
|
122
|
+
// Try pip3 first, then pip
|
|
123
|
+
const pip = commandExists('pip3') ? 'pip3' : commandExists('pip') ? 'pip' : null;
|
|
124
|
+
const reqFile = path.join(INSTALL_DIR, 'requirements.txt');
|
|
125
|
+
|
|
126
|
+
// Check if we need --break-system-packages (PEP 668)
|
|
127
|
+
const needsBreak = run('python3 -c "import sys; print(1 if hasattr(sys, \'base_prefix\') and sys.base_prefix != sys.prefix else 0)" 2>/dev/null || echo 0', { silent: true });
|
|
128
|
+
const breakFlag = ' --break-system-packages';
|
|
129
|
+
|
|
130
|
+
if (!pip) {
|
|
131
|
+
warn('pip not found, trying python3 -m pip...');
|
|
132
|
+
const result = run(`python3 -m pip install -r ${reqFile}${breakFlag}`, { optional: true, silent: true });
|
|
133
|
+
if (result === null) {
|
|
134
|
+
error('Python deps failed. Try: python3 -m venv ~/.athena/venv && source ~/.athena/venv/bin/activate && pip install -r requirements.txt');
|
|
135
|
+
} else {
|
|
136
|
+
log('Python dependencies installed');
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
const result = run(`${pip} install -r ${reqFile}${breakFlag}`, { optional: true, silent: true });
|
|
140
|
+
if (result === null) {
|
|
141
|
+
error('Python deps failed. Try: python3 -m venv ~/.athena/venv && source ~/.athena/venv/bin/activate && pip install -r requirements.txt');
|
|
142
|
+
} else {
|
|
143
|
+
log('Python dependencies installed');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// ── Step 3: System tools ────────────────────────────────────────────────────
|
|
149
|
+
header('Step 3/5: Install system tools (slither, aderyn, foundry)');
|
|
150
|
+
if (skipSystem) {
|
|
151
|
+
warn('Skipping system tools (--skip-system)');
|
|
152
|
+
} else {
|
|
153
|
+
// Slither
|
|
154
|
+
if (commandExists('slither')) {
|
|
155
|
+
log('Slither already installed');
|
|
156
|
+
} else {
|
|
157
|
+
info('Installing Slither...');
|
|
158
|
+
const pip = commandExists('pip3') ? 'pip3' : 'pip';
|
|
159
|
+
run(`${pip} install slither-analyzer`, { optional: true });
|
|
160
|
+
if (commandExists('slither')) log('Slither installed');
|
|
161
|
+
else warn('Slither install failed — install manually: pip install slither-analyzer');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Aderyn
|
|
165
|
+
if (commandExists('aderyn')) {
|
|
166
|
+
log('Aderyn already installed');
|
|
167
|
+
} else if (commandExists('cargo')) {
|
|
168
|
+
info('Installing Aderyn via cargo...');
|
|
169
|
+
run('cargo install aderyn', { optional: true });
|
|
170
|
+
if (commandExists('aderyn')) log('Aderyn installed');
|
|
171
|
+
else warn('Aderyn install failed — install manually: cargo install aderyn');
|
|
172
|
+
} else {
|
|
173
|
+
warn('cargo not found, skipping Aderyn. Install Rust first: https://rustup.rs');
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Foundry
|
|
177
|
+
if (commandExists('forge')) {
|
|
178
|
+
log('Foundry already installed');
|
|
179
|
+
} else {
|
|
180
|
+
info('Installing Foundry...');
|
|
181
|
+
run('curl -L https://foundry.paradigm.xyz | bash', { optional: true, stdio: 'pipe' });
|
|
182
|
+
// Source the env
|
|
183
|
+
const foundryBin = path.join(os.homedir(), '.foundry', 'bin');
|
|
184
|
+
if (fs.existsSync(foundryBin)) {
|
|
185
|
+
process.env.PATH = `${foundryBin}:${process.env.PATH}`;
|
|
186
|
+
}
|
|
187
|
+
run(`${foundryBin}/foundryup`, { optional: true });
|
|
188
|
+
if (commandExists('forge') || fs.existsSync(path.join(foundryBin, 'forge'))) {
|
|
189
|
+
log('Foundry installed');
|
|
190
|
+
} else {
|
|
191
|
+
warn('Foundry install failed — install manually: curl -L https://foundry.paradigm.xyz | bash');
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// ── Step 4: Copy Skill files ────────────────────────────────────────────────
|
|
197
|
+
header('Step 4/5: Install audit skill');
|
|
198
|
+
if (fs.existsSync(SKILL_SOURCE)) {
|
|
199
|
+
// Create destination
|
|
200
|
+
fs.mkdirSync(path.dirname(SKILL_DEST), { recursive: true });
|
|
201
|
+
|
|
202
|
+
// Copy recursively
|
|
203
|
+
function copyDir(src, dest) {
|
|
204
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
205
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
206
|
+
const srcPath = path.join(src, entry.name);
|
|
207
|
+
const destPath = path.join(dest, entry.name);
|
|
208
|
+
if (entry.isDirectory()) {
|
|
209
|
+
copyDir(srcPath, destPath);
|
|
210
|
+
} else {
|
|
211
|
+
fs.copyFileSync(srcPath, destPath);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
copyDir(SKILL_SOURCE, SKILL_DEST);
|
|
217
|
+
log(`Skill installed to ${SKILL_DEST}`);
|
|
218
|
+
} else {
|
|
219
|
+
warn(`Skill source not found at ${SKILL_SOURCE}`);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// ── Step 5: Configure Claude Code MCP ───────────────────────────────────────
|
|
223
|
+
header('Step 5/5: Configure Claude Code MCP servers');
|
|
224
|
+
if (skipClaude) {
|
|
225
|
+
warn('Skipping Claude Code config (--skip-claude)');
|
|
226
|
+
} else {
|
|
227
|
+
// Read servers.json
|
|
228
|
+
if (fs.existsSync(SERVERS_JSON)) {
|
|
229
|
+
const config = JSON.parse(fs.readFileSync(SERVERS_JSON, 'utf-8'));
|
|
230
|
+
const hasClaudeCmd = commandExists('claude');
|
|
231
|
+
|
|
232
|
+
if (hasClaudeCmd) {
|
|
233
|
+
info('Found claude CLI, registering MCP servers...');
|
|
234
|
+
for (const server of config.servers) {
|
|
235
|
+
const toolPath = path.join(INSTALL_DIR, server.args[0]);
|
|
236
|
+
try {
|
|
237
|
+
// claude mcp add <name> -- <command> <args...>
|
|
238
|
+
const cmd = `claude mcp add athena-${server.name} -- ${server.command} ${toolPath}`;
|
|
239
|
+
run(cmd, { silent: true, optional: true });
|
|
240
|
+
log(`Registered: athena-${server.name}`);
|
|
241
|
+
} catch (e) {
|
|
242
|
+
warn(`Failed to register athena-${server.name}: ${e.message}`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
} else {
|
|
246
|
+
// Generate settings.json snippet
|
|
247
|
+
info('claude CLI not found, generating config snippet...');
|
|
248
|
+
|
|
249
|
+
const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
|
|
250
|
+
const mcpServers = {};
|
|
251
|
+
|
|
252
|
+
for (const server of config.servers) {
|
|
253
|
+
const toolPath = path.join(INSTALL_DIR, server.args[0]);
|
|
254
|
+
mcpServers[`athena-${server.name}`] = {
|
|
255
|
+
command: server.command,
|
|
256
|
+
args: [toolPath],
|
|
257
|
+
env: server.env || {}
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const snippet = {
|
|
262
|
+
mcpServers
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
const snippetPath = path.join(INSTALL_DIR, 'claude-mcp-config.json');
|
|
266
|
+
fs.writeFileSync(snippetPath, JSON.stringify(snippet, null, 2));
|
|
267
|
+
|
|
268
|
+
console.log(`
|
|
269
|
+
${YELLOW}${BOLD}Manual Configuration Required${RESET}
|
|
270
|
+
${DIM}${'─'.repeat(50)}${RESET}
|
|
271
|
+
|
|
272
|
+
Claude CLI not found. Add this to ${BOLD}~/.claude/settings.json${RESET}:
|
|
273
|
+
|
|
274
|
+
${CYAN}${JSON.stringify(snippet, null, 2)}${RESET}
|
|
275
|
+
|
|
276
|
+
Or install the Claude CLI and re-run:
|
|
277
|
+
${DIM} npx athena-mcp install${RESET}
|
|
278
|
+
|
|
279
|
+
Config saved to: ${DIM}${snippetPath}${RESET}
|
|
280
|
+
`);
|
|
281
|
+
}
|
|
282
|
+
} else {
|
|
283
|
+
warn('servers.json not found, skipping MCP configuration');
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// ── Summary ─────────────────────────────────────────────────────────────────
|
|
288
|
+
console.log(`
|
|
289
|
+
${GREEN}${BOLD}
|
|
290
|
+
╔═══════════════════════════════════════╗
|
|
291
|
+
║ Installation Complete! ✨ ║
|
|
292
|
+
╚═══════════════════════════════════════╝${RESET}
|
|
293
|
+
|
|
294
|
+
${BOLD}Installed:${RESET}
|
|
295
|
+
📁 Athena repo → ${DIM}${INSTALL_DIR}${RESET}
|
|
296
|
+
🔧 MCP tools → ${DIM}${INSTALL_DIR}/mcp/tools/${RESET} (13 tools)
|
|
297
|
+
📚 Audit skill → ${DIM}${SKILL_DEST}${RESET}
|
|
298
|
+
⚙️ Python deps → ${DIM}requirements.txt${RESET}
|
|
299
|
+
|
|
300
|
+
${BOLD}Quick Start:${RESET}
|
|
301
|
+
|
|
302
|
+
${CYAN}# Audit a Solidity contract${RESET}
|
|
303
|
+
claude "audit contracts/MyToken.sol"
|
|
304
|
+
|
|
305
|
+
${CYAN}# Run Slither analysis directly${RESET}
|
|
306
|
+
python3 ${INSTALL_DIR}/mcp/tools/slither_runner.py
|
|
307
|
+
|
|
308
|
+
${CYAN}# Full audit workflow${RESET}
|
|
309
|
+
claude "read ${INSTALL_DIR}/AGENT-WORKFLOW-FINAL.md and audit this project"
|
|
310
|
+
|
|
311
|
+
${BOLD}MCP Tools:${RESET}
|
|
312
|
+
• slither — Static analysis (Trail of Bits)
|
|
313
|
+
• aderyn — Static analysis (Cyfrin, Rust-based)
|
|
314
|
+
• poc-generator — PoC exploit test generation
|
|
315
|
+
• fuzz-runner — Foundry fuzz/invariant tests
|
|
316
|
+
• knowledge-base — RAG vulnerability database
|
|
317
|
+
• eas-attest — On-chain EAS attestation
|
|
318
|
+
• exploit-simulator — Attack simulation
|
|
319
|
+
• evidence-chain — Merkle audit trail
|
|
320
|
+
• halmos — Formal verification
|
|
321
|
+
• protocol-scanner — Protocol-level scanning
|
|
322
|
+
• repair-validator — Fix validation
|
|
323
|
+
• incremental-auditor — Diff-based auditing
|
|
324
|
+
• gev-analyzer — Governance/Economic/Value analysis
|
|
325
|
+
|
|
326
|
+
${DIM}Docs: https://github.com/tiyadegure/Athena${RESET}
|
|
327
|
+
`);
|
package/mcp/servers.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"servers": [
|
|
3
|
+
{
|
|
4
|
+
"name": "slither",
|
|
5
|
+
"command": "python3",
|
|
6
|
+
"args": ["mcp/tools/slither_runner.py"],
|
|
7
|
+
"description": "Slither static analysis for Solidity contracts",
|
|
8
|
+
"env": {}
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "aderyn",
|
|
12
|
+
"command": "python3",
|
|
13
|
+
"args": ["mcp/tools/aderyn_runner.py"],
|
|
14
|
+
"description": "Aderyn static analysis (Rust-based) for Solidity projects",
|
|
15
|
+
"env": {}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "poc-generator",
|
|
19
|
+
"command": "python3",
|
|
20
|
+
"args": ["mcp/tools/poc_generator.py"],
|
|
21
|
+
"description": "Generate Foundry PoC exploit tests for vulnerabilities",
|
|
22
|
+
"env": {}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "fuzz-runner",
|
|
26
|
+
"command": "python3",
|
|
27
|
+
"args": ["mcp/tools/fuzz_runner.py"],
|
|
28
|
+
"description": "Run Foundry fuzz and invariant tests",
|
|
29
|
+
"env": {}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "knowledge-base",
|
|
33
|
+
"command": "python3",
|
|
34
|
+
"args": ["mcp/tools/knowledge_base.py"],
|
|
35
|
+
"description": "Query vulnerability knowledge base (ChromaDB RAG)",
|
|
36
|
+
"env": {
|
|
37
|
+
"KNOWLEDGE_PATH": "data/knowledge"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "eas-attest",
|
|
42
|
+
"command": "python3",
|
|
43
|
+
"args": ["mcp/tools/eas_attest.py"],
|
|
44
|
+
"description": "Submit EAS attestation on Sepolia testnet",
|
|
45
|
+
"env": {
|
|
46
|
+
"SEPOLIA_RPC_URL": "https://sepolia.drpc.org",
|
|
47
|
+
"EAS_CONTRACT_ADDRESS": "0xC2679fBD37d54388Ce493F1DB75320D236e1815e"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "exploit-simulator",
|
|
52
|
+
"command": "python3",
|
|
53
|
+
"args": ["mcp/tools/exploit_simulator.py"],
|
|
54
|
+
"description": "Simulate attack scenarios against smart contracts",
|
|
55
|
+
"env": {}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "evidence-chain",
|
|
59
|
+
"command": "python3",
|
|
60
|
+
"args": ["mcp/tools/evidence_chain.py"],
|
|
61
|
+
"description": "Merkle-based audit evidence chain for verifiable audit trails",
|
|
62
|
+
"env": {}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "halmos-runner",
|
|
66
|
+
"command": "python3",
|
|
67
|
+
"args": ["mcp/tools/halmos_runner.py"],
|
|
68
|
+
"description": "Symbolic execution and formal verification via Halmos",
|
|
69
|
+
"env": {}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "protocol-scanner",
|
|
73
|
+
"command": "python3",
|
|
74
|
+
"args": ["mcp/tools/protocol_scanner.py"],
|
|
75
|
+
"description": "Protocol-level dependency and interaction scanning",
|
|
76
|
+
"env": {}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "repair-validator",
|
|
80
|
+
"command": "python3",
|
|
81
|
+
"args": ["mcp/tools/repair_validator.py"],
|
|
82
|
+
"description": "Validate that vulnerability fixes are correct and complete",
|
|
83
|
+
"env": {}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "incremental-auditor",
|
|
87
|
+
"command": "python3",
|
|
88
|
+
"args": ["mcp/tools/incremental_auditor.py"],
|
|
89
|
+
"description": "Incremental audit for contract updates and diffs",
|
|
90
|
+
"env": {}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "gev-analyzer",
|
|
94
|
+
"command": "python3",
|
|
95
|
+
"args": ["mcp/tools/gev_analyzer.py"],
|
|
96
|
+
"description": "Governance, Economic, and Value analysis for DeFi protocols",
|
|
97
|
+
"env": {}
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# MCP Tools
|
|
2
|
+
|
|
3
|
+
Standalone MCP (Model Context Protocol) tool servers for Athena. Each tool runs as an independent process communicating via JSON-RPC over stdio.
|
|
4
|
+
|
|
5
|
+
## Tools (13)
|
|
6
|
+
|
|
7
|
+
| Tool | Script | Description |
|
|
8
|
+
|------|--------|-------------|
|
|
9
|
+
| Slither | `slither_runner.py` | Static analysis via Slither (Trail of Bits) |
|
|
10
|
+
| Aderyn | `aderyn_runner.py` | Static analysis via Aderyn (Rust-based, Cyfrin) |
|
|
11
|
+
| PoC Generator | `poc_generator.py` | Generates Foundry exploit test contracts |
|
|
12
|
+
| Fuzz Runner | `fuzz_runner.py` | Runs Foundry fuzz tests with A1 signal extraction |
|
|
13
|
+
| Knowledge Base | `knowledge_base.py` | ChromaDB RAG queries for vulnerability patterns |
|
|
14
|
+
| EAS Attestation | `eas_attest.py` | On-chain audit attestation via EAS on Sepolia |
|
|
15
|
+
| Exploit Simulator | `exploit_simulator.py` | Simulates attack scenarios against contracts |
|
|
16
|
+
| Evidence Chain | `evidence_chain.py` | Merkle-based audit evidence chain |
|
|
17
|
+
| Halmos | `halmos_runner.py` | Symbolic execution / formal verification via Halmos |
|
|
18
|
+
| Protocol Scanner | `protocol_scanner.py` | Protocol-level dependency and interaction scanning |
|
|
19
|
+
| Repair Validator | `repair_validator.py` | Validates that vulnerability fixes are correct |
|
|
20
|
+
| Incremental Auditor | `incremental_auditor.py` | Incremental audit for contract updates |
|
|
21
|
+
| GEV Analyzer | `gev_analyzer.py` | Governance/Economic/Value analysis |
|
|
22
|
+
|
|
23
|
+
## Protocol
|
|
24
|
+
|
|
25
|
+
Each tool implements MCP JSON-RPC over stdio:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "slither_analyze", "arguments": {"contract_path": "./src/Token.sol"}}}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Environment Variables
|
|
32
|
+
|
|
33
|
+
| Variable | Tool | Description |
|
|
34
|
+
|----------|------|-------------|
|
|
35
|
+
| `OPENAI_API_BASE` | poc_generator | LLM API endpoint for PoC generation |
|
|
36
|
+
| `OPENAI_API_KEY` | poc_generator | LLM API key |
|
|
37
|
+
| `LLM_MODEL` | poc_generator | Model name (default: gpt-4) |
|
|
38
|
+
| `CHROMA_DB_PATH` | knowledge_base | ChromaDB storage path |
|
|
39
|
+
| `SEPOLIA_PRIVATE_KEY` | eas_attest | Private key for on-chain attestation |
|
|
40
|
+
| `SEPOLIA_RPC_URL` | eas_attest | Sepolia RPC endpoint |
|
|
41
|
+
|
|
42
|
+
## Running
|
|
43
|
+
|
|
44
|
+
Each tool can be run standalone:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | python3 slither_runner.py
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Dependencies
|
|
51
|
+
|
|
52
|
+
- **slither_runner.py**: `pip install slither-analyzer`
|
|
53
|
+
- **aderyn_runner.py**: `cargo install aderyn`
|
|
54
|
+
- **poc_generator.py**: `pip install aiohttp` (optional, for LLM mode)
|
|
55
|
+
- **fuzz_runner.py**: `forge` (Foundry)
|
|
56
|
+
- **knowledge_base.py**: `pip install chromadb sentence-transformers` (optional, has fallback)
|
|
57
|
+
- **eas_attest.py**: `pip install web3 eth-account` (optional, has mock mode)
|
|
58
|
+
- **exploit_simulator.py**: `pip install web3 aiohttp`
|
|
59
|
+
- **evidence_chain.py**: `pip install web3`
|
|
60
|
+
- **halmos_runner.py**: `pip install halmos` (requires Foundry)
|
|
61
|
+
- **protocol_scanner.py**: `pip install web3 aiohttp`
|
|
62
|
+
- **repair_validator.py**: `pip install slither-analyzer`
|
|
63
|
+
- **incremental_auditor.py**: `pip install chromadb`
|
|
64
|
+
- **gev_analyzer.py**: `pip install web3 aiohttp`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# MCP Tools - Standalone wrappers for audit toolchain
|