nockchain-mcp
Enables agents to read Nockchain data through seven read-only tools, including accurate balance lookups, payment verification with confirmations, block and transaction inspection, and endpoint health monitoring. It resolves balances missed by the public address selector and avoids answering from stale nodes.
README
nockchain-agent
A typed TypeScript client and an MCP server for reading Nockchain from an agent.
Built by Prism. Not affiliated with, endorsed by, or operated by Nockchain, Nock Community Co, Zorp, or National Compute.
Install
npm install nockchain-agent-sdk
The MCP server runs straight from npm:
npx nockchain-mcp
Node 20 or newer.
Read a balance
import { NockchainClient } from "nockchain-agent-sdk";
const client = new NockchainClient();
const balance = await client.getBalance("2s3K...");
console.log(`${balance.nock} NOCK (${balance.nicks} nicks) across ${balance.notes.length} notes`);
Verify a payment
Issue one address per invoice, then ask whether it has been paid:
import { NockchainClient } from "nockchain-agent-sdk";
const client = new NockchainClient();
const result = await client.verifyPayment({
address: invoiceAddress,
minNock: "1.5",
sinceHeight: 133400,
confirmations: 3,
});
if (result.paid) {
console.log(`${result.confirmedNock} NOCK settled at height ${result.tipHeight}`);
}
Use it from an MCP client
{
"mcpServers": {
"nockchain": {
"command": "npx",
"args": ["-y", "nockchain-mcp"]
}
}
}
Seven tools, all read-only:
| tool | what it answers |
|---|---|
nock_tip |
current height, with a freshness reading per endpoint |
nock_balance |
what an address can spend right now |
nock_verify_payment |
has this address been paid, with confirmations |
nock_block |
block contents by height or block ID |
nock_transaction |
transaction contents, or why the node could not decode them |
nock_metrics |
cache and refresh state of the selected endpoint, and its peer table |
nock_endpoints |
the full endpoint health table |
Why this exists
Two things about reading Nockchain today cost more time than they should.
Balances come back as zero. The public WalletGetBalance call accepts an address selector, and for notes in the current v1 format that selector returns nothing at all. The balance lives under the note first-name, which you reach by hashing the pay-to-pubkey-hash behind the address. Two derivations matter, because coinbase notes lock differently from ordinary ones, and the real balance is the union of both. getBalance does that work and returns the figure the address can actually spend.
Public nodes go stale quietly. Three endpoints, measured within the same minute on 2026-08-25:
| endpoint | height | age of its chain state |
|---|---|---|
api.nockscan.net:443 |
133598 | 157 s |
23.252.122.18:5556 |
133598 | 214 s |
rpc.nockbox.org:443 |
133226 | 50625 s, close to 14 hours |
A response carries no sign of which of these answered it. The client probes every endpoint in its pool and declines to read from one that fails the freshness threshold, raising a typed error that names the ages it measured. client.health() returns the whole table.
Limitations
Read-only. No signing library for Nockchain exists, so sending NOCK needs the official nockchain-wallet CLI. The SDK will submit a transaction the CLI has already produced. It will not build or sign one.
A balance is the live unspent-note set. It answers what an address can spend at the current tip. A spent note leaves the set, so the total is no record of what an address has received over its lifetime. Nothing the wallet sends carries a memo or a tag on the wire either, which is why payment correlation works by issuing one address per invoice.
Upstream GetTransactionDetails fails on transactions produced after the Logos upgrade. The node answers with a decoder error instead of the transaction. getTransactionDetails catches that case and returns { ok: false, reason: "upstream_decoder_bug", txId, fallback }, where fallback carries the inclusion facts that GetTransactionBlock and GetBlockDetails could still establish, such as the block height and its timestamp.
The public API is alpha and unauthenticated. There is no key to obtain and no rate limit to plan against. Endpoints move and lag without notice.
Packages
| package | contents |
|---|---|
nockchain-agent-sdk |
the client and the note first-name derivation it depends on |
nockchain-mcp |
the stdio MCP server built on it |
Examples
The examples import the workspace build, so build it once first.
npm install
npm run build
node examples/balance.mjs 2s3K...
node examples/verify-payment.mjs 2s3K... 1.5
Both read the public network.
Development
npm install
npm run build
npm test
Tests run offline against fixtures, including the golden vectors generated from the upstream Rust crates. Nothing in the test suite opens a socket.
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。