Skip to content

Commit 7752ccc

Browse files
committed
chore: added ENS Lookup tools, improved README
1 parent 4f19f12 commit 7752ccc

File tree

2 files changed

+187
-95
lines changed

2 files changed

+187
-95
lines changed

README.md

+74-21
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ The MCP EVM Server leverages the Model Context Protocol to provide blockchain op
3333
- Transferring tokens (native, ERC20, ERC721, ERC1155)
3434
- Querying token metadata and balances
3535
- Chain-specific operations across 30+ EVM networks
36-
- ENS name resolution for all address parameters
36+
- **ENS name resolution** for all address parameters (use human-readable names like 'vitalik.eth' instead of addresses)
3737

38-
All operations are exposed through a consistent interface of MCP tools and resources, making it easy for AI agents to discover and use blockchain functionality.
38+
All operations are exposed through a consistent interface of MCP tools and resources, making it easy for AI agents to discover and use blockchain functionality. **Every tool that accepts Ethereum addresses also supports ENS names**, automatically resolving them to addresses behind the scenes.
3939

4040
## ✨ Features
4141

@@ -46,7 +46,7 @@ All operations are exposed through a consistent interface of MCP tools and resou
4646
- **Block data** access by number, hash, or latest
4747
- **Transaction details** and receipts with decoded logs
4848
- **Address balances** for native tokens and all token standards
49-
- **ENS resolution** for human-readable Ethereum addresses
49+
- **ENS resolution** for human-readable Ethereum addresses (use 'vitalik.eth' instead of '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045')
5050

5151
### Token Operations
5252

@@ -197,6 +197,38 @@ bun dev:http
197197

198198
Connect to this MCP server using any MCP-compatible client. For testing and debugging, you can use the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).
199199

200+
### Connecting from Cursor
201+
202+
To connect to the MCP server from Cursor:
203+
204+
1. Open Cursor and go to Settings (gear icon in the bottom left)
205+
2. Click on "Features" in the left sidebar
206+
3. Scroll down to "MCP Servers" section
207+
4. Click "Add new MCP server"
208+
5. Enter the following details:
209+
- Server name: `evm-mcp-server`
210+
- Type: `command`
211+
- Command: `npx tsx /path/to/mcp-evm-server/src/index.ts`
212+
- (Replace with the absolute path to your evm-mcp-server/src/index.ts file)
213+
214+
6. Click "Save"
215+
216+
Once connected, you can use the MCP server's capabilities directly within Cursor. The server will appear in the MCP Servers list and can be enabled/disabled as needed.
217+
218+
### Connecting using Claude CLI
219+
220+
If you're using Claude CLI, you can connect to the MCP server with just two commands:
221+
222+
```bash
223+
# Add the MCP server
224+
claude mcp add evm-mcp-server npx tsx /path/to/mcp-evm-server/src/index.ts
225+
226+
# Start Claude with the MCP server enabled
227+
claude
228+
```
229+
230+
Replace `/path/to/mcp-evm-server/src/index.ts` with the absolute path to your project's src/index.ts file.
231+
200232
### Example: Getting a Token Balance with ENS
201233

202234
```javascript
@@ -221,43 +253,64 @@ console.log(result);
221253
// }
222254
```
223255

256+
### Example: Resolving an ENS Name
257+
258+
```javascript
259+
// Example of using the MCP client to resolve an ENS name to an address
260+
const mcp = new McpClient("http://localhost:3000");
261+
262+
const result = await mcp.invokeTool("resolve-ens", {
263+
ensName: "vitalik.eth",
264+
network: "ethereum"
265+
});
266+
267+
console.log(result);
268+
// {
269+
// ensName: "vitalik.eth",
270+
// normalizedName: "vitalik.eth",
271+
// resolvedAddress: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
272+
// network: "ethereum"
273+
// }
274+
```
275+
224276
## 📚 API Reference
225277

226278
### Tools
227279

228-
The server provides the following MCP tools for agents:
280+
The server provides the following MCP tools for agents. **All tools that accept address parameters support both Ethereum addresses and ENS names.**
229281

230282
#### Token Operations
231283

232284
| Tool Name | Description | Key Parameters |
233285
|-----------|-------------|----------------|
234-
| `get-token-info` | Get ERC20 token metadata | `tokenAddress`, `network` |
235-
| `get-token-balance` | Check ERC20 token balance | `tokenAddress`, `ownerAddress`, `network` |
236-
| `transfer-token` | Transfer ERC20 tokens | `privateKey`, `tokenAddress`, `toAddress`, `amount`, `network` |
237-
| `approve-token-spending` | Approve token allowances | `privateKey`, `tokenAddress`, `spenderAddress`, `amount`, `network` |
238-
| `get-nft-info` | Get NFT metadata | `tokenAddress`, `tokenId`, `network` |
239-
| `check-nft-ownership` | Verify NFT ownership | `tokenAddress`, `tokenId`, `ownerAddress`, `network` |
240-
| `transfer-nft` | Transfer an NFT | `privateKey`, `tokenAddress`, `tokenId`, `toAddress`, `network` |
241-
| `get-nft-balance` | Count NFTs owned | `tokenAddress`, `ownerAddress`, `network` |
242-
| `get-erc1155-token-uri` | Get ERC1155 metadata | `tokenAddress`, `tokenId`, `network` |
243-
| `get-erc1155-balance` | Check ERC1155 balance | `tokenAddress`, `tokenId`, `ownerAddress`, `network` |
244-
| `transfer-erc1155` | Transfer ERC1155 tokens | `privateKey`, `tokenAddress`, `tokenId`, `amount`, `toAddress`, `network` |
286+
| `get-token-info` | Get ERC20 token metadata | `tokenAddress` (address/ENS), `network` |
287+
| `get-token-balance` | Check ERC20 token balance | `tokenAddress` (address/ENS), `ownerAddress` (address/ENS), `network` |
288+
| `transfer-token` | Transfer ERC20 tokens | `privateKey`, `tokenAddress` (address/ENS), `toAddress` (address/ENS), `amount`, `network` |
289+
| `approve-token-spending` | Approve token allowances | `privateKey`, `tokenAddress` (address/ENS), `spenderAddress` (address/ENS), `amount`, `network` |
290+
| `get-nft-info` | Get NFT metadata | `tokenAddress` (address/ENS), `tokenId`, `network` |
291+
| `check-nft-ownership` | Verify NFT ownership | `tokenAddress` (address/ENS), `tokenId`, `ownerAddress` (address/ENS), `network` |
292+
| `transfer-nft` | Transfer an NFT | `privateKey`, `tokenAddress` (address/ENS), `tokenId`, `toAddress` (address/ENS), `network` |
293+
| `get-nft-balance` | Count NFTs owned | `tokenAddress` (address/ENS), `ownerAddress` (address/ENS), `network` |
294+
| `get-erc1155-token-uri` | Get ERC1155 metadata | `tokenAddress` (address/ENS), `tokenId`, `network` |
295+
| `get-erc1155-balance` | Check ERC1155 balance | `tokenAddress` (address/ENS), `tokenId`, `ownerAddress` (address/ENS), `network` |
296+
| `transfer-erc1155` | Transfer ERC1155 tokens | `privateKey`, `tokenAddress` (address/ENS), `tokenId`, `amount`, `toAddress` (address/ENS), `network` |
245297

246298
#### Blockchain Operations
247299

248300
| Tool Name | Description | Key Parameters |
249301
|-----------|-------------|----------------|
250302
| `get-chain-info` | Get network information | `network` |
251-
| `get-balance` | Get native token balance | `address`, `network` |
252-
| `transfer-eth` | Send native tokens | `privateKey`, `to`, `amount`, `network` |
303+
| `get-balance` | Get native token balance | `address` (address/ENS), `network` |
304+
| `transfer-eth` | Send native tokens | `privateKey`, `to` (address/ENS), `amount`, `network` |
253305
| `get-transaction` | Get transaction details | `txHash`, `network` |
254-
| `read-contract` | Read smart contract state | `contractAddress`, `abi`, `functionName`, `args`, `network` |
255-
| `write-contract` | Write to smart contract | `contractAddress`, `abi`, `functionName`, `args`, `privateKey`, `network` |
256-
| `is-contract` | Check if address is a contract | `address`, `network` |
306+
| `read-contract` | Read smart contract state | `contractAddress` (address/ENS), `abi`, `functionName`, `args`, `network` |
307+
| `write-contract` | Write to smart contract | `contractAddress` (address/ENS), `abi`, `functionName`, `args`, `privateKey`, `network` |
308+
| `is-contract` | Check if address is a contract | `address` (address/ENS), `network` |
309+
| `resolve-ens` | Resolve ENS name to address | `ensName`, `network` |
257310

258311
### Resources
259312

260-
The server exposes blockchain data through the following MCP resource URIs:
313+
The server exposes blockchain data through the following MCP resource URIs. All resource URIs that accept addresses also support ENS names, which are automatically resolved to addresses.
261314

262315
#### Blockchain Resources
263316

0 commit comments

Comments
 (0)