Cover image
Try Now
2025-04-12

比特币MCP服务器

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

Bitcoin MCP Server

A Go-based service that provides a unified interface to interact with a Bitcoin node through various RPC commands using the Model Context Protocol (MCP). The server organizes Bitcoin RPC functionality into logical categories and provides a clean, well-documented API for accessing blockchain data and operations.

Features

  • Comprehensive Bitcoin RPC interface using Model Context Protocol
  • Organized by functional categories:
    • Blockchain operations
    • Mempool operations
    • UTXO operations
    • Blockchain management
  • Secure authentication
  • Comprehensive error handling
  • Clean and documented API

Prerequisites

  • Go 1.24 or later
  • Bitcoin Core node with RPC enabled
  • Basic understanding of Bitcoin RPC commands

Installation

  1. Clone the repository:
git clone https://github.com/moncho/bitcoin-mcp.git
cd bitcoin-mcp
  1. Install dependencies:
go mod download
  1. Build the server:
go build -o bitcoin-mcp

Configuration

Create a configuration file (config.json) with the following structure:

{
    "bitcoin": {
        "rpc_url": "http://localhost:8332",
        "username": "your_rpc_username",
        "password": "your_rpc_password"
    },
    "server": {
        "port": 8080,
        "host": "localhost"
    }
}

Running the Server

  1. Start your Bitcoin Core node with RPC enabled:
bitcoind -server -rpcuser=your_rpc_username -rpcpassword=your_rpc_password
  1. Start the MCP server:
./bitcoin-mcp -config config.json

Or using environment variables:

BITCOIN_RPC_URL=http://localhost:8332 \
BITCOIN_RPC_USER=your_rpc_username \
BITCOIN_RPC_PASS=your_rpc_password \
./bitcoin-mcp

API Usage

The server provides a RESTful API for accessing Bitcoin RPC commands. Here are some examples:

Get Blockchain Information

curl -X POST http://localhost:8080/api/v1/blockchain/info

Get Block Data

curl -X POST http://localhost:8080/api/v1/blockchain/block \
  -H "Content-Type: application/json" \
  -d '{"blockhash": "0000000000000000000123456789abcdef", "verbose": true}'

Get Mempool Information

curl -X POST http://localhost:8080/api/v1/mempool/info

Development

Project Structure

bitcoin-mcp/
├── cmd/
│   └── server/          # Main server application
├── pkg/
│   ├── bitcoin/         # Bitcoin RPC client
│   └── tools/           # RPC command implementations
├── config.json          # Configuration file
└── README.md           # This file

Adding New RPC Commands

  1. Add the method to the Bitcoin client in pkg/bitcoin/client.go
  2. Create or update the corresponding tool in pkg/tools/
  3. Register the tool in the appropriate category
  4. Add tests for the new functionality

Testing

Run the test suite:

go test ./...

Security Considerations

  • Never expose RPC credentials in public repositories
  • Use secure passwords for RPC access
  • Consider rate limiting for public APIs
  • Validate all input parameters
  • Sanitize error messages

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Please follow the Contributing Guidelines when submitting changes.

Documentation

For detailed API documentation and specifications, see:

License

[Specify License Information]

Support

For support, please:

  1. Check the documentation
  2. Search existing issues
  3. Create a new issue if needed

Acknowledgments

  • Bitcoin Core developers
  • Go community
  • All contributors to this project

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • JackKuo666
  • 🔍使AI助手可以通过简单的MCP接口搜索和访问PYPI软件包信息。

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • appcypher
  • 很棒的MCP服务器 - 模型上下文协议服务器的策划列表

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

    Reviews

    3 (1)
    Avatar
    user_QFzzMMU7
    2025-04-18

    As a dedicated user of bitcoin-mcp, I find it incredibly practical for managing Bitcoin nodes. Created by moncho, this tool written in [language] simplifies node interaction remarkably. Its intuitive interface and comprehensive functionality make monitoring and controlling Bitcoin operations seamless. Highly recommend this for anyone in the crypto space! Check it out at https://github.com/moncho/bitcoin-mcp.