Ir al contenido principal
Volver a las aplicaciones de ejemplo

Servidor EVM MCP

El servidor EVM MCP conecta a asistentes de IA como Claude o Cursor con datos de la cadena de bloques de Ethereum y otras cadenas compatibles con EVM. Esta herramienta de servidor MCP permite a Claude consultar saldos de monederos, analizar contratos y supervisar los precios del gas a través de una conversación natural, lo que hace que los datos sobre criptomonedas sean accesibles para los agentes de IA.

Marco de trabajo o biblioteca de front-end:
Viem
Idioma:
TypeScript
Herramienta de compilación/servidor de desarrollo:
Model Context Protocol
Vista previa de la aplicación de ejemplo

Resumen

El Protocolo de Contexto de Modelos (MCP) permite a los grandes modelos de lenguaje (LLM) interactuar con herramientas externas —como API HTTP, archivos o incluso cadenas de bloques— mediante un protocolo estandarizado basado en mensajes. Piensa en él como una interfaz de «llamada a funciones» a la que pueden conectarse agentes como Claude o Cursor, convirtiendo un script o un servicio en una extensión nativa de IA.

In this guide, you'll learn how to build and deploy a MCP server that enables LLM agents to access blockchain data across multiple EVM-compatible networks. This powerful integration allows AI models like Claude to interact directly with blockchain data, opening up new possibilities for Web3 automation and analysis.

Tech Stack

Written tutorial of this project: Create an EVM MCP Server with Claude Desktop

Primeros pasos

Instalar las dependencias


  1. Clone the repository
git clone https://github.com/quiknode-labs/qn-guide-examples.git
cd qn-guide-examples/AI/evm-mcp-server

  1. Install dependencies
npm instalar

  1. Build the project

Compile the TypeScript code:

npm ejecutar build

Configure Claude Desktop

Environment variables are used to configure the server. These variables will be defined in Claude Desktop's configuration file, claude_desktop_config.json.

To configure, open the Claude Desktop app, go to Claude > Settings > Developer. Then, modify the claude_desktop_config.json file with the following content: (if you already have other configurations, add the new configuration under the mcpServers object)

{
"mcpServers": {
"evm": {
"command": "node",
"args": [
"/absolute-path-to/evm-mcp-server/build/index.js"
],
"env": {
"QN_ENDPOINT_NAME": "your-quicknode-endpoint-name",
"QN_TOKEN_ID": "your-quicknode-token-id"
}
}
}
}

  • Sustituir your-quicknode-endpoint-name with the name of your Quicknode endpoint.
  • Sustituir your-quicknode-token-id with the token ID of your Quicknode endpoint.
  • Sustituir /absolute-path-to with the absolute path to the evm-mcp-server directorio.

Test the MCP Server

Restart Claude Desktop and test the server by asking Claude Desktop to perform a task that requires the EVM MCP Server. For example, ask Claude Desktop to get balance of an address on any supported chain.

Example Agent Interactions


  1. Check a wallet balance:
Give the balance of the 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 address on Ethereum

  1. Analyze a contract:
Analyze 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 on Ethereum

  1. Get current gas prices:
Analyze the current gas prices on Ethereum, is it a good time to use the chain?
Aportaciones y comentarios
¡Nos encantaría conocer tu opinión y agradecemos cualquier aportación a esta aplicación de ejemplo!
Para informar de problemas o enviar comentarios, abre una incidencia en GitHub en el qn-guide-ejemplos repositorio.
Para colaborar, sigue estos pasos:
  1. Hacer un fork del repositorio
  2. Crear una rama de características:
    git checkout -b feature/amazing-feature
  3. Guarda los cambios:
    git commit -m "Añadir una función increíble"
  4. Envía tu rama:
    git push origin feature/amazing-feature
  5. Abre una solicitud de incorporación de cambios.