Aptos MCP server

Integrates with the Aptos blockchain ecosystem to enable smart contract development, testing, and deployment through natural language interactions for generating components, managing projects, and automating gas station creation
Back to servers
Setup instructions
Provider
Tlazypanda
Release date
Mar 25, 2025
Language
Python

The Aptos MCP Server enables interaction with Aptos documentation and assists in creating full-stack Aptos blockchain applications through the Model Context Protocol. This tool helps you browse documentation, create projects, generate components, test Move contracts, and create TypeScript interfaces from Move contracts.

Prerequisites

Before installing the Aptos MCP Server, ensure you have:

  • Python 3.10 or later
  • Node.js and npm
  • Aptos CLI (required for certain tooling features)

Installation

Install MCP Package

First, install the MCP package using either UV or pip:

uv add "mcp[cli]"
# or 
pip install "mcp[cli]"

Set Up the Server

Clone the repository and install the required dependencies:

git clone https://github.com/yourusername/aptos-mcp-server.git
cd aptos-mcp-server

uv add httpx
# or
pip install httpx

Configure GitHub Token (Optional)

For increased API rate limits, set your GitHub token:

export GITHUB_TOKEN=your_github_token

Integration with Claude Desktop

Install Claude Desktop

Download and install Claude Desktop from claude.ai/download.

Add the MCP Server to Claude

You can add the Aptos MCP Server to Claude Desktop in two ways:

Option 1: Use the MCP command:

mcp install aptos_mcp_server.py

Option 2: Manually edit the configuration file:

For macOS:

~/Library/Application Support/Claude/claude_desktop_config.json

For Windows:

%APPDATA%\Claude\claude_desktop_config.json

Add the following configuration:

{
  "mcpServers": {
    "aptos-dev": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/aptos-mcp-server",
        "run",
        "aptos_mcp_server.py"
      ]
    }
  }
}

After configuration, restart Claude Desktop for changes to take effect.

Using the Aptos MCP Server

Browsing Aptos Documentation

You can ask Claude to browse and search through Aptos documentation:

  • "Show me the Aptos documentation structure"
  • "Find information about Move modules in the Aptos docs"
  • "Get me the Table implementation documentation"

Creating New Projects

Set up new Aptos projects by asking Claude:

  • "Create a new Aptos full-stack project called 'my-first-dapp'"
  • "Generate a Move smart contract for a marketplace"
  • "Set up a client-only Aptos project"

Generating Components

Create components for your Aptos projects by asking:

  • "Generate a React component for connecting to Aptos wallet"
  • "Create a Move table for storing user profiles"
  • "Make a client function for querying contract data"

Testing and Generating ABIs

Test your contracts and generate TypeScript interfaces:

  • "Test my Aptos contract at ~/projects/my-dapp/move"
  • "Generate TypeScript bindings for my Move contract"

Example Queries

Here are some example queries you can use with the Aptos MCP Server:

  • "Browse through the Aptos documentation"
  • "Search the Aptos docs for 'table'"
  • "Create a new Aptos fullstack project called 'nft-marketplace'"
  • "Generate a Move module for a token contract"
  • "Create a React component for wallet connection"
  • "Generate TypeScript ABI for my contract"
  • "Test my contract's withdraw function"

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "aptos-dev" '{"command":"uv","args":["--directory","/path/to/aptos-mcp-server","run","aptos_mcp_server.py"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "aptos-dev": {
            "command": "uv",
            "args": [
                "--directory",
                "/path/to/aptos-mcp-server",
                "run",
                "aptos_mcp_server.py"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "aptos-dev": {
            "command": "uv",
            "args": [
                "--directory",
                "/path/to/aptos-mcp-server",
                "run",
                "aptos_mcp_server.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later