This MCP Ethereum Address Info Server provides information about Ethereum addresses across multiple chains using the Model Context Protocol. It features a Server-Sent Events (SSE) endpoint for receiving real-time updates about Ethereum addresses.
Follow these steps to set up the MCP server:
Clone the repository:
git clone <repository-url>
cd mcp-0x-address
Install dependencies:
npm install
Create a .env
file with the following configuration:
MCP_PORT=3002
To launch the HTTP MCP server:
npm run start:http
The server will start on port 3002 (or the port specified in your .env
file).
The server provides several endpoints:
GET /health
- Check server health statusPOST /mcp
- MCP endpoint for tool callsGET /sse
- Server-Sent Events endpoint for real-time updatesGET /sse/clients
- Get information about connected SSE clientsPOST /sse/subscribe/:clientId
- Subscribe to address updatesPOST /sse/unsubscribe/:clientId
- Unsubscribe from address updatesTo establish a connection:
curl -N http://localhost:3002/sse
This will return a response containing a client ID:
data: {"type":"connection","clientId":"client-1234567890abcdef","message":"Connected to MCP SSE endpoint","timestamp":"2023-01-01T00:00:00.000Z"}
Use your client ID to subscribe to specific Ethereum addresses:
curl -X POST \
http://localhost:3002/sse/subscribe/YOUR_CLIENT_ID \
-H "Content-Type: application/json" \
-d '{"addresses": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"]}'
Replace YOUR_CLIENT_ID
with the client ID you received.
To stop receiving updates for specific addresses:
curl -X POST \
http://localhost:3002/sse/unsubscribe/YOUR_CLIENT_ID \
-H "Content-Type: application/json" \
-d '{"addresses": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e"]}'
To see all connected SSE clients:
curl http://localhost:3002/sse/clients
To fetch information about an Ethereum address:
curl -X POST \
http://localhost:3002/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get-address-info",
"arguments": {
"address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
}
}
}'
When you call this endpoint, all clients subscribed to the specified address will receive an update via SSE.
To verify the server is responding correctly:
curl -X POST \
http://localhost:3002/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ping",
"arguments": {}
}
}'
curl http://localhost:3002/health
Here's how to test the full functionality:
Start the server in one terminal:
npm run start:http
Connect to SSE in a second terminal:
curl -N http://localhost:3002/sse
Note the client ID from the response.
Subscribe to an address in a third terminal:
curl -X POST \
http://localhost:3002/sse/subscribe/client-1234567890abcdef \
-H "Content-Type: application/json" \
-d '{"addresses": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e"]}'
Request address information:
curl -X POST \
http://localhost:3002/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get-address-info",
"arguments": {
"address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
}
}
}'
Watch for updates in your SSE terminal. You'll see real-time information about the Ethereum address you requested.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "mcp-0x-address" '{"command":"npx","args":["mcp-0x-address"],"env":{"MCP_PORT":"3002"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"mcp-0x-address": {
"command": "npx",
"args": [
"mcp-0x-address"
],
"env": {
"MCP_PORT": "3002"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"mcp-0x-address": {
"command": "npx",
"args": [
"mcp-0x-address"
],
"env": {
"MCP_PORT": "3002"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect