autonomy-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 +69 -0
- package/index.js +122 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# @autonomy/mcp
|
|
2
|
+
|
|
3
|
+
MCP Server for [theautonomy.ai](https://theautonomy.ai) - Multi-chain RPC and AI agent infrastructure.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @autonomy/mcp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage with Claude Desktop
|
|
12
|
+
|
|
13
|
+
Add to your Claude Desktop config (`~/.config/claude/mcp.json`):
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"autonomy": {
|
|
19
|
+
"command": "autonomy-mcp",
|
|
20
|
+
"env": {
|
|
21
|
+
"AUTONOMY_KEY": "your-api-key"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Available Tools
|
|
29
|
+
|
|
30
|
+
### Data
|
|
31
|
+
- `weather_get` - Get weather for a city
|
|
32
|
+
- `crypto_price` - Get cryptocurrency price
|
|
33
|
+
|
|
34
|
+
### EVM Chains (23 chains)
|
|
35
|
+
- `chain_balance` - Get wallet balance
|
|
36
|
+
- `chain_gas` - Get gas price
|
|
37
|
+
- `chain_block` - Get latest block
|
|
38
|
+
|
|
39
|
+
### Monopoly Chains (exclusive access)
|
|
40
|
+
- `kaspa_balance`, `kaspa_price` - Kaspa
|
|
41
|
+
- `tao_price`, `tao_subnets` - Bittensor TAO
|
|
42
|
+
- `sui_balance`, `sui_price` - SUI
|
|
43
|
+
- `icp_price` - Internet Computer
|
|
44
|
+
- `ergo_balance` - Ergo
|
|
45
|
+
- `radix_balance` - Radix
|
|
46
|
+
- `alephium_balance` - Alephium
|
|
47
|
+
- `flux_balance` - Flux
|
|
48
|
+
|
|
49
|
+
### Platform
|
|
50
|
+
- `plans_list` - List subscription plans
|
|
51
|
+
- `chains_list` - List all 31 supported chains
|
|
52
|
+
|
|
53
|
+
## Pricing
|
|
54
|
+
|
|
55
|
+
- **Free**: 10 calls (preview)
|
|
56
|
+
- **$0.99/mo**: 500K EVM + 100 monopoly/day
|
|
57
|
+
- **$4.99/mo**: 2M calls all chains
|
|
58
|
+
- **$19.99/mo**: 10M calls
|
|
59
|
+
- **$49.99/mo**: 50M calls
|
|
60
|
+
- **$99.99/mo**: Unlimited
|
|
61
|
+
|
|
62
|
+
## Environment Variables
|
|
63
|
+
|
|
64
|
+
- `AUTONOMY_KEY` - Your API key (get one at https://api.theautonomy.ai/v1/keys/create)
|
|
65
|
+
- `AUTONOMY_API_URL` - API base URL (default: https://api.theautonomy.ai)
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT
|
package/index.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const API_BASE = process.env.AUTONOMY_API_URL || 'https://api.theautonomy.ai';
|
|
4
|
+
const API_KEY = process.env.AUTONOMY_KEY || '';
|
|
5
|
+
|
|
6
|
+
const tools = [
|
|
7
|
+
{ name: 'weather_get', description: 'Get weather for a city', params: ['city'] },
|
|
8
|
+
{ name: 'crypto_price', description: 'Get cryptocurrency price', params: ['symbol'] },
|
|
9
|
+
{ name: 'chain_balance', description: 'Get wallet balance on EVM chain', params: ['chainId', 'address'] },
|
|
10
|
+
{ name: 'chain_gas', description: 'Get gas price on EVM chain', params: ['chainId'] },
|
|
11
|
+
{ name: 'chain_block', description: 'Get latest block on EVM chain', params: ['chainId'] },
|
|
12
|
+
{ name: 'kaspa_balance', description: 'Get Kaspa wallet balance', params: ['address'] },
|
|
13
|
+
{ name: 'kaspa_price', description: 'Get Kaspa price', params: [] },
|
|
14
|
+
{ name: 'tao_price', description: 'Get Bittensor TAO price', params: [] },
|
|
15
|
+
{ name: 'tao_subnets', description: 'List Bittensor subnets', params: [] },
|
|
16
|
+
{ name: 'sui_balance', description: 'Get SUI wallet balance', params: ['address'] },
|
|
17
|
+
{ name: 'sui_price', description: 'Get SUI price', params: [] },
|
|
18
|
+
{ name: 'icp_price', description: 'Get ICP price', params: [] },
|
|
19
|
+
{ name: 'ergo_balance', description: 'Get Ergo wallet balance', params: ['address'] },
|
|
20
|
+
{ name: 'radix_balance', description: 'Get Radix wallet balance', params: ['address'] },
|
|
21
|
+
{ name: 'alephium_balance', description: 'Get Alephium wallet balance', params: ['address'] },
|
|
22
|
+
{ name: 'flux_balance', description: 'Get Flux wallet balance', params: ['address'] },
|
|
23
|
+
{ name: 'plans_list', description: 'List subscription plans', params: [] },
|
|
24
|
+
{ name: 'chains_list', description: 'List all supported chains', params: [] }
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
async function apiCall(path) {
|
|
28
|
+
try {
|
|
29
|
+
const headers = { 'Accept': 'application/json' };
|
|
30
|
+
if (API_KEY) headers['Authorization'] = `Bearer ${API_KEY}`;
|
|
31
|
+
const res = await fetch(`${API_BASE}${path}`, { headers });
|
|
32
|
+
return await res.json();
|
|
33
|
+
} catch {
|
|
34
|
+
return { error: 'Request failed' };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function executeTool(name, args) {
|
|
39
|
+
const routes = {
|
|
40
|
+
weather_get: () => apiCall(`/api/data/weather/${encodeURIComponent(args.city)}`),
|
|
41
|
+
crypto_price: () => apiCall(`/api/data/crypto/${encodeURIComponent(args.symbol)}`),
|
|
42
|
+
chain_balance: () => apiCall(`/api/chain/balance/${args.chainId}/${args.address}`),
|
|
43
|
+
chain_gas: () => apiCall(`/api/chain/gas/${args.chainId}`),
|
|
44
|
+
chain_block: () => apiCall(`/api/chain/block/${args.chainId}`),
|
|
45
|
+
kaspa_balance: () => apiCall(`/v1/kaspa/balance/${args.address}`),
|
|
46
|
+
kaspa_price: () => apiCall('/v1/kaspa/price'),
|
|
47
|
+
tao_price: () => apiCall('/v1/tao/price'),
|
|
48
|
+
tao_subnets: () => apiCall('/v1/tao/subnets'),
|
|
49
|
+
sui_balance: () => apiCall(`/v1/sui/balance/${args.address}`),
|
|
50
|
+
sui_price: () => apiCall('/v1/sui/price'),
|
|
51
|
+
icp_price: () => apiCall('/v1/icp/price'),
|
|
52
|
+
ergo_balance: () => apiCall(`/v1/ergo/balance/${args.address}`),
|
|
53
|
+
radix_balance: () => apiCall(`/v1/radix/balance/${args.address}`),
|
|
54
|
+
alephium_balance: () => apiCall(`/v1/alephium/balance/${args.address}`),
|
|
55
|
+
flux_balance: () => apiCall(`/v1/flux/balance/${args.address}`),
|
|
56
|
+
plans_list: () => apiCall('/v1/plans'),
|
|
57
|
+
chains_list: () => apiCall('/v1/chains')
|
|
58
|
+
};
|
|
59
|
+
return routes[name] ? routes[name]() : { error: 'Unknown tool' };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function sendResponse(id, result) {
|
|
63
|
+
process.stdout.write(JSON.stringify({ jsonrpc: '2.0', id, result }) + '\n');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function sendError(id, code, message) {
|
|
67
|
+
process.stdout.write(JSON.stringify({ jsonrpc: '2.0', id, error: { code, message } }) + '\n');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function handleRequest(request) {
|
|
71
|
+
const { id, method, params } = request;
|
|
72
|
+
|
|
73
|
+
if (method === 'initialize') {
|
|
74
|
+
return sendResponse(id, {
|
|
75
|
+
protocolVersion: '2024-11-05',
|
|
76
|
+
serverInfo: { name: '@autonomy/mcp', version: '1.0.0' },
|
|
77
|
+
capabilities: { tools: {} }
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (method === 'tools/list') {
|
|
82
|
+
return sendResponse(id, {
|
|
83
|
+
tools: tools.map(t => ({
|
|
84
|
+
name: t.name,
|
|
85
|
+
description: t.description,
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: 'object',
|
|
88
|
+
properties: Object.fromEntries(t.params.map(p => [p, { type: 'string' }])),
|
|
89
|
+
required: t.params
|
|
90
|
+
}
|
|
91
|
+
}))
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (method === 'tools/call') {
|
|
96
|
+
const { name, arguments: args } = params;
|
|
97
|
+
const result = await executeTool(name, args || {});
|
|
98
|
+
return sendResponse(id, {
|
|
99
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (method === 'notifications/initialized') return;
|
|
104
|
+
|
|
105
|
+
sendError(id, -32601, 'Method not found');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
let buffer = '';
|
|
109
|
+
process.stdin.setEncoding('utf8');
|
|
110
|
+
process.stdin.on('data', async (chunk) => {
|
|
111
|
+
buffer += chunk;
|
|
112
|
+
const lines = buffer.split('\n');
|
|
113
|
+
buffer = lines.pop() || '';
|
|
114
|
+
for (const line of lines) {
|
|
115
|
+
if (line.trim()) {
|
|
116
|
+
try { await handleRequest(JSON.parse(line)); }
|
|
117
|
+
catch { sendError(null, -32700, 'Parse error'); }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
process.stderr.write('@autonomy/mcp v1.0.0 | https://theautonomy.ai\n');
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "autonomy-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP Server for theautonomy.ai - Multi-chain RPC and AI agent infrastructure",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"autonomy-mcp": "./index.js"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"mcp",
|
|
12
|
+
"claude",
|
|
13
|
+
"ai",
|
|
14
|
+
"blockchain",
|
|
15
|
+
"rpc",
|
|
16
|
+
"pulsechain",
|
|
17
|
+
"kaspa",
|
|
18
|
+
"bittensor",
|
|
19
|
+
"sui",
|
|
20
|
+
"multi-chain"
|
|
21
|
+
],
|
|
22
|
+
"author": "theautonomy.ai",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/SleepyJP/autonomy-mcp.git"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://theautonomy.ai",
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18.0.0"
|
|
31
|
+
}
|
|
32
|
+
}
|