-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmoke-test.mjs
More file actions
50 lines (40 loc) · 1.33 KB
/
Copy pathsmoke-test.mjs
File metadata and controls
50 lines (40 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const DEFAULT_ADDRESS = process.env.AUGUR_ADDRESS || "0x4200000000000000000000000000000000000006";
function hasFlag(flag) {
return process.argv.includes(flag);
}
async function main() {
const paid = hasFlag("--paid");
const transport = new StdioClientTransport({
command: process.execPath,
args: ["index.mjs"],
cwd: process.cwd(),
env: process.env,
});
const client = new Client({
name: "augur-mcp-smoke-test",
version: "1.0.0",
});
await client.connect(transport);
const tools = await client.listTools();
const toolNames = tools.tools.map(tool => tool.name).sort();
console.log("tools", JSON.stringify(toolNames));
const description = await client.callTool({
name: "describe_augur_service",
arguments: {},
});
console.log("describe_augur_service", JSON.stringify(description.structuredContent));
if (paid) {
const analysis = await client.callTool({
name: "analyze_base_contract_risk",
arguments: { address: DEFAULT_ADDRESS },
});
console.log("analyze_base_contract_risk", JSON.stringify(analysis.structuredContent));
}
await client.close();
}
main().catch(error => {
console.error(error);
process.exit(1);
});