@one-source/api-mcp 5.0.0 → 5.1.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/LICENSE +21 -21
- package/README.md +128 -125
- package/README.npm.md +128 -125
- package/README.repo.md +175 -172
- package/dist/tools/chain/block-by-number.d.ts +6 -0
- package/dist/tools/chain/block-by-number.d.ts.map +1 -0
- package/dist/tools/chain/block-by-number.js +21 -0
- package/dist/tools/chain/block-by-number.js.map +1 -0
- package/dist/tools/chain/block-number.d.ts +6 -0
- package/dist/tools/chain/block-number.d.ts.map +1 -0
- package/dist/tools/chain/block-number.js +18 -0
- package/dist/tools/chain/block-number.js.map +1 -0
- package/dist/tools/chain/chain-id.d.ts +6 -0
- package/dist/tools/chain/chain-id.d.ts.map +1 -0
- package/dist/tools/chain/chain-id.js +18 -0
- package/dist/tools/chain/chain-id.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +7 -1
- package/dist/tools/index.js.map +1 -1
- package/package.json +89 -89
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 BlockParty
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BlockParty
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,125 +1,128 @@
|
|
|
1
|
-
# onesource-api-mcp
|
|
2
|
-
|
|
3
|
-
MCP server for OneSource blockchain data. 22 named tools for balances, NFTs, transactions, events, and live chain queries via API key or x402 micropayments.
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
npx onesource-api-mcp
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
# Claude Code
|
|
13
|
-
claude mcp add onesource-api -- npx onesource-api-mcp
|
|
14
|
-
|
|
15
|
-
# Claude Desktop / Cursor — add to MCP config:
|
|
16
|
-
{
|
|
17
|
-
"mcpServers": {
|
|
18
|
-
"onesource-api": {
|
|
19
|
-
"command": "npx",
|
|
20
|
-
"args": ["-y", "onesource-api-mcp"]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Tools (22)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### Live Chain Data (12 tools)
|
|
30
|
-
|
|
31
|
-
| Tool | Description |
|
|
32
|
-
|------|-------------|
|
|
33
|
-
| `1s_allowance_live` | ERC20 allowance check |
|
|
34
|
-
| `1s_contract_info_live` | Contract type detection via ERC165 |
|
|
35
|
-
| `1s_erc1155_balance_live` | ERC1155 balance via RPC |
|
|
36
|
-
| `1s_erc20_balance_live` | ERC20 balance via balanceOf |
|
|
37
|
-
| `1s_erc20_transfers_live` | ERC20 Transfer logs via eth_getLogs |
|
|
38
|
-
| `1s_erc721_tokens_live` | ERC721 token enumeration |
|
|
39
|
-
| `1s_events_live` | Event logs via eth_getLogs |
|
|
40
|
-
| `1s_multi_balance_live` | ETH + multiple ERC20 balances |
|
|
41
|
-
| `1s_nft_metadata_live` | NFT metadata via tokenURI |
|
|
42
|
-
| `1s_nft_owner_live` | NFT owner via ownerOf |
|
|
43
|
-
| `1s_total_supply_live` | Token total supply |
|
|
44
|
-
| `1s_tx_details_live` | Transaction + receipt via RPC |
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
### Chain Utilities (
|
|
48
|
-
|
|
49
|
-
| Tool | Description |
|
|
50
|
-
|------|-------------|
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
ONESOURCE_API_KEY
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
X402_PRIVATE_KEY
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
1
|
+
# onesource-api-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for OneSource blockchain data. 22 named tools for balances, NFTs, transactions, events, and live chain queries via API key or x402 micropayments.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npx onesource-api-mcp
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
# Claude Code
|
|
13
|
+
claude mcp add onesource-api -- npx onesource-api-mcp
|
|
14
|
+
|
|
15
|
+
# Claude Desktop / Cursor — add to MCP config:
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"onesource-api": {
|
|
19
|
+
"command": "npx",
|
|
20
|
+
"args": ["-y", "onesource-api-mcp"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Tools (22)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Live Chain Data (12 tools)
|
|
30
|
+
|
|
31
|
+
| Tool | Description |
|
|
32
|
+
|------|-------------|
|
|
33
|
+
| `1s_allowance_live` | ERC20 allowance check |
|
|
34
|
+
| `1s_contract_info_live` | Contract type detection via ERC165 |
|
|
35
|
+
| `1s_erc1155_balance_live` | ERC1155 balance via RPC |
|
|
36
|
+
| `1s_erc20_balance_live` | ERC20 balance via balanceOf |
|
|
37
|
+
| `1s_erc20_transfers_live` | ERC20 Transfer logs via eth_getLogs |
|
|
38
|
+
| `1s_erc721_tokens_live` | ERC721 token enumeration |
|
|
39
|
+
| `1s_events_live` | Event logs via eth_getLogs |
|
|
40
|
+
| `1s_multi_balance_live` | ETH + multiple ERC20 balances |
|
|
41
|
+
| `1s_nft_metadata_live` | NFT metadata via tokenURI |
|
|
42
|
+
| `1s_nft_owner_live` | NFT owner via ownerOf |
|
|
43
|
+
| `1s_total_supply_live` | Token total supply |
|
|
44
|
+
| `1s_tx_details_live` | Transaction + receipt via RPC |
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Chain Utilities (13 tools) - RPC Only
|
|
48
|
+
|
|
49
|
+
| Tool | Description |
|
|
50
|
+
|------|-------------|
|
|
51
|
+
| `1s_block_by_number` | Block details by number |
|
|
52
|
+
| `1s_block_number` | Latest block number |
|
|
53
|
+
| `1s_chain_id` | EIP-155 chain ID |
|
|
54
|
+
| `1s_contract_code` | Contract bytecode |
|
|
55
|
+
| `1s_ens_resolve` | ENS name/address resolution |
|
|
56
|
+
| `1s_estimate_gas` | Gas estimation |
|
|
57
|
+
| `1s_network_info` | Chain ID, block number, gas price |
|
|
58
|
+
| `1s_nonce` | Transaction count |
|
|
59
|
+
| `1s_pending_block` | Pending block from mempool |
|
|
60
|
+
| `1s_proxy_detect` | Proxy contract detection |
|
|
61
|
+
| `1s_simulate_call` | Simulate eth_call |
|
|
62
|
+
| `1s_storage_read` | Read storage slot |
|
|
63
|
+
| `1s_tx_receipt` | Transaction receipt |
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Networks
|
|
67
|
+
|
|
68
|
+
All tools accept an optional `network` parameter:
|
|
69
|
+
|
|
70
|
+
| Network | Description |
|
|
71
|
+
|---------|-------------|
|
|
72
|
+
| `ethereum` | Ethereum mainnet (default) |
|
|
73
|
+
| `sepolia` | Ethereum Sepolia testnet |
|
|
74
|
+
| `avax` | Avalanche C-Chain |
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## Authentication
|
|
78
|
+
|
|
79
|
+
Two auth methods are supported. **API key takes priority** when both are configured.
|
|
80
|
+
|
|
81
|
+
### API Key (recommended)
|
|
82
|
+
|
|
83
|
+
Set `ONESOURCE_API_KEY` to your OneSource API key. The server sends it as a Bearer token on every request.
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
ONESOURCE_API_KEY=your-key-here npx onesource-api-mcp
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Or in your MCP config:
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"mcpServers": {
|
|
93
|
+
"onesource-api": {
|
|
94
|
+
"command": "npx",
|
|
95
|
+
"args": ["-y", "onesource-api-mcp"],
|
|
96
|
+
"env": {
|
|
97
|
+
"ONESOURCE_API_KEY": "your-key-here"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### x402 Micropayments
|
|
105
|
+
|
|
106
|
+
Set `X402_PRIVATE_KEY` to a funded EVM wallet key. The server automatically signs and settles USDC payments on Base via [x402](https://github.com/coinbase/x402).
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
X402_PRIVATE_KEY=your-private-key-hex npx onesource-api-mcp
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### No auth
|
|
113
|
+
|
|
114
|
+
Without either variable, tools work for free endpoints. Paid endpoints return 402 errors with a descriptive message.
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## Configuration
|
|
118
|
+
|
|
119
|
+
| Variable | Default | Description |
|
|
120
|
+
|----------|---------|-------------|
|
|
121
|
+
| `ONESOURCE_API_KEY` | — | OneSource API key. Sent as `Authorization: Bearer <key>`. Takes priority over x402. |
|
|
122
|
+
| `ONESOURCE_BASE_URL` | `https://skills.onesource.io` | Skills API endpoint |
|
|
123
|
+
| `X402_PRIVATE_KEY` | — | EVM private key (hex, with or without 0x prefix) for automatic x402 USDC payments on Base |
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT
|
package/README.npm.md
CHANGED
|
@@ -1,125 +1,128 @@
|
|
|
1
|
-
# onesource-api-mcp
|
|
2
|
-
|
|
3
|
-
MCP server for OneSource blockchain data. 22 named tools for balances, NFTs, transactions, events, and live chain queries via API key or x402 micropayments.
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
npx onesource-api-mcp
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
# Claude Code
|
|
13
|
-
claude mcp add onesource-api -- npx onesource-api-mcp
|
|
14
|
-
|
|
15
|
-
# Claude Desktop / Cursor — add to MCP config:
|
|
16
|
-
{
|
|
17
|
-
"mcpServers": {
|
|
18
|
-
"onesource-api": {
|
|
19
|
-
"command": "npx",
|
|
20
|
-
"args": ["-y", "onesource-api-mcp"]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Tools (22)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### Live Chain Data (12 tools)
|
|
30
|
-
|
|
31
|
-
| Tool | Description |
|
|
32
|
-
|------|-------------|
|
|
33
|
-
| `1s_allowance_live` | ERC20 allowance check |
|
|
34
|
-
| `1s_contract_info_live` | Contract type detection via ERC165 |
|
|
35
|
-
| `1s_erc1155_balance_live` | ERC1155 balance via RPC |
|
|
36
|
-
| `1s_erc20_balance_live` | ERC20 balance via balanceOf |
|
|
37
|
-
| `1s_erc20_transfers_live` | ERC20 Transfer logs via eth_getLogs |
|
|
38
|
-
| `1s_erc721_tokens_live` | ERC721 token enumeration |
|
|
39
|
-
| `1s_events_live` | Event logs via eth_getLogs |
|
|
40
|
-
| `1s_multi_balance_live` | ETH + multiple ERC20 balances |
|
|
41
|
-
| `1s_nft_metadata_live` | NFT metadata via tokenURI |
|
|
42
|
-
| `1s_nft_owner_live` | NFT owner via ownerOf |
|
|
43
|
-
| `1s_total_supply_live` | Token total supply |
|
|
44
|
-
| `1s_tx_details_live` | Transaction + receipt via RPC |
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
### Chain Utilities (
|
|
48
|
-
|
|
49
|
-
| Tool | Description |
|
|
50
|
-
|------|-------------|
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
ONESOURCE_API_KEY
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
X402_PRIVATE_KEY
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
1
|
+
# onesource-api-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for OneSource blockchain data. 22 named tools for balances, NFTs, transactions, events, and live chain queries via API key or x402 micropayments.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npx onesource-api-mcp
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
# Claude Code
|
|
13
|
+
claude mcp add onesource-api -- npx onesource-api-mcp
|
|
14
|
+
|
|
15
|
+
# Claude Desktop / Cursor — add to MCP config:
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"onesource-api": {
|
|
19
|
+
"command": "npx",
|
|
20
|
+
"args": ["-y", "onesource-api-mcp"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Tools (22)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Live Chain Data (12 tools)
|
|
30
|
+
|
|
31
|
+
| Tool | Description |
|
|
32
|
+
|------|-------------|
|
|
33
|
+
| `1s_allowance_live` | ERC20 allowance check |
|
|
34
|
+
| `1s_contract_info_live` | Contract type detection via ERC165 |
|
|
35
|
+
| `1s_erc1155_balance_live` | ERC1155 balance via RPC |
|
|
36
|
+
| `1s_erc20_balance_live` | ERC20 balance via balanceOf |
|
|
37
|
+
| `1s_erc20_transfers_live` | ERC20 Transfer logs via eth_getLogs |
|
|
38
|
+
| `1s_erc721_tokens_live` | ERC721 token enumeration |
|
|
39
|
+
| `1s_events_live` | Event logs via eth_getLogs |
|
|
40
|
+
| `1s_multi_balance_live` | ETH + multiple ERC20 balances |
|
|
41
|
+
| `1s_nft_metadata_live` | NFT metadata via tokenURI |
|
|
42
|
+
| `1s_nft_owner_live` | NFT owner via ownerOf |
|
|
43
|
+
| `1s_total_supply_live` | Token total supply |
|
|
44
|
+
| `1s_tx_details_live` | Transaction + receipt via RPC |
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Chain Utilities (13 tools) - RPC Only
|
|
48
|
+
|
|
49
|
+
| Tool | Description |
|
|
50
|
+
|------|-------------|
|
|
51
|
+
| `1s_block_by_number` | Block details by number |
|
|
52
|
+
| `1s_block_number` | Latest block number |
|
|
53
|
+
| `1s_chain_id` | EIP-155 chain ID |
|
|
54
|
+
| `1s_contract_code` | Contract bytecode |
|
|
55
|
+
| `1s_ens_resolve` | ENS name/address resolution |
|
|
56
|
+
| `1s_estimate_gas` | Gas estimation |
|
|
57
|
+
| `1s_network_info` | Chain ID, block number, gas price |
|
|
58
|
+
| `1s_nonce` | Transaction count |
|
|
59
|
+
| `1s_pending_block` | Pending block from mempool |
|
|
60
|
+
| `1s_proxy_detect` | Proxy contract detection |
|
|
61
|
+
| `1s_simulate_call` | Simulate eth_call |
|
|
62
|
+
| `1s_storage_read` | Read storage slot |
|
|
63
|
+
| `1s_tx_receipt` | Transaction receipt |
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Networks
|
|
67
|
+
|
|
68
|
+
All tools accept an optional `network` parameter:
|
|
69
|
+
|
|
70
|
+
| Network | Description |
|
|
71
|
+
|---------|-------------|
|
|
72
|
+
| `ethereum` | Ethereum mainnet (default) |
|
|
73
|
+
| `sepolia` | Ethereum Sepolia testnet |
|
|
74
|
+
| `avax` | Avalanche C-Chain |
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## Authentication
|
|
78
|
+
|
|
79
|
+
Two auth methods are supported. **API key takes priority** when both are configured.
|
|
80
|
+
|
|
81
|
+
### API Key (recommended)
|
|
82
|
+
|
|
83
|
+
Set `ONESOURCE_API_KEY` to your OneSource API key. The server sends it as a Bearer token on every request.
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
ONESOURCE_API_KEY=your-key-here npx onesource-api-mcp
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Or in your MCP config:
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"mcpServers": {
|
|
93
|
+
"onesource-api": {
|
|
94
|
+
"command": "npx",
|
|
95
|
+
"args": ["-y", "onesource-api-mcp"],
|
|
96
|
+
"env": {
|
|
97
|
+
"ONESOURCE_API_KEY": "your-key-here"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### x402 Micropayments
|
|
105
|
+
|
|
106
|
+
Set `X402_PRIVATE_KEY` to a funded EVM wallet key. The server automatically signs and settles USDC payments on Base via [x402](https://github.com/coinbase/x402).
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
X402_PRIVATE_KEY=your-private-key-hex npx onesource-api-mcp
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### No auth
|
|
113
|
+
|
|
114
|
+
Without either variable, tools work for free endpoints. Paid endpoints return 402 errors with a descriptive message.
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## Configuration
|
|
118
|
+
|
|
119
|
+
| Variable | Default | Description |
|
|
120
|
+
|----------|---------|-------------|
|
|
121
|
+
| `ONESOURCE_API_KEY` | — | OneSource API key. Sent as `Authorization: Bearer <key>`. Takes priority over x402. |
|
|
122
|
+
| `ONESOURCE_BASE_URL` | `https://skills.onesource.io` | Skills API endpoint |
|
|
123
|
+
| `X402_PRIVATE_KEY` | — | EVM private key (hex, with or without 0x prefix) for automatic x402 USDC payments on Base |
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT
|
package/README.repo.md
CHANGED
|
@@ -1,172 +1,175 @@
|
|
|
1
|
-
# onesource-api-mcp
|
|
2
|
-
|
|
3
|
-
MCP server for OneSource blockchain data.
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
npx onesource-api-mcp
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
# Claude Code
|
|
13
|
-
claude mcp add onesource-api -- npx onesource-api-mcp
|
|
14
|
-
|
|
15
|
-
# Claude Desktop / Cursor — add to MCP config:
|
|
16
|
-
{
|
|
17
|
-
"mcpServers": {
|
|
18
|
-
"onesource-api": {
|
|
19
|
-
"command": "npx",
|
|
20
|
-
"args": ["-y", "onesource-api-mcp"]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Tools (22)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### Live Chain Data (12 tools)
|
|
30
|
-
|
|
31
|
-
| Tool | Description |
|
|
32
|
-
|------|-------------|
|
|
33
|
-
| `1s_allowance_live` | ERC20 allowance check |
|
|
34
|
-
| `1s_contract_info_live` | Contract type detection via ERC165 |
|
|
35
|
-
| `1s_erc1155_balance_live` | ERC1155 balance via RPC |
|
|
36
|
-
| `1s_erc20_balance_live` | ERC20 balance via balanceOf |
|
|
37
|
-
| `1s_erc20_transfers_live` | ERC20 Transfer logs via eth_getLogs |
|
|
38
|
-
| `1s_erc721_tokens_live` | ERC721 token enumeration |
|
|
39
|
-
| `1s_events_live` | Event logs via eth_getLogs |
|
|
40
|
-
| `1s_multi_balance_live` | ETH + multiple ERC20 balances |
|
|
41
|
-
| `1s_nft_metadata_live` | NFT metadata via tokenURI |
|
|
42
|
-
| `1s_nft_owner_live` | NFT owner via ownerOf |
|
|
43
|
-
| `1s_total_supply_live` | Token total supply |
|
|
44
|
-
| `1s_tx_details_live` | Transaction + receipt via RPC |
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
### Chain Utilities (
|
|
48
|
-
|
|
49
|
-
| Tool | Description |
|
|
50
|
-
|------|-------------|
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
ONESOURCE_API_KEY
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
X402_PRIVATE_KEY
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
|
120
|
-
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
#
|
|
132
|
-
npx onesource-api-mcp
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
- **
|
|
156
|
-
- **
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
1
|
+
# onesource-api-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for OneSource blockchain data. 25 named tools for balances, NFTs, transactions, events, and live chain queries via API key or x402 micropayments.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npx onesource-api-mcp
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
# Claude Code
|
|
13
|
+
claude mcp add onesource-api -- npx onesource-api-mcp
|
|
14
|
+
|
|
15
|
+
# Claude Desktop / Cursor — add to MCP config:
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"onesource-api": {
|
|
19
|
+
"command": "npx",
|
|
20
|
+
"args": ["-y", "onesource-api-mcp"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Tools (22)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Live Chain Data (12 tools)
|
|
30
|
+
|
|
31
|
+
| Tool | Description |
|
|
32
|
+
|------|-------------|
|
|
33
|
+
| `1s_allowance_live` | ERC20 allowance check |
|
|
34
|
+
| `1s_contract_info_live` | Contract type detection via ERC165 |
|
|
35
|
+
| `1s_erc1155_balance_live` | ERC1155 balance via RPC |
|
|
36
|
+
| `1s_erc20_balance_live` | ERC20 balance via balanceOf |
|
|
37
|
+
| `1s_erc20_transfers_live` | ERC20 Transfer logs via eth_getLogs |
|
|
38
|
+
| `1s_erc721_tokens_live` | ERC721 token enumeration |
|
|
39
|
+
| `1s_events_live` | Event logs via eth_getLogs |
|
|
40
|
+
| `1s_multi_balance_live` | ETH + multiple ERC20 balances |
|
|
41
|
+
| `1s_nft_metadata_live` | NFT metadata via tokenURI |
|
|
42
|
+
| `1s_nft_owner_live` | NFT owner via ownerOf |
|
|
43
|
+
| `1s_total_supply_live` | Token total supply |
|
|
44
|
+
| `1s_tx_details_live` | Transaction + receipt via RPC |
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Chain Utilities (13 tools) — RPC only
|
|
48
|
+
|
|
49
|
+
| Tool | Description |
|
|
50
|
+
|------|-------------|
|
|
51
|
+
| `1s_block_by_number` | Block details by number |
|
|
52
|
+
| `1s_block_number` | Latest block number |
|
|
53
|
+
| `1s_chain_id` | EIP-155 chain ID |
|
|
54
|
+
| `1s_contract_code` | Contract bytecode |
|
|
55
|
+
| `1s_ens_resolve` | ENS name/address resolution |
|
|
56
|
+
| `1s_estimate_gas` | Gas estimation |
|
|
57
|
+
| `1s_network_info` | Chain ID, block number, gas price |
|
|
58
|
+
| `1s_nonce` | Transaction count |
|
|
59
|
+
| `1s_pending_block` | Pending block from mempool |
|
|
60
|
+
| `1s_proxy_detect` | Proxy contract detection |
|
|
61
|
+
| `1s_simulate_call` | Simulate eth_call |
|
|
62
|
+
| `1s_storage_read` | Read storage slot |
|
|
63
|
+
| `1s_tx_receipt` | Transaction receipt |
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Networks
|
|
67
|
+
|
|
68
|
+
All tools accept an optional `network` parameter:
|
|
69
|
+
|
|
70
|
+
| Network | Description |
|
|
71
|
+
|---------|-------------|
|
|
72
|
+
| `ethereum` | Ethereum mainnet (default) |
|
|
73
|
+
| `sepolia` | Ethereum Sepolia testnet |
|
|
74
|
+
| `avax` | Avalanche C-Chain |
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## Authentication
|
|
78
|
+
|
|
79
|
+
Two auth methods are supported. **API key takes priority** when both are configured.
|
|
80
|
+
|
|
81
|
+
### API Key (recommended)
|
|
82
|
+
|
|
83
|
+
Set `ONESOURCE_API_KEY` to your OneSource API key. The server sends it as a Bearer token on every request.
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
ONESOURCE_API_KEY=your-key-here npx onesource-api-mcp
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Or in your MCP config:
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"mcpServers": {
|
|
93
|
+
"onesource-api": {
|
|
94
|
+
"command": "npx",
|
|
95
|
+
"args": ["-y", "onesource-api-mcp"],
|
|
96
|
+
"env": {
|
|
97
|
+
"ONESOURCE_API_KEY": "your-key-here"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### x402 Micropayments
|
|
105
|
+
|
|
106
|
+
Set `X402_PRIVATE_KEY` to a funded EVM wallet key. The server automatically signs and settles USDC payments on Base via [x402](https://github.com/coinbase/x402).
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
X402_PRIVATE_KEY=your-private-key-hex npx onesource-api-mcp
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### No auth
|
|
113
|
+
|
|
114
|
+
Without either variable, tools work for free endpoints. Paid endpoints return 402 errors with a descriptive message.
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## Configuration
|
|
118
|
+
|
|
119
|
+
| Variable | Default | Description |
|
|
120
|
+
|----------|---------|-------------|
|
|
121
|
+
| `ONESOURCE_API_KEY` | — | OneSource API key. Sent as `Authorization: Bearer <key>`. Takes priority over x402. |
|
|
122
|
+
| `ONESOURCE_BASE_URL` | `https://skills.onesource.io` | Skills API endpoint |
|
|
123
|
+
| `X402_PRIVATE_KEY` | — | EVM private key (hex, with or without 0x prefix) for automatic x402 USDC payments on Base |
|
|
124
|
+
| `ONESOURCE_ANALYTICS` | `true` | Set `false` to disable all analytics |
|
|
125
|
+
| `ONESOURCE_ANALYTICS_URL` | `https://1s-analytics.vercel.app` | Dashboard endpoint for event ingestion (baked in by default) |
|
|
126
|
+
| `X402_ANALYTICS_KEY` | `onesource-api-mcp` | Bearer token for the analytics dashboard (baked in by default) |
|
|
127
|
+
|
|
128
|
+
## Transport Modes
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
# stdio (default — for MCP clients)
|
|
132
|
+
npx onesource-api-mcp
|
|
133
|
+
|
|
134
|
+
# HTTP (for testing or remote access)
|
|
135
|
+
npx onesource-api-mcp --http
|
|
136
|
+
npx onesource-api-mcp --http --port=8080
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
HTTP mode binds to `127.0.0.1` by default.
|
|
140
|
+
|
|
141
|
+
## Adding a New Tool
|
|
142
|
+
|
|
143
|
+
When a new SKILL.md is added to `skills/OneSource*/`, a corresponding MCP tool file needs to be created here.
|
|
144
|
+
|
|
145
|
+
**Step 1:** Create the SKILL.md in the skills repo (see the skills README for format).
|
|
146
|
+
|
|
147
|
+
**Step 2:** Scaffold the tool file:
|
|
148
|
+
|
|
149
|
+
```sh
|
|
150
|
+
cd mcp/
|
|
151
|
+
npm run new-tool
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
This prompts for:
|
|
155
|
+
- **Tool name** — `1s_` prefix, snake_case (e.g. `1s_token_info`)
|
|
156
|
+
- **Category** — `live` (direct RPC) or `chain` (RPC-only utility)
|
|
157
|
+
- **Description** — one-liner for the tool
|
|
158
|
+
- **Endpoint** — REST API path (e.g. `/api/chain/my-endpoint`)
|
|
159
|
+
- **Method** — GET or POST
|
|
160
|
+
|
|
161
|
+
It generates a tool file in `src/tools/{category}/` with TODO markers.
|
|
162
|
+
|
|
163
|
+
**Step 3:** Edit the generated file — fill in the Zod schema parameters and handler logic. Use the shared params from `src/types.ts` (`addressParam`, `txHashParam`, `tokenIdParam`, `hexDataParam`, `networkParam`, `limitParam`, `blockNumberParam`).
|
|
164
|
+
|
|
165
|
+
**Step 4:** Build:
|
|
166
|
+
|
|
167
|
+
```sh
|
|
168
|
+
npm run build
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
This auto-regenerates the tool index and compiles. The new tool is immediately available in the MCP server.
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-by-number.d.ts","sourceRoot":"","sources":["../../../src/tools/chain/block-by-number.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAI9C,eAAO,MAAM,IAAI,EAAE,OAkBlB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { networkParam, formatResponse, safePath } from '../../types.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const tool = {
|
|
4
|
+
name: '1s_block_by_number',
|
|
5
|
+
description: 'Get full block details by block number via RPC. Returns transactions, gas used, miner, timestamp, and other header fields. ' +
|
|
6
|
+
'Accepts decimal (e.g. "21000000") or hex (e.g. "0x1406F40") block numbers.',
|
|
7
|
+
category: 'chain',
|
|
8
|
+
schema: {
|
|
9
|
+
number: z
|
|
10
|
+
.string()
|
|
11
|
+
.describe('Block number — decimal (e.g. "21000000") or hex (e.g. "0x1406F40")'),
|
|
12
|
+
network: networkParam,
|
|
13
|
+
},
|
|
14
|
+
handler: async (input, client) => {
|
|
15
|
+
const res = await client.get(`/api/chain/block/${safePath(input.number)}`, {
|
|
16
|
+
network: input.network,
|
|
17
|
+
});
|
|
18
|
+
return formatResponse(res);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=block-by-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-by-number.js","sourceRoot":"","sources":["../../../src/tools/chain/block-by-number.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,6HAA6H;QAC7H,4EAA4E;IAC9E,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,QAAQ,CAAC,oEAAoE,CAAC;QACjF,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,oBAAoB,QAAQ,CAAC,KAAK,CAAC,MAAgB,CAAC,EAAE,EAAE;YACnF,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-number.d.ts","sourceRoot":"","sources":["../../../src/tools/chain/block-number.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAgBlB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { networkParam, formatResponse } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_block_number',
|
|
4
|
+
description: 'Get the latest block number for a network. ' +
|
|
5
|
+
'Returns the current chain head as a hex-encoded value. ' +
|
|
6
|
+
'Use 1s_network_info to also get chain ID and gas price in the same call.',
|
|
7
|
+
category: 'chain',
|
|
8
|
+
schema: {
|
|
9
|
+
network: networkParam,
|
|
10
|
+
},
|
|
11
|
+
handler: async (input, client) => {
|
|
12
|
+
const res = await client.get('/api/chain/block-number', {
|
|
13
|
+
network: input.network,
|
|
14
|
+
});
|
|
15
|
+
return formatResponse(res);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=block-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-number.js","sourceRoot":"","sources":["../../../src/tools/chain/block-number.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,6CAA6C;QAC7C,yDAAyD;QACzD,0EAA0E;IAC5E,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,yBAAyB,EAAE;YACtD,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain-id.d.ts","sourceRoot":"","sources":["../../../src/tools/chain/chain-id.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,IAAI,EAAE,OAgBlB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { networkParam, formatResponse } from '../../types.js';
|
|
2
|
+
export const tool = {
|
|
3
|
+
name: '1s_chain_id',
|
|
4
|
+
description: 'Get the EIP-155 chain ID for a network as a hex-encoded value. ' +
|
|
5
|
+
'Use this to verify the network before signing transactions. ' +
|
|
6
|
+
'Use 1s_network_info to get chain ID, block number, and gas price together.',
|
|
7
|
+
category: 'chain',
|
|
8
|
+
schema: {
|
|
9
|
+
network: networkParam,
|
|
10
|
+
},
|
|
11
|
+
handler: async (input, client) => {
|
|
12
|
+
const res = await client.get('/api/chain/chain-id', {
|
|
13
|
+
network: input.network,
|
|
14
|
+
});
|
|
15
|
+
return formatResponse(res);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chain-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain-id.js","sourceRoot":"","sources":["../../../src/tools/chain/chain-id.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,iEAAiE;QACjE,8DAA8D;QAC9D,4EAA4E;IAC9E,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,OAAO,EAAE,YAAY;KACtB;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAE;YAClD,OAAO,EAAE,KAAK,CAAC,OAA6B;SAC7C,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AA+B3C,eAAO,MAAM,QAAQ,EAAE,OAAO,EA6B7B,CAAC"}
|
package/dist/tools/index.js
CHANGED
|
@@ -11,7 +11,10 @@ import { tool as nftMetadataLive } from './live/nft-metadata.js';
|
|
|
11
11
|
import { tool as nftOwnerLive } from './live/nft-owner.js';
|
|
12
12
|
import { tool as totalSupplyLive } from './live/total-supply.js';
|
|
13
13
|
import { tool as txDetailsLive } from './live/tx-details.js';
|
|
14
|
-
// --- Chain utilities (
|
|
14
|
+
// --- Chain utilities (13 tools) ---
|
|
15
|
+
import { tool as blockByNumber } from './chain/block-by-number.js';
|
|
16
|
+
import { tool as blockNumber } from './chain/block-number.js';
|
|
17
|
+
import { tool as chainId } from './chain/chain-id.js';
|
|
15
18
|
import { tool as contractCode } from './chain/contract-code.js';
|
|
16
19
|
import { tool as ensResolve } from './chain/ens-resolve.js';
|
|
17
20
|
import { tool as estimateGas } from './chain/estimate-gas.js';
|
|
@@ -37,6 +40,9 @@ export const allTools = [
|
|
|
37
40
|
totalSupplyLive,
|
|
38
41
|
txDetailsLive,
|
|
39
42
|
// Chain utilities
|
|
43
|
+
blockByNumber,
|
|
44
|
+
blockNumber,
|
|
45
|
+
chainId,
|
|
40
46
|
contractCode,
|
|
41
47
|
ensResolve,
|
|
42
48
|
estimateGas,
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAMA,qCAAqC;AACrC,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,IAAI,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,IAAI,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,IAAI,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,IAAI,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,IAAI,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,IAAI,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7D,qCAAqC;AACrC,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,CAAC,MAAM,QAAQ,GAAc;IACjC,kBAAkB;IAClB,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;IAClB,gBAAgB;IAChB,UAAU;IACV,gBAAgB;IAChB,eAAe;IACf,YAAY;IACZ,eAAe;IACf,aAAa;IAEb,kBAAkB;IAClB,YAAY;IACZ,UAAU;IACV,WAAW;IACX,WAAW;IACX,KAAK;IACL,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,WAAW;IACX,SAAS;CACV,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAMA,qCAAqC;AACrC,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,IAAI,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,IAAI,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,IAAI,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,IAAI,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,IAAI,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,IAAI,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7D,qCAAqC;AACrC,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,CAAC,MAAM,QAAQ,GAAc;IACjC,kBAAkB;IAClB,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;IAClB,gBAAgB;IAChB,UAAU;IACV,gBAAgB;IAChB,eAAe;IACf,YAAY;IACZ,eAAe;IACf,aAAa;IAEb,kBAAkB;IAClB,aAAa;IACb,WAAW;IACX,OAAO;IACP,YAAY;IACZ,UAAU;IACV,WAAW;IACX,WAAW;IACX,KAAK;IACL,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,WAAW;IACX,SAAS;CACV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@one-source/api-mcp",
|
|
3
|
-
"version": "5.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "MCP server for OneSource blockchain data —
|
|
6
|
-
"bin": {
|
|
7
|
-
"onesource-api-mcp": "./dist/cli.js"
|
|
8
|
-
},
|
|
9
|
-
"main": "./dist/create-server.js",
|
|
10
|
-
"types": "./dist/create-server.d.ts",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"types": "./dist/create-server.d.ts",
|
|
14
|
-
"default": "./dist/create-server.js"
|
|
15
|
-
},
|
|
16
|
-
"./tools": {
|
|
17
|
-
"types": "./dist/tools/index.d.ts",
|
|
18
|
-
"default": "./dist/tools/index.js"
|
|
19
|
-
},
|
|
20
|
-
"./client": {
|
|
21
|
-
"types": "./dist/client.d.ts",
|
|
22
|
-
"default": "./dist/client.js"
|
|
23
|
-
},
|
|
24
|
-
"./analytics": {
|
|
25
|
-
"types": "./dist/analytics.d.ts",
|
|
26
|
-
"default": "./dist/analytics.js"
|
|
27
|
-
},
|
|
28
|
-
"./x402": {
|
|
29
|
-
"types": "./dist/x402.d.ts",
|
|
30
|
-
"default": "./dist/x402.js"
|
|
31
|
-
},
|
|
32
|
-
"./types": {
|
|
33
|
-
"types": "./dist/types.d.ts",
|
|
34
|
-
"default": "./dist/types.js"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"files": [
|
|
38
|
-
"dist/",
|
|
39
|
-
"README.md",
|
|
40
|
-
"LICENSE"
|
|
41
|
-
],
|
|
42
|
-
"keywords": [
|
|
43
|
-
"mcp",
|
|
44
|
-
"model-context-protocol",
|
|
45
|
-
"onesource",
|
|
46
|
-
"web3",
|
|
47
|
-
"blockchain",
|
|
48
|
-
"ethereum",
|
|
49
|
-
"x402",
|
|
50
|
-
"nft",
|
|
51
|
-
"erc20",
|
|
52
|
-
"transactions"
|
|
53
|
-
],
|
|
54
|
-
"scripts": {
|
|
55
|
-
"gen": "node scripts/gen-tools-index.mjs",
|
|
56
|
-
"new-tool": "node scripts/new-tool.mjs",
|
|
57
|
-
"prebuild": "npm run gen",
|
|
58
|
-
"build": "tsc",
|
|
59
|
-
"prepack": "node -e \"fs=require('fs');fs.copyFileSync('README.md','README.repo.md');fs.copyFileSync('README.npm.md','README.md')\"",
|
|
60
|
-
"postpack": "node -e \"fs=require('fs');fs.renameSync('README.repo.md','README.md')\"",
|
|
61
|
-
"prepublishOnly": "npm run build",
|
|
62
|
-
"dev": "tsc --watch",
|
|
63
|
-
"test": "vitest run",
|
|
64
|
-
"test:watch": "vitest"
|
|
65
|
-
},
|
|
66
|
-
"dependencies": {
|
|
67
|
-
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
68
|
-
"@x402/evm": "^2.0.0",
|
|
69
|
-
"@x402/fetch": "^2.0.0",
|
|
70
|
-
"viem": "^2.0.0",
|
|
71
|
-
"zod": "^3.24.0"
|
|
72
|
-
},
|
|
73
|
-
"devDependencies": {
|
|
74
|
-
"@types/node": "^22.0.0",
|
|
75
|
-
"typescript": "^5.7.0",
|
|
76
|
-
"vitest": "^2.0.0"
|
|
77
|
-
},
|
|
78
|
-
"engines": {
|
|
79
|
-
"node": ">=18"
|
|
80
|
-
},
|
|
81
|
-
"author": "BlockParty",
|
|
82
|
-
"license": "MIT",
|
|
83
|
-
"homepage": "https://docs.onesource.io",
|
|
84
|
-
"repository": {
|
|
85
|
-
"type": "git",
|
|
86
|
-
"url": "https://github.com/AnonDev-BlockParty/sre-services.git",
|
|
87
|
-
"directory": "skills/mcp"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@one-source/api-mcp",
|
|
3
|
+
"version": "5.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "MCP server for OneSource blockchain data — 25 named tools for balances, NFTs, transactions, events, and live chain queries via x402",
|
|
6
|
+
"bin": {
|
|
7
|
+
"onesource-api-mcp": "./dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/create-server.js",
|
|
10
|
+
"types": "./dist/create-server.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/create-server.d.ts",
|
|
14
|
+
"default": "./dist/create-server.js"
|
|
15
|
+
},
|
|
16
|
+
"./tools": {
|
|
17
|
+
"types": "./dist/tools/index.d.ts",
|
|
18
|
+
"default": "./dist/tools/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./client": {
|
|
21
|
+
"types": "./dist/client.d.ts",
|
|
22
|
+
"default": "./dist/client.js"
|
|
23
|
+
},
|
|
24
|
+
"./analytics": {
|
|
25
|
+
"types": "./dist/analytics.d.ts",
|
|
26
|
+
"default": "./dist/analytics.js"
|
|
27
|
+
},
|
|
28
|
+
"./x402": {
|
|
29
|
+
"types": "./dist/x402.d.ts",
|
|
30
|
+
"default": "./dist/x402.js"
|
|
31
|
+
},
|
|
32
|
+
"./types": {
|
|
33
|
+
"types": "./dist/types.d.ts",
|
|
34
|
+
"default": "./dist/types.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist/",
|
|
39
|
+
"README.md",
|
|
40
|
+
"LICENSE"
|
|
41
|
+
],
|
|
42
|
+
"keywords": [
|
|
43
|
+
"mcp",
|
|
44
|
+
"model-context-protocol",
|
|
45
|
+
"onesource",
|
|
46
|
+
"web3",
|
|
47
|
+
"blockchain",
|
|
48
|
+
"ethereum",
|
|
49
|
+
"x402",
|
|
50
|
+
"nft",
|
|
51
|
+
"erc20",
|
|
52
|
+
"transactions"
|
|
53
|
+
],
|
|
54
|
+
"scripts": {
|
|
55
|
+
"gen": "node scripts/gen-tools-index.mjs",
|
|
56
|
+
"new-tool": "node scripts/new-tool.mjs",
|
|
57
|
+
"prebuild": "npm run gen",
|
|
58
|
+
"build": "tsc",
|
|
59
|
+
"prepack": "node -e \"fs=require('fs');fs.copyFileSync('README.md','README.repo.md');fs.copyFileSync('README.npm.md','README.md')\"",
|
|
60
|
+
"postpack": "node -e \"fs=require('fs');fs.renameSync('README.repo.md','README.md')\"",
|
|
61
|
+
"prepublishOnly": "npm run build",
|
|
62
|
+
"dev": "tsc --watch",
|
|
63
|
+
"test": "vitest run",
|
|
64
|
+
"test:watch": "vitest"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
68
|
+
"@x402/evm": "^2.0.0",
|
|
69
|
+
"@x402/fetch": "^2.0.0",
|
|
70
|
+
"viem": "^2.0.0",
|
|
71
|
+
"zod": "^3.24.0"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@types/node": "^22.0.0",
|
|
75
|
+
"typescript": "^5.7.0",
|
|
76
|
+
"vitest": "^2.0.0"
|
|
77
|
+
},
|
|
78
|
+
"engines": {
|
|
79
|
+
"node": ">=18"
|
|
80
|
+
},
|
|
81
|
+
"author": "BlockParty",
|
|
82
|
+
"license": "MIT",
|
|
83
|
+
"homepage": "https://docs.onesource.io",
|
|
84
|
+
"repository": {
|
|
85
|
+
"type": "git",
|
|
86
|
+
"url": "https://github.com/AnonDev-BlockParty/sre-services.git",
|
|
87
|
+
"directory": "skills/mcp"
|
|
88
|
+
}
|
|
89
|
+
}
|