Nostr MCP
Fetches and reads official Nostr NIP documentation from the Nostr NIPs repository hosted on GitHub.
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., "@Nostr MCP show me NIP-19, I want to understand npub vs nprofile"
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.
Nostr MCP
This is an MCP implementation that allows AI agents to access Nostr documentation.
Tools
When enabled, agents will gain access to the following tools.
read_nip(nip): Fetches and reads a NIP in markdown from the official Nostr NIPs repository
fetch_event(identifier): Fetches a Nostr event using a nip19 identifier (npub, nprofile, naddr, note, nevent). For npub/nprofile, returns the user's profile (kind 0). For naddr, returns the addressable event. Special handling for kind 30817 (NIP documents) returns just the content, while other kinds return the full event JSON.
search_community_nips(query?, limit?, kind?, author?): Discovers NostrHub community NIPs (kind 30817) on Ditto and Dreamith. Omit
queryto browse recent documents, or supply keywords for NIP-50 search. Optionally filter by documented eventkindor author hex public key. Returns up to 100 results (default 20) with titles, author, documented kinds, previews, NostrHub links, and relay-hintednaddridentifiers forfetch_event. Results are deduplicated by author and identifier; coverage depends on the relays, and community documents are not official NIPs.read_kind(kind): Fetches and reads a kind doc from nostrbook.dev
read_tag(tag): Fetches and reads a tag doc from nostrbook.dev
read_protocol(doc): Fetches and reads a a protocol doc ("event", "filter", "client", "relay", etc) from nostrbook.dev
read_nips_index(): Fetches and reads the NIPs README to fill in any missing blanks
generate_kind(range): Suggests a kind number absent from the fetched official NIPs index (regular: 1000-9999, replaceable: 10000-19999, ephemeral: 20000-29999, addressable: 30000-39999). This is not a reservation or a guarantee of global uniqueness; the index is not exhaustive.
Related MCP server: n8n-MCP
Installation
Requires Node.js 24 or newer. The server uses stdio; stdout is reserved for MCP messages.
VSCode
In your project, create .vscode/mcp.json:
{
"servers": {
"nostr": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@nostrbook/mcp@latest"]
}
}
}Now the MCP will be available to Copilot. For more information, see Use MCP servers in VS Code.
Goose
To install as a Goose extension:
Run
goose configureChoose "Add Extension"
Choose "Command-line Extension"
Enter "nostr" as the name
Enter
npx -y @nostrbook/mcp@latestas the command
Development
npm ci
npm run verifyverify runs type checking, unit/tool tests, a build, local WebSocket relay tests,
and a production-install test of the packed npm artifact. The package test uses a
temporary directory and may contact npm to install dependencies. Tool requests use
local fixtures, so public documentation and relays are not required for these tests.
CI runs this suite on Node 24 and 26.
npm run dev # run the source server over stdio
npm run build # produce dist/mcp
npm run test:live # check public documentation endpoints
NOSTR_SMOKE_IDENTIFIER=npub1... npm run test:live # also check a known public event/profileFor a local MCP client, use node /absolute/path/to/nostrbook-mcp/dist/mcp
after installing dependencies and building. Restart the client after rebuilding.
Configuration and troubleshooting
NOSTRBOOK_BASE_URL: alternate documentation service (defaulthttps://nostrbook.dev).NIPS_URL_TEMPLATE: alternate NIP source containing{nip}(defaults to the official GitHub raw URL).HTTP documentation requests time out after 10 seconds.
Event lookups try valid relay hints first, then the default relay set if hints fail or return nothing. Each attempt is bounded to 8 seconds (up to 16 seconds with fallback).
Profile/addressable lookups choose the newest returned event; ties use the lowest event ID.
Relay cleanup waits at most 500 ms so a missing WebSocket close event cannot block a tool result. Community discovery has an 8-second query timeout and may return partial results.
Missing documents, network failures, and missing events return MCP tool errors. Check the client logs, run
npm run test:live, and verify Node withnode --version.nsecinputs are rejected. Event fetching only reads public events.
Architecture
Nostr MCP is built with:
Node - The JavaScript/TypeScript runtime
@modelcontextprotocol/sdk - SDK for building MCPs
Zod - TypeScript-first schema validation
Nostrify and nostr-tools - relay queries and NIP-19 identifiers
HTTP client for fetching documentation from:
Nostrbook documentation service
License
Available Tools
8 toolsfetch_eventCRead-only
Fetch a Nostr event using a nip19 identifier
Inputs: identifier (required).
generate_kindARead-only
Suggest a kind number not listed in the official NIPs index; this does not reserve it or guarantee global uniqueness
Inputs: range (required).
read_kindCRead-only
Read Nostr documentation about a specific event kind
Inputs: kind (required).
read_nipCRead-only
Read a Nostr NIP document
Inputs: nip (required).
read_nips_indexARead-only
Read the full list of NIPs, kinds, and tags
Inputs: no named parameters.
read_protocolCRead-only
Read Nostr protocol basics
Inputs: doc (required).
read_tagCRead-only
Read Nostr documentation about a specific tag
Inputs: tag (required).
search_community_nipsARead-only
Discover NostrHub community NIPs. Search keywords, or omit query for recent documents. Returns previews and naddr identifiers to read with fetch_event. Results depend on relay coverage and are not official NIP endorsements.
Inputs: kind, limit, query, author.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools target clearly distinct resources: protocol basics, NIP index, individual NIP, kind, tag, community NIP search, event fetch, and kind generation. There is slight potential confusion between read_nip and reading community NIPs via fetch_event, and between read_nips_index and the more specific read_kind/read_tag tools, but descriptions largely resolve this.
All tools use snake_case with a leading verb such as read_, search_, fetch_, or generate_ followed by a clear resource noun. Plural forms in read_nips_index and search_community_nips are minor lexical variation, not a convention break.
Eight tools fit a documentation and discovery server well, with each covering a distinct reference or lookup operation. The set feels well-scoped and no tool appears redundant.
The surface covers protocol basics, NIP index and documents, kind/tag documentation, community NIP discovery, event fetching, and kind suggestion. A keyword search over official NIPs and a more explicit community-NIP read path would round it out, but core workflows are covered.
Maintenance
Related MCP Connectors
Access and search Branch's official API documentation directly within any AI agent or client.
Web knowledge fetching tools for your agent.
Search, read, and ask the Nyuchi docs (docs.nyuchi.com); send feedback or raise issues.
Search and query nTop's knowledge base and engineering guides from AI applications.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides tools for AI agents to access Bitcoin, Lightning Network, and Nostr knowledge, including real-time network statistics and Web of Trust reputation data. It features an integrated Lightning Network payment system for micro-transactions and query-based interactions.122MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with comprehensive access to n8n node documentation, properties, operations, and templates, enabling them to build and validate n8n workflows.MIT
- AlicenseNot gradedqualityCmaintenanceProvides AI assistants with comprehensive access to n8n node documentation, properties, and operations for building and managing automation workflows.MIT
- AlicenseAqualityBmaintenanceReview and rewrite LangChain, LlamaIndex, Ollama, and XRPL code against current APIs, plus runnable examples, import lookup, and XRPL tx skeletons that never submit. Live docs included. $0.001 USDC on Base or 1000 drops XRP.10MIT