Setting up Aptos MCP with Claude Code
- Install Claude Code. The npm package still works:
npm install -g @anthropic-ai/claude-code-
Obtain your
APTOS_BOT_KEYfrom Geomi (Bot Keys in the account menu). See Aptos MCP for the full steps. -
Navigate to your project:
cd your-awesome-project- Add the Aptos MCP server with the Claude CLI. Put Claude’s own flags before the server name, and put the launch command after
--:
claude mcp add --scope local --env APTOS_BOT_KEY=<your_bot_key> --transport stdio aptos-mcp -- npx -y @aptos-labs/aptos-mcpReplace <your_bot_key> with the key from step 2.
--scope local stores the server for this project only. Use --scope user for every project on this machine, or --scope project to write a shareable .mcp.json (do not commit the Bot Key).
See the Claude Code MCP documentation for transport, scope, and --env syntax.
- Confirm the server is registered:
claude mcp listYou should see aptos-mcp in the list.
- Start Claude Code:
claude- Prompt the agent with
what aptos mcp version are you using?to verify the connection. It should report the currently published@aptos-labs/aptos-mcpversion from the MCP Server Card.
Alternative: JSON configuration
Section titled “Alternative: JSON configuration”If the CLI command fails, add the same stdio server as JSON:
claude mcp add-json aptos-mcp '{"command": "npx", "args": ["-y", "@aptos-labs/aptos-mcp"], "type": "stdio", "env": {"APTOS_BOT_KEY": "<your_bot_key>"}}'Troubleshooting
Section titled “Troubleshooting”- Quit and restart Claude Code after changing MCP config so it reloads the server list.
- Run
claude mcp listif the Aptos tools do not appear. - Confirm
APTOS_BOT_KEYis a valid Geomi Bot Key.