Counterparty MCP Server
Provides tools for interacting with the Bitcoin blockchain via the Counterparty protocol, including balance queries, asset management, DEX orders, dispensers, and transaction composition and broadcasting.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Counterparty MCP Server show me the order book for XCP/BTC"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
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):
{
"mcpServers": {
"counterparty": {
"command": "npx",
"args": ["-y", "@21e14/mcp-server"]
}
}
}Claude Code
claude mcp add counterparty -- npx -y @21e14/mcp-serverWith signing (see Signing & Broadcasting):
claude mcp add counterparty \
-e SIGNER_PRIVATE_KEY=L1aW4aubDFB7yfras2S1mN... \
-e SIGNER_ADDRESS=bc1q... \
-- npx -y @21e14/mcp-serverManage servers with claude mcp list, claude mcp get counterparty, or claude mcp remove counterparty.
VS Code (Copilot)
Use Ctrl+Shift+P → MCP: Add Server → Stdio, then enter:
npx -y @21e14/mcp-serverOr add to .vscode/mcp.json:
{
"servers": {
"counterparty": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@21e14/mcp-server"]
}
}
}Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"counterparty": {
"command": "npx",
"args": ["-y", "@21e14/mcp-server"]
}
}
}Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"counterparty": {
"command": "npx",
"args": ["-y", "@21e14/mcp-server"]
}
}
}ChatGPT
In ChatGPT desktop, go to Settings → Beta Features → MCP Servers, then add:
npx -y @21e14/mcp-serverAny MCP Client
The server speaks stdio. Point any MCP-compatible client at:
npx -y @21e14/mcp-serverThat's it. The agent can now query the Counterparty network and compose unsigned transactions.
Related MCP server: aibtc-mcp-server
Signing & Broadcasting
To let the agent sign and broadcast transactions, add a signing key:
{
"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)
Generate a fresh keypair offline. Don't reuse an existing wallet or generate keys through the AI.
Fund it with only what you're willing to risk. This is your blast radius.
Use a segwit address. P2WPKH (
bc1q...), P2SH-P2WPKH (3...), or P2TR (bc1p...). Legacy P2PKH is not supported.One key, one address. No HD derivation. Counterparty reuses addresses by design.
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
Variable | Required | Description |
| No | Counterparty node URL (default: |
| No | WIF-encoded private key for signing |
| No | Bitcoin address for the signing key |
Tools
Query (24)
Tool | Description |
| All token balances for an address |
| Single asset balance for an address |
| Asset metadata (supply, divisibility, issuer) |
| All holders of an asset |
| Search/list assets |
| Issuance history for an asset |
| Assets issued by an address |
| DEX orders |
| Single order by hash |
| Matches for an order |
| Order book for a trading pair |
| Orders involving an asset |
| Orders by address |
| Dispensers |
| Single dispenser by hash |
| Dispensers for an asset |
| Dispensers by address |
| Purchases from a dispenser |
| Dividend distributions for an asset |
| Transaction history for an address |
| Token transfers from an address |
| Single transaction by hash |
| Tokens attached to a UTXO |
| Latest block info |
Compose (18)
Tool | Description |
| Send tokens to an address |
| Multi-party multi-asset send |
| Place a DEX order |
| Cancel an open order |
| Pay for a matched BTC order |
| Create or update an asset (supports inscriptions) |
| Create, open, or close a dispenser |
| Buy from a dispenser |
| Distribute dividends to holders |
| Broadcast a message (supports inscriptions) |
| Sweep all assets to a destination |
| Permanently burn tokens |
| Create a fair launch (supports inscriptions) |
| XCP-420 compliant fair launch |
| Mint from an active fair launch |
| Attach tokens to a UTXO |
| Detach tokens from a UTXO |
| Move a UTXO to a new output |
Bitcoin (4)
Tool | Description |
| Sign and broadcast (requires signing keys) |
| Broadcast an already-signed transaction |
| Current fee rate estimate |
| Decode raw transaction hex |
Utility (3)
Tool | Description |
| Decode a Counterparty message from a transaction |
| Node status and version |
| Raw 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 tipscounterparty://xcp420-standard— XCP-420 fair launch standardcounterparty://quick-start— Step-by-step workflows for common operations
Development
git clone https://github.com/XCP/mcp-server.git
cd mcp-server
npm install
npm testTest locally:
{
"mcpServers": {
"counterparty": {
"command": "node",
"args": ["/path/to/mcp-server/dist/index.js"]
}
}
}License
MIT
Available Tools
48 toolsapi_requestA
Make a raw API request to any Counterparty REST endpoint not covered by the other tools. Full API reference: https://raw.githubusercontent.com/CounterpartyXCP/counterparty-core/refs/heads/master/apiary.apib — Example: endpoint="/v2/blocks/last", method="GET"
Inputs: endpoint (required), method, params.
broadcast_transactionADestructive
Broadcast a signed Bitcoin transaction to the network via the Counterparty node
Inputs: raw_transaction (required).
compose_attachA
Compose a transaction to attach Counterparty tokens to a specific UTXO
Inputs: asset (required), address (required), quantity (required), inputs_set, +2 more.
compose_broadcastB
Compose a transaction to broadcast a text message or numeric value to the Counterparty network
Inputs: text (required), address (required), value, mime_type, +5 more.
compose_btcpayA
Compose a BTC payment for a matched DEX order. Used to complete BTC trades on the DEX.
Inputs: address (required), order_match_id (required), inputs_set, sat_per_vbyte.
compose_cancelA
Compose a transaction to cancel an open DEX order
Inputs: address (required), offer_hash (required), inputs_set, sat_per_vbyte.
compose_destroyA
Compose a transaction to permanently destroy (burn) Counterparty tokens
Inputs: asset (required), address (required), quantity (required), tag, +2 more.
compose_detachA
Compose a transaction to detach Counterparty tokens from a UTXO back to an address
Inputs: utxo (required), destination (required), sat_per_vbyte.
compose_dispenseA
Compose a transaction to buy from a dispenser by sending BTC to it
Inputs: address (required), quantity (required), dispenser (required), inputs_set, +1 more.
compose_dispenserA
Compose a transaction to create, open, or close a dispenser. Dispensers automatically sell tokens for BTC.
Inputs: asset (required), address (required), give_quantity (required), mainchainrate (required), +5 more.
compose_dividendB
Compose a transaction to distribute dividends to all holders of an asset
Inputs: asset (required), address (required), dividend_asset (required), quantity_per_unit (required), +2 more.
compose_fairmintC
Compose a transaction to mint tokens from an active fair minter
Inputs: asset (required), address (required), quantity, inputs_set, +1 more.
compose_fairminterA
Compose a transaction to create a fair minting launch for a new asset. For XCP-420 compliant launches, use compose_xcp420_fairminter instead.
Inputs: asset (required), address (required), price, hard_cap, +17 more.
compose_issuanceA
Compose a transaction to issue (create) a new Counterparty asset, or update an existing one.
Inputs: asset (required), address (required), quantity (required), lock, +8 more.
compose_movetoutxoA
Compose a transaction to move a UTXO (and any attached tokens) to a new output
Inputs: utxo (required), destination, sat_per_vbyte.
compose_mpmaA
Compose a multi-party multi-asset send transaction. Sends multiple assets to multiple destinations in a single transaction. All three arrays must be the same length.
Inputs: assets (required), address (required), quantities (required), destinations (required), +4 more.
compose_orderA
Compose a DEX order to trade Counterparty assets. IMPORTANT: give_quantity and get_quantity are TOTAL amounts, not per-unit prices. The price per unit is the ratio between them. Example: to buy 1000 TOKENA at 0.5 XCP each, set give_asset=XCP, give_quantity=50010^8 (500 XCP total), get_asset=TOKENA, get_quantity=1000. Example: to sell 50 XCP for BTC at 0.001 BTC per XCP, set give_asset=XCP, give_quantity=5010^8, get_asset=BTC, get_quantity=50*100000 (0.05 BTC total).
Inputs: address (required), get_asset (required), expiration (required), give_asset (required), +5 more.
compose_sendC
Compose a transaction to send Counterparty tokens to an address
Inputs: asset (required), address (required), quantity (required), destination (required), +5 more.
compose_sweepA
Compose a transaction to sweep all assets and/or BTC from one address to another
Inputs: address (required), destination (required), memo, flags, +2 more.
compose_xcp420_fairminterA
Compose a XCP-420 compliant fair launch. XCP-420 is a community standard that enforces fixed parameters: 10M supply, 4.2M soft cap, 0.1 XCP per mint, 1000 tokens per mint, 1000 block duration, no premine, no commission, burn payment, locked supply. Only the asset name, start block, and description are configurable.
Inputs: asset (required), address (required), start_block (required), inputs_set, +2 more.
decode_transactionARead-only
Decode a raw Bitcoin transaction hex into its components (inputs, outputs, etc.)
Inputs: raw_transaction (required).
get_address_dispensersARead-only
Get all dispensers created by a specific address
Inputs: address (required), limit, cursor, offset, +1 more.
get_address_ordersARead-only
Get all DEX orders placed by a specific address
Inputs: address (required), limit, cursor, offset, +1 more.
get_address_transactionsARead-only
Get transaction history for a Bitcoin address on Counterparty
Inputs: address (required), limit, cursor, offset.
get_asset_balancesBRead-only
Get all balances for a specific asset across all holders
Inputs: asset (required), limit, cursor, offset.
get_asset_infoARead-only
Get metadata for a Counterparty asset (supply, divisibility, issuer, description, etc.)
Inputs: asset (required).
get_asset_ordersBRead-only
Get all DEX orders involving a specific asset
Inputs: asset (required), limit, cursor, offset, +1 more.
get_assetsCRead-only
Search or list Counterparty assets
Inputs: limit, named, cursor, offset.
get_balanceARead-only
Get the balance of a specific asset for a Bitcoin address
Inputs: asset (required), address (required).
get_balancesARead-only
Get all Counterparty token balances for a Bitcoin address
Inputs: address (required), limit, cursor, offset.
get_dispenserARead-only
Get details of a specific dispenser by its transaction hash
Inputs: hash (required).
get_dispensersBRead-only
Get Counterparty dispensers (default: open)
Inputs: limit, cursor, offset, status.
get_dispensers_by_assetARead-only
Get dispensers for a specific asset (default: open)
Inputs: asset (required), limit, cursor, offset, +1 more.
get_dispensesARead-only
Get dispense records (purchases) for a specific dispenser
Inputs: hash (required), limit, cursor, offset.
get_dividendsARead-only
Get dividend distributions for a specific asset
Inputs: asset (required), limit, cursor, offset.
get_fee_estimateARead-only
Get current Bitcoin fee rates in sat/vB. Queries the Counterparty node first, falls back to mempool.space. Use the returned values directly as sat_per_vbyte in compose tools.
Inputs: conf_target.
get_issuancesARead-only
Get the issuance history for a Counterparty asset
Inputs: asset (required), limit, cursor, offset.
get_latest_blockARead-only
Get the latest block information from the Counterparty node
Inputs: no named parameters.
get_orderARead-only
Get details of a specific DEX order by its transaction hash
Inputs: order_hash (required).
get_order_matchesARead-only
Get matches for a specific DEX order
Inputs: order_hash (required), limit, cursor, offset, +1 more.
get_ordersCRead-only
Get orders on the Counterparty DEX (default: open)
Inputs: limit, cursor, offset, status.
get_orders_by_pairARead-only
Get the order book for a specific trading pair on the DEX
Inputs: asset1 (required), asset2 (required), limit, cursor, +2 more.
get_owned_assetsBRead-only
Get all assets issued/owned by a specific address
Inputs: address (required), limit, cursor, offset.
get_sendsARead-only
Get all sends (token transfers) from a specific address
Inputs: address (required), limit, cursor, offset.
get_server_infoARead-only
Get Counterparty node status, version, and network information
Inputs: no named parameters.
get_transactionARead-only
Get details of a specific Counterparty transaction by its hash
Inputs: tx_hash (required).
get_utxo_balancesARead-only
Get Counterparty token balances attached to a specific UTXO
Inputs: utxo (required).
unpack_transactionARead-only
Decode and unpack a Counterparty message from a raw transaction, revealing the embedded Counterparty data
Inputs: raw_transaction (required), block_index.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 48 tools
Most tools are clearly distinct by resource and action, but there are many similar get_* tools that differ only by filter (by_asset, by_address, by_pair), which could cause confusion. The descriptions help, but the sheer number of similar patterns creates some ambiguity.
Uses a consistent verb_noun snake_case pattern (get_ for reads, compose_ for transaction building). Some deviations like api_request, compose_mpma, compose_movetoutxo, and unpack_transaction vs decode_transaction slightly break the pattern, but it's mostly predictable.
48 tools is far beyond the typical range. Even though the Counterparty protocol is complex, this many tools creates a heavy surface that agents must navigate. The api_request catch-all further suggests the count could have been trimmed.
The tool set covers most core Counterparty operations: assets, orders, dispensers, dividends, sends, issuance, and various compose actions. The api_request tool provides a fallback for missing endpoints. Minor gaps exist (e.g., no specific query for fairminters), but it's generally complete.
Maintenance
Related MCP Connectors
Bitcoin RPC for AI agents. 7 read tools; x402 USDC on Base mainnet. Discovery is free.
Provide AI agents and automation tools with contextual access to blockchain data including balance…
16 Bitcoin, business, data, text, and developer tools for AI agents over one MCP endpoint.
Give AI agents a Bitcoin wallet with Lightning Network payments and L402 support.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables secure interactions with cryptocurrency daemon RPC interfaces through AI assistants, supporting transaction management, wallet operations, and daemon monitoring for Bitcoin-derived cryptocurrencies.1MIT

aibtc-mcp-serverofficial
AlicenseCqualityAmaintenanceA Bitcoin-native MCP server for AI agents that provides 150+ tools for BTC and Stacks operations. Supports wallets, DeFi yield, sBTC peg, NFTs, and x402 payments.3902,975 npm12MIT- AlicenseCqualityDmaintenanceEnables AI applications to interact with the Bitcoin Network, manage wallets, check balances, convert prices, and send transactions.46MIT
- AlicenseAqualityCmaintenanceEnables AI agents to manage Bitcoin micropayments, service offers, and escrow contracts through MCP tools, without requiring a Lightning node.8MIT