Kaspa MCP Server

Kaspa MCP Server

Enables interaction with Kaspa blockchain nodes via RPC, providing tools for querying node info, block data, addresses, balances, UTXOs, and mempool transactions.

Category
访问服务器

README

Kaspa MCP Server

MCP server for Kaspa blockchain node RPC integration, providing tools to interact with Kaspa nodes via RPC calls.

🚀 Quick Setup

Prerequisites

  • For uvx method: Install uv which includes uvx
  • For Docker method: Install Docker
  • Kaspa RPC endpoint: Access to a Kaspa node RPC (local or remote)

Installation Methods

Choose one of the following methods based on your MCP client:

📱 Claude Desktop

Add to your Claude Desktop configuration file:

Location:

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

Method 1: Using uvx (Recommended)

{
  "mcpServers": {
    "kaspa": {
      "command": "uvx",
      "args": ["--from", "/path/to/mcp-kaspa", "kaspa-mcp-server"],
      "env": {
        "KASPA_RPC_URL": "http://localhost:16110"
      }
    }
  }
}

Method 2: Using Docker

{
  "mcpServers": {
    "kaspa": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "--env", "KASPA_RPC_URL=http://host.docker.internal:16110",
        "ghcr.io/moldis/mcp-kaspa:latest"
      ]
    }
  }
}

🖥️ Cursor IDE

Add to your Cursor settings:

  1. Open Cursor Settings (Cmd/Ctrl + ,)
  2. Search for "MCP" or go to Extensions → MCP
  3. Add new server configuration:

Method 1: Using uvx

{
  "mcp.servers": {
    "kaspa": {
      "command": "uvx",
      "args": ["--from", "/path/to/mcp-kaspa", "kaspa-mcp-server"],
      "env": {
        "KASPA_RPC_URL": "http://localhost:16110"
      }
    }
  }
}

Method 2: Using Docker

{
  "mcp.servers": {
    "kaspa": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "--env", "KASPA_RPC_URL=http://host.docker.internal:16110",
        "ghcr.io/moldis/mcp-kaspa:latest"
      ]
    }
  }
}

🎯 Qoder IDE

Add this MCP server in Qoder settings:

  1. Open Qoder Settings (⌘⇧, on macOS or Ctrl+Shift+, on Windows)
  2. Navigate to MCP section
  3. Click "Add Server"

Method 1: Using uvx (Recommended)

  • Name: Kaspa MCP Server
  • Command: uvx
  • Arguments:
    • --from
    • /path/to/mcp-kaspa
    • kaspa-mcp-server
  • Environment Variables:
    • KASPA_RPC_URL=http://localhost:16110

Method 2: Using Docker

  • Name: Kaspa MCP Server
  • Command: docker
  • Arguments:
    • run
    • -i
    • --rm
    • --env
    • KASPA_RPC_URL=http://host.docker.internal:16110
    • ghcr.io/yourusername/mcp-kaspa:latest

Method 3: Direct Python (Fallback)

If uvx doesn't work:

  • Name: Kaspa MCP Server
  • Command: python3
  • Arguments:
    • -m
    • src.main
  • Environment Variables:
    • KASPA_RPC_URL=http://localhost:16110

Configuration Notes for All IDEs:

  • Replace /path/to/mcp-kaspa with the actual absolute path to your cloned repository
  • For Windows paths, use backslashes: C:\path\to\mcp-kaspa
  • For Docker: use host.docker.internal instead of localhost to access host services
  • Ensure the path points to the directory containing pyproject.toml for uvx method

🐳 Docker Support

Using Pre-built Image from GitHub Container Registry

The easiest way to use the Docker image is to pull it directly from GitHub Container Registry:

# Pull the latest image
docker pull ghcr.io/moldis/mcp-kaspa:latest

# Or pull a specific version
docker pull ghcr.io/moldis/mcp-kaspa:v1.0.0

Run with Docker

# Test with a local Kaspa node
docker run -i --rm --env KASPA_RPC_URL=http://host.docker.internal:16110 ghcr.io/moldis/mcp-kaspa:latest

# Test with a remote Kaspa node
docker run -i --rm --env KASPA_RPC_URL=http://your-kaspa-node:16110 ghcr.io/moldis/mcp-kaspa:latest

Build the Docker Image Locally (Optional)

If you prefer to build the image yourself:

cd /path/to/mcp-kaspa
docker build -t kaspa-mcp-server:latest .

Docker Notes

  • Use host.docker.internal instead of localhost when connecting to services on your host machine
  • The Docker image includes all necessary dependencies
  • Perfect for isolated execution environments
  • Images are automatically built and published on every tag push via GitHub Actions

🌍 Network Configuration

Kaspa RPC Endpoints

Local Node:

  • Default: http://localhost:16110
  • Docker: http://host.docker.internal:16110

Public Endpoints (examples):

  • https://kaspa-rpc.example.com

Environment Variables

  • KASPA_RPC_URL: Kaspa node RPC endpoint (required)
  • DEBUG: Set to true for verbose logging (optional)

🛠 Available Tools

  1. get_node_info - Get Kaspa node information and connection status
  2. get_block_by_hash - Get detailed information about a specific block by its hash
  3. get_latest_daa - Get the latest DAA (Difficulty Adjustment Algorithm) score
  4. get_block_dag_info - Get comprehensive BlockDAG information
  5. validate_address - Validate a Kaspa address format
  6. get_address_balance - Get balance for a specific Kaspa address
  7. get_address_utxos - Get UTXOs (Unspent Transaction Outputs) for specific addresses
  8. get_mempool_transactions - Get mempool transactions for specific addresses
  9. get_transaction_by_hash_mempool - Get a specific transaction from mempool by hash (mempool only, not blockchain history)

📚 Resources

  • kaspa://status - Server status and configuration
  • kaspa://docs/examples - Usage examples

📦 Installation

# Clone the repository
git clone https://github.com/moldis/mcp-kaspa.git
cd mcp-kaspa

# Pull pre-built Docker image (recommended)
docker pull ghcr.io/moldis/mcp-kaspa:latest

# OR build Docker image locally (optional)
docker build -t kaspa-mcp-server:latest .

🔍 Troubleshooting

Common Issues

"Broken Pipe" Error:

  • Fixed: The server now includes comprehensive error handling
  • Fixed: Graceful startup process with proper stdio communication
  • Fixed: Connection timeouts and better RPC error handling

"uvx not found":

  • Install uv: curl -LsSf https://astral.sh/uv/install.sh | sh (Unix) or powershell -c "irm https://astral.sh/uv/install.ps1 | iex" (Windows)
  • Use Docker method as alternative
  • Use direct Python method as fallback

"Cannot connect to Kaspa RPC":

  • Verify your Kaspa node is running and accessible
  • Check firewall settings
  • For Docker: use host.docker.internal instead of localhost
  • Server will start but functionality will be limited until RPC is accessible

MCP Client Can't Find Server:

  • Ensure the path to mcp-kaspa directory is correct
  • For uvx: path should point to directory containing pyproject.toml
  • For Docker: ensure image is built with correct tag
  • Check MCP client logs for detailed error messages

Verification Steps

  1. Test uvx installation:

    cd /path/to/mcp-kaspa
    echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"1.0.0","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | uvx --from . kaspa-mcp-server
    
  2. Test Docker setup:

    docker run -i --rm --env KASPA_RPC_URL=http://localhost:16110 ghcr.io/moldis/mcp-kaspa:latest
    
  3. Check server response: Should return a JSON response with "result":{"protocolVersion":"2025-06-18"...}

📝 Example Usage

Once configured in your MCP client, you can use tools like:

Basic Node Information

get_node_info()

Address Validation

validate_address("kaspa:qpauqsvk7yf9unexwmxsnmg547mhyga37csh0kj53q6xxgl24ydxjsgzthw5j")

Get Latest DAA Score

get_latest_daa()

Get Block Information

get_block_by_hash("block_hash_here")

Check Address Balance

get_address_balance("kaspa:your_address_here")

Get UTXOs

get_address_utxos(["kaspa:address1", "kaspa:address2"])

Get Transaction from Mempool

get_transaction_by_hash_mempool("transaction_hash_here")

📚 Additional Resources

📝 License

MIT License - see LICENSE file for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选