Saltearse al contenido

Aptos MCP & Claude Code

Esta página aún no está disponible en tu idioma.

  1. Install the claude-code package
Terminal window
npm install -g @anthropic-ai/claude-code
  1. Locate where Claude Code stores its configuration, usually on Mac it is at ~/.claude.json
  2. Edit the mcpServers object in the json file with
{
"mcpServers": {
"aptos-mcp": {
"command": "npx",
"args": ["-y", "@aptos-labs/aptos-mcp"],
"type": "stdio",
"env": {
"APTOS_BOT_KEY": "<bot_api_key>"
}
}
}
}
  1. Obtain your APTOS_BOT_KEY:
  • Visit the Aptos Developer Portal and log in with your account.
  • Navigate to the API Keys section and create a new key.
  • Copy the generated key for use in the next step.
  1. Make sure to update the APTOS_BOT_KEY with the key you generated in the previous step.

  2. Navigate to your project

Terminal window
cd your-awesome-project
  1. In a new terminal window type:
Terminal window
claude
  1. You can now use Claude Code to interact with the Aptos MCP. Prompt the agent with what aptos mcp version are you using? to verify the connection. The agent should reply with something like:
I'm using Aptos MCP version 0.0.2.