io.github.XCP/mcp-server

平台与服务

by xcp

与 Bitcoin 上的 Counterparty 代币协议交互的 MCP server,支持查询、组合交易以及签名等操作。

什么是 io.github.XCP/mcp-server

与 Bitcoin 上的 Counterparty 代币协议交互的 MCP server,支持查询、组合交易以及签名等操作。

README

Counterparty MCP Server

Give AI agents the ability to interact with Counterparty — the token protocol built on Bitcoin. Query balances, assets, orders, and dispensers. Compose, sign, and broadcast transactions. Works with any MCP-compatible client.

npm

Install

No download needed — just add the config below to your AI client. npx fetches and runs the server automatically.

Claude Desktop

Add to claude_desktop_config.json (how to find it):

json
{
  "mcpServers": {
    "counterparty": {
      "command": "npx",
      "args": ["-y", "@21e14/mcp-server"]
    }
  }
}

Claude Code

bash
claude mcp add counterparty -- npx -y @21e14/mcp-server

With signing (see Signing & Broadcasting):

bash
claude mcp add counterparty \
  -e SIGNER_PRIVATE_KEY=L1aW4aubDFB7yfras2S1mN... \
  -e SIGNER_ADDRESS=bc1q... \
  -- npx -y @21e14/mcp-server

Manage servers with claude mcp list, claude mcp get counterparty, or claude mcp remove counterparty.

VS Code (Copilot)

Use Ctrl+Shift+PMCP: Add ServerStdio, then enter:

code
npx -y @21e14/mcp-server

Or add to .vscode/mcp.json:

json
{
  "servers": {
    "counterparty": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@21e14/mcp-server"]
    }
  }
}

Cursor

Add to .cursor/mcp.json:

json
{
  "mcpServers": {
    "counterparty": {
      "command": "npx",
      "args": ["-y", "@21e14/mcp-server"]
    }
  }
}

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

json
{
  "mcpServers": {
    "counterparty": {
      "command": "npx",
      "args": ["-y", "@21e14/mcp-server"]
    }
  }
}

ChatGPT

In ChatGPT desktop, go to Settings → Beta Features → MCP Servers, then add:

code
npx -y @21e14/mcp-server

Any MCP Client

The server speaks stdio. Point any MCP-compatible client at:

bash
npx -y @21e14/mcp-server

That's it. The agent can now query the Counterparty network and compose unsigned transactions.

Signing & Broadcasting

To let the agent sign and broadcast transactions, add a signing key:

json
{
  "mcpServers": {
    "counterparty": {
      "command": "npx",
      "args": ["-y", "@21e14/mcp-server"],
      "env": {
        "SIGNER_PRIVATE_KEY": "L1aW4aubDFB7yfras2S1mN...",
        "SIGNER_ADDRESS": "bc1q..."
      }
    }
  }
}

This enables the sign_and_broadcast tool. Signing gives the AI agent the ability to spend funds — read the security guidance below.

Bot wallet pattern (recommended)

  1. Generate a fresh keypair offline. Don't reuse an existing wallet or generate keys through the AI.
  2. Fund it with only what you're willing to risk. This is your blast radius.
  3. Use a segwit address. P2WPKH (bc1q...), P2SH-P2WPKH (3...), or P2TR (bc1p...). Legacy P2PKH is not supported.
  4. One key, one address. No HD derivation. Counterparty reuses addresses by design.
  5. Keep main holdings elsewhere. The bot wallet is disposable.

Compose-only mode

Without signing keys, the server returns unsigned transaction hex from all compose tools. You can review and sign offline with your own tooling. This is the safest mode.

Transaction verification

sign_and_broadcast extracts and returns the embedded OP_RETURN data from the transaction before signing — done locally without trusting the API, so the agent can verify the transaction matches what was requested.

Environment Variables

VariableRequiredDescription
COUNTERPARTY_NODENoCounterparty node URL (default: https://api.counterparty.io:4000)
SIGNER_PRIVATE_KEYNoWIF-encoded private key for signing
SIGNER_ADDRESSNoBitcoin address for the signing key

Tools

Query (24)

ToolDescription
get_balancesAll token balances for an address
get_balanceSingle asset balance for an address
get_asset_infoAsset metadata (supply, divisibility, issuer)
get_asset_balancesAll holders of an asset
get_assetsSearch/list assets
get_issuancesIssuance history for an asset
get_owned_assetsAssets issued by an address
get_ordersDEX orders
get_orderSingle order by hash
get_order_matchesMatches for an order
get_orders_by_pairOrder book for a trading pair
get_asset_ordersOrders involving an asset
get_address_ordersOrders by address
get_dispensersDispensers
get_dispenserSingle dispenser by hash
get_dispensers_by_assetDispensers for an asset
get_address_dispensersDispensers by address
get_dispensesPurchases from a dispenser
get_dividendsDividend distributions for an asset
get_address_transactionsTransaction history for an address
get_sendsToken transfers from an address
get_transactionSingle transaction by hash
get_utxo_balancesTokens attached to a UTXO
get_latest_blockLatest block info

Compose (18)

ToolDescription
compose_sendSend tokens to an address
compose_mpmaMulti-party multi-asset send
compose_orderPlace a DEX order
compose_cancelCancel an open order
compose_btcpayPay for a matched BTC order
compose_issuanceCreate or update an asset (supports inscriptions)
compose_dispenserCreate, open, or close a dispenser
compose_dispenseBuy from a dispenser
compose_dividendDistribute dividends to holders
compose_broadcastBroadcast a message (supports inscriptions)
compose_sweepSweep all assets to a destination
compose_destroyPermanently burn tokens
compose_fairminterCreate a fair launch (supports inscriptions)
compose_xcp420_fairminterXCP-420 compliant fair launch
compose_fairmintMint from an active fair launch
compose_attachAttach tokens to a UTXO
compose_detachDetach tokens from a UTXO
compose_movetoutxoMove a UTXO to a new output

Bitcoin (4)

ToolDescription
sign_and_broadcastSign and broadcast (requires signing keys)
broadcast_transactionBroadcast an already-signed transaction
get_fee_estimateCurrent fee rate estimate
decode_transactionDecode raw transaction hex

Utility (3)

ToolDescription
unpack_transactionDecode a Counterparty message from a transaction
get_server_infoNode status and version
api_requestRaw API request to any endpoint (full API reference)

Resources

The server includes protocol documentation that agents can read for context:

  • counterparty://protocol-overview — Assets, quantities, DEX, dispensers, fair minting, fees, and operational tips
  • counterparty://xcp420-standard — XCP-420 fair launch standard
  • counterparty://quick-start — Step-by-step workflows for common operations

Development

bash
git clone https://github.com/XCP/mcp-server.git
cd mcp-server
npm install
npm test

Test locally:

json
{
  "mcpServers": {
    "counterparty": {
      "command": "node",
      "args": ["/path/to/mcp-server/dist/index.js"]
    }
  }
}

License

MIT

常见问题

io.github.XCP/mcp-server 是什么?

与 Bitcoin 上的 Counterparty 代币协议交互的 MCP server,支持查询、组合交易以及签名等操作。

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描123.0k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描123.0k

邮件模板

by alirezarezvani

Universal
热门

快速搭建生产可用的事务邮件系统:生成 React Email/MJML 模板,接入 Resend、Postmark、SendGrid 或 AWS SES,并支持本地预览、i18n、暗色模式、反垃圾优化与追踪埋点。

面向营销与服务场景,快速搭建高质量邮件模板,省去反复设计与切图成本,成熟度和社区认可都很高。

平台与服务
未扫描12.5k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
84.2k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.5k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
38.1k

评论