A Model Context Protocol (MCP) server that provides AI-powered analysis of Ethereum transactions across any network. This service simulates transactions and generates human-readable interpretations to help users understand potential outcomes before execution.
The MCP Transaction Analyzer combines blockchain transaction simulation with AI interpretation.
- What a transaction will do before they execute it
- The potential impact on token balances
- Any hidden or unexpected outcomes
- Gas usage and cost estimates
- Real-time transaction simulation using Tenderly
- AI-powered interpretation using OpenAI or Google's Gemini models
- Support for all Ethereum-compatible networks
- Detailed analysis of:
- ERC20, ERC721, and ERC1155 token transfers
- Contract interactions
- Balance changes
- Gas estimations
- Secure HTTPS support in production
- Server-Sent Events (SSE) for real-time updates
- Full Model Context Protocol integration
- Node.js >= 18.x
- SSL certificates (for production mode)
- API keys for:
- Tenderly (transaction simulation)
- OpenAI and/or Google Gemini (AI interpretation)
- Clone the repository:
git clone [repository-url]
cd mcp-transaction-analyzer
- Install dependencies:
npm install
- Configure environment variables in
.env
:
TENDERLY_ACCOUNT=your_tenderly_account
TENDERLY_PROJECT=your_tenderly_project
TENDERLY_API_KEY=your_tenderly_api_key
OPENAI_API_KEY=your_openai_api_key
GEMINI_API_KEY=your_gemini_api_key
CERT_PATH=/path/to/ssl/certificates # Required for production
npm run dev
npm run prod
npm run build
- Compile TypeScript to JavaScriptnpm run dev
- Run development servernpm run dev:prod
- Run production server with TypeScriptnpm run start
- Start compiled servernpm run prod
- Run compiled server in production modenpm run inspect
- Run MCP inspector on the server
"mcpServers": {
...
"transaction-sim-server": {
"url": "<URL to your deployed server>"
}
}
"mcpServers": {
...
"transaction-simulator": {
"command": "npx",
"args": [
"mcp-remote",
"<URL to your deployed server>"
]
}
}
The service accepts transaction parameters and returns detailed analysis:
{
networkId: string, // Network ID for the transaction
from: string, // Sender address
to: string, // Recipient address
value?: string, // ETH value (optional)
data?: string, // Transaction data (optional)
useEmojis?: boolean // Enable/disable emojis in response
}
for example, let's take a random transaction from block explorer, type the following into the Cursor chat window, once you have set up your MCP server:
Computer, please determine if this transaction is safe:
networkId: 8453
from: 0x331F914d9447F0E4BEcAB98d62BEA00dADb8B591
to: 0x24fcFC492C1393274B6bcd568ac9e225BEc93584
data: 0x095ea7b3000000000000000000000000cf77a3ba9a5ca399b7c97c74d54e5b1beb874e43000000000000000000000000000000000000000000002e961634f872dfc30000
@modelcontextprotocol/sdk
: MCP integrationethers
: Ethereum interaction@smarttokenlabs/waterfall-rpc
: RPC management
@anthropic-ai/sdk
: Anthropic AI integration@google/generative-ai
: Google Gemini integrationopenai
: OpenAI integration
express
: Web server framework@fastify/cors
: CORS support
typescript
: Type safetyts-node
: TypeScript execution- Various type definitions
The project follows TypeScript best practices and is structured around:
server.ts
: Main MCP server implementationprocessTransaction.ts
: Transaction analysis logictenderly.ts
: Tenderly API integration
MIT License
James Brown ([email protected])
For issues and feature requests, please create an issue in the repository.