Skip to content

Latest commit

 

History

History
81 lines (53 loc) · 1.67 KB

File metadata and controls

81 lines (53 loc) · 1.67 KB

Install Aptos MCP with Codex

  1. Install the codex package
Install with npm
npm install -g @openai/codex
Install with Homebrew
brew install codex
  1. Obtain your APTOS_BOT_KEY by following the instructions here.

  2. Navigate to your project

cd your-awesome-project
  1. Add the Aptos MCP server to Codex:
codex mcp add aptos-mcp --env APTOS_BOT_KEY=<your_bot_api_key> -- npx -y @aptos-labs/aptos-mcp

Replace <your_bot_api_key> with the key you generated in step 2.

Note: You can add more --env NAME=VALUE pairs as needed.

  1. Verify the MCP server was added successfully:
codex mcp list

You should see aptos-mcp in the list of configured MCP tools.

  1. Start Codex:
codex
  1. Verify the connection inside codex:
/mcp

You should see aptos-mcp in the list of configured MCP tools.

  1. Verify the connection by prompting: what aptos mcp version are you using?

The agent should reply with something like:

Running Aptos MCP server version 0.0.16.

Alternative: Using TOML configuration

If you encounter issues with the CLI approach, you can use the TOML method:

  1. Open ~/.codex/config.toml in your editor. (In the IDE, click the gear icon → MCP settings → Open config.toml.)
  2. Add an MCP server table like the following:
# ~/.codex/config.toml

[mcp_servers.aptos-mcp]
command = "npx"
args = ["-y", "@aptos-labs/aptos-mcp"]

[mcp_servers.aptos-mcp.env]
APTOS_BOT_KEY = "<your_bot_api_key>"
  1. Save the file and restart Codex (or reload the IDE).