MCP Tap asset operations
MCP Tap asset operations let an MCP client inspect and move Taproot Assets in a Polar network. The tools select a network and a Tap node, call the node's Tap service, and return small results that an agent can use to create addresses, mint assets, send assets, or bring asset data into agreement with a Tap Universe.
Scope and mental model
Taproot Assets are assets managed by a tapd node or by a litd node with integrated Tap support. A Tap node is either of these node types as seen by the MCP tools. Each request names the network and the Tap node because the same application can run more than one isolated network.
The tools use the application state as the boundary between MCP and the running node. A read operation refreshes the needed state before it returns data. A write operation may also use the network's Lightning and Bitcoin services to provide the funds and confirmations needed by the local Tap node.
The parent page, Application state and MCP tools, explains the shared MCP path. MCP network operations explains how an agent finds and controls the networks and nodes used here.
MCP request path
The request path turns an MCP tool call into a node action and then returns a JSON result to the caller. The registry exposes one definition for each tool, while the Tap model connects that definition to the selected node.
This diagram shows the high-level path for both read and write operations.
flowchart LR
Client[MCP client] --> Bridge[Local MCP bridge]
Bridge --> Renderer[MCP tool handler]
Renderer --> Registry[Tap tool registry]
Registry --> State[Network and Tap state]
State --> Service[Tap service]
Service --> Node[tapd or litd Tap node]
Node --> Service
Service --> State
State --> Renderer
Renderer --> Bridge
Bridge --> Client
Service -. write support .-> Bitcoin[Bitcoin and Lightning services]
Network and node selection
Every Tap MCP tool requires networkId and a node name. The lookup first selects the network, then accepts a node from the Tap node set or maps a named litd Lightning node to its integrated Tap service. A missing network or an unknown node stops the operation before the node is called. References: src/…/helpers.ts• L57-70, src/…/helpers.ts• L187-200, src/…/getTapBalances.ts• L57-75
The tool results use normalized asset and address data. This keeps the MCP contract stable even though the node API returns binary values and nested response objects. References: src/…/types.ts• L5-48, src/…/tapdService.ts• L10-25, src/…/tapdService.ts• L71-106
Tool exposure
The Tap operations are part of the common MCP tool list. The list contains the seven operations described on this page: asset listing, balance lookup, address creation, address decoding, asset minting, asset sending, and Universe synchronization. References: src/…/toolRegistry.ts• L234-274, src/…/index.ts• L149-159
Asset information
Asset information tools give an agent a current view of what a Tap node knows. Asset listings describe the assets held by the node, while balance results focus on the current amount for each asset.
Asset listings
list_tap_assets lists the assets known by one Tap node. It returns the network ID, a count, and asset records with an ID, name, type, amount, genesis point, anchor outpoint, group key, decimals, and node name. This is the broad identity view to use before an agent chooses an asset for a later operation. References: src/…/listTapAssets.ts• L9-33, src/…/listTapAssets.ts• L35-55, src/…/listTapAssets.ts• L77-105
Tap balances
get_tap_balances refreshes the selected node's balances and returns a balances list. Each balance includes the asset ID, name, type, balance, and genesis point. An empty list means that the selected node has no balance data to report; it does not identify an asset or node on its own. References: src/…/getTapBalances.ts• L10-19, src/…/getTapBalances.ts• L21-41, src/…/getTapBalances.ts• L63-75
The application keeps asset records and balances per node. It also combines on-chain assets with asset capacity in Lightning channels when it builds the overall asset view, so an agent should treat a node balance and channel capacity as related but distinct views. References: src/…/tap.ts• L25-33, src/…/tap.ts• L135-175
Address operations
Tap addresses identify an asset and an amount for a transfer. The address tools separate creation from inspection: one creates a receiver address for a known asset, and the other reads the asset and amount from an existing address.
Address creation
get_tap_address creates a Taproot Asset address on a named node for an assetId and an amount. It returns the encoded address together with normalized asset and key data. The amount is supplied as a string so the caller can preserve the asset amount across the tool boundary. References: src/…/getTapAddress.ts• L9-14, src/…/getTapAddress.ts• L16-40, src/…/getTapAddress.ts• L49-59
An address is the input expected by send_tap_asset. A common flow is to create or receive an address, decode it to check the destination asset and amount, and only then send the asset from a source node. References: src/…/getTapAddress.ts• L55-59, src/…/decodeTapAddress.ts• L60-70, src/…/sendTapAsset.ts• L78-98
Address decoding
decode_tap_address checks a Tap address through the selected node and returns the encoded address, asset ID, amount, and an optional local asset name. The name comes from the selected node's known asset data, so an address can decode correctly even when that local name is absent. References: src/…/decodeTapAddress.ts• L8-19, src/…/decodeTapAddress.ts• L21-41, src/…/decodeTapAddress.ts• L60-70
The application formats a decoded amount with the asset's known decimal setting. If the asset is not in the node's current asset list, it uses zero decimals and may omit the name. This makes a fresh asset listing or synchronization useful when a human-readable amount is important. References: src/…/tap.ts• L366-381, src/…/listTapAssets.ts• L83-99
Asset creation and transfer
Minting creates a new asset on a node. Sending consumes an address and moves an asset to its destination. Both operations can arrange local Bitcoin funding automatically because Tap transactions need the node's Lightning and Bitcoin support.
Asset minting
mint_tap_asset creates either a normal asset or a collectible. A normal asset uses the requested amount and can use zero through eight decimal places. A collectible always has a supply of one. Optional emission support creates an asset group for future supply. References: src/…/mintTapAsset.ts• L14-37, src/…/mintTapAsset.ts• L39-101
The tool finalizes the mint by default and returns a success message with the network, node, asset name, asset type, amount, and batch key. The amount for a normal asset is the total number of base units; decimals control how that supply is displayed. References: src/…/mintTapAsset.ts• L144-165
When autoFund is enabled, the operation deposits Bitcoin to the Lightning node linked to the Tap node. When finalize is enabled, it finalizes the pending batch and starts local block mining so the new asset can confirm. These defaults make the tool suited to a self-contained local network, but they also add dependencies beyond the Tap node itself. References: src/…/tap.ts• L240-300, src/…/mintTapAsset.ts• L127-153
Asset sending
send_tap_asset sends the asset represented by a Tap address from a named source node. It returns a success message and the transfer result after the application submits the transfer. The optional autoFund setting defaults to true and can fund the source node's linked Lightning backend before the send. References: src/…/sendTapAsset.ts• L9-24, src/…/sendTapAsset.ts• L27-55, src/…/sendTapAsset.ts• L78-98
After a send, the application mines confirmation blocks and refreshes Tap information while it waits for the affected balance to change. The refresh runs for up to ten seconds, so the returned transfer result and the next balance read should not be treated as the same event. References: src/…/tap.ts• L315-363
Tap Universe synchronization
A Tap Universe is the shared source of asset proof and identity data between Tap nodes. sync_tap_universe tells one node to synchronize with another node in the same network, then refreshes the receiving node's assets, balances, and asset roots.
Universe peer selection
sync_tap_universe requires a receiving nodeName and a separate universeNodeName. The result reports the number of assets synchronized. The source node's implementation determines the service address used for the sync, so the named Universe node must be running and reachable through its Tap endpoint. References: src/…/syncTapUniverse.ts• L8-39, src/…/syncTapUniverse.ts• L53-66
The sync updates more than the Universe proof data. It calls the normal Tap information refresh after the peer sync, which brings the selected node's asset list, balances, and roots back into the application state. References: src/…/tap.ts• L303-309, src/…/tap.ts• L214-218
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the tool definition, MCP model entry, and central tool registry aligned when a Tap tool is added, renamed, or removed.
- Preserve the shared
TapNodelookup behavior so namedlitdnodes continue to reach their integrated Tap service. - Keep amount and asset-ID normalization aligned between the Tap service and the MCP result types. Address creation and decoding must use the same representation.
- Revisit the Bitcoin and Lightning funding path when changing
autoFund, mint finalization, or send confirmation behavior. - Revisit Universe endpoint selection when changing node implementations or the network mapping for
tapdandlitdnodes. - Update the parent MCP page when the set of exposed Tap operations or their cross-system effects changes.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| The network ID or Tap node name is missing or does not identify a node in that network. | The tool fails before it reaches the Tap service. | Pass the network ID and the exact node name returned by the network tools. |
| The selected node is not running or its Tap credentials or endpoint cannot be used. | Reads, address actions, minting, sending, or sync return an error from the node service. | Start the node first and use the network page to confirm its role and state. |
| Automatic funding is enabled but the linked Lightning or Bitcoin path cannot provide funds. | Minting or sending stops before the Tap transaction completes. | Set autoFund deliberately and confirm the linked Lightning node and Bitcoin wallet are usable. |
| A normal asset uses an amount or decimal setting that does not match the caller's unit model. | The created supply or displayed amount is not what the caller expects. | Treat amount as base units and keep decimals between 0 and 8. |
| The Universe source node is wrong, stopped, or unreachable. | Synchronization fails or does not provide the expected asset data. | Select a live Tap node in the same network and sync before relying on local names or decimal display. |
| Confirmation or state refresh is still in progress after a write. | A follow-up read can briefly show old balances or asset data. | Re-read after the operation and allow the local confirmation and refresh work to finish. |
Key files
| File | Why to read it |
|---|---|
| src/…/getTapBalances.ts | Shows the read flow from MCP arguments to refreshed node balances. |
| src/…/listTapAssets.ts | Defines the asset identity view returned to an MCP client. |
| src/…/getTapAddress.ts | Defines the inputs and result for creating a transfer address. |
| src/…/decodeTapAddress.ts | Shows how an encoded address becomes asset and amount data. |
| src/…/mintTapAsset.ts | Defines normal and collectible mint behavior and its optional controls. |
| src/…/sendTapAsset.ts | Defines the source-node and address contract for transfers. |
| src/…/syncTapUniverse.ts | Defines the two-node Universe synchronization contract. |
| src/…/tap.ts | Connects MCP actions to state refresh, funding, confirmation, and Tap service calls. |
| src/…/tapdService.ts | Shows the normalized boundary between application actions and Tap node responses. |
| src/…/toolRegistry.ts | Shows how Tap tool definitions and executors become available to MCP clients. |
| electron/…/tapdProxyServer.ts | Shows the process boundary used to reach the running Tap node. |