BSV DocsBSV Docs

Connect your AI tool with MCP

Connect Claude Code to the BSV docs through MCP, the Model Context Protocol an AI tool uses to call an outside server for information. With it, your agent searches and reads these pages before it writes BSV code. Use it when an AI agent builds your BSV app. Without a source, the agent can pick the wrong network or put a private key in your code. At the end, the docs server is connected to your project, and you know what Simple MCP adds and where its code needs care.

Before you begin

  • Claude Code installed. This guide was tested with Claude Code 2.1.286.
  • Node.js 18 or newer, only for Simple MCP, which runs through npx.

How it works

Two MCP servers give the agent BSV knowledge in different ways. The BSV docs server runs at https://bsv.writedocs.io/mcp, and Simple MCP is the @bsv/simple-mcp package:

  • BSV docs server
    Gives the agent
    Search and full pages of these docs, as Markdown
    Use it for
    Answers and code that follow these guides, starting on testnet
  • Simple MCP
    Gives the agent
    API notes and code generators for @bsv/simple
    Use it for
    Looking up the @bsv/simple API. Check its code before you run it

Claude Code adds each server to the current project only, so run the commands in your project folder.

Connect the BSV docs server

The docs server runs on this site and needs no login or API key:

Add the server

Add the server under the name bsv-docs:

claude mcp add --transport http bsv-docs https://bsv.writedocs.io/mcp
Added HTTP MCP server bsv-docs with URL: https://bsv.writedocs.io/mcp to local config

The name is the one Claude Code shows for the server, so you can pick another.

Check the connection

List the servers in the project:

claude mcp list
bsv-docs: https://bsv.writedocs.io/mcp (HTTP) - ✔ Connected

The agent now has three tools to read the docs:

ToolWhat it does
list_docsLists every page with its title, path, address and description
search_docsSearches the docs by keywords and returns the best matching pages with a snippet of each, 5 by default and up to 20
get_docReturns one or more pages in full, as Markdown, by path or address

Ask Claude Code a BSV question in the same project, and it calls search_docs and get_doc before it answers. For a first payment, the docs lead the agent to Send a payment from a web app, where a testnet wallet in BSV Desktop approves the payment and no private key goes in your code.

The page addresses in the results use docs.bsvblockchain.org. To read a page, the agent passes its path to get_doc, which works with or without the site address.

Add Simple MCP

Simple MCP is a separate server for @bsv/simple, a library built on top of the BSV SDK. This section uses version 0.0.2 of the @bsv/simple-mcp package, which writes code for @bsv/simple 0.2.x, while npm has 0.7.0. Its server wallet setup uses a random private key when the SERVER_PRIVATE_KEY variable is not set. Its payment code failed in our test on testnet with @bsv/simple 0.7.0, since the payment was sent but never reached the recipient.

Simple MCP writes Mainnet code only, so a payment it generates spends real BSV and cannot be undone. Read and adapt anything it generates before you run it.

Add the server

Add the server with the command from its README:

claude mcp add simple-mcp -- npx -y @bsv/simple-mcp
Added stdio MCP server simple-mcp with command: npx -y @bsv/simple-mcp to local config

Claude Code starts the server through npx, which downloads the package the first time.

Check the connection

List the servers again:

claude mcp list
simple-mcp: npx -y @bsv/simple-mcp - ✔ Connected

Simple MCP gives the agent three kinds of content:

KindWhat it offers
Resources11 simple:// pages: the @bsv/simple API for wallets, tokens, inscriptions, MessageBox, certification, DID, credentials and overlays, plus guides for Next.js, common mistakes and patterns. The DID and credentials pages describe tooling that @bsv/simple 0.7.0 removed
Tools9 code generators: scaffold_nextjs_config, generate_wallet_setup, generate_payment_handler, generate_token_handler, generate_inscription_handler, generate_messagebox_setup, generate_server_route, generate_credential_issuer and generate_did_integration
Prompts3 prompts: integrate_simple, add_bsv_feature and debug_simple

Remove a server

Run the command with the name you gave the server:

claude mcp remove simple-mcp -s local
Removed MCP server simple-mcp from local config

Next steps

With the docs server connected, ask your agent to build a first payment from the guides, then check it on the explorer: