@nostrbook/mcp
v0.5.2
Published
This is an [MCP](https://modelcontextprotocol.io/) implementation that allows AI agents to access Nostr documentation.
Readme
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.
- 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): Generates an unused Nostr event kind number in the specified range (regular: 1000-9999, replaceable: 10000-19999, ephemeral: 20000-29999, addressable: 30000-39999)
Installation
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 configure - Choose "Add Extension"
- Choose "Command-line Extension"
- Enter "nostr" as the name
- Enter
npx -y @nostrbook/mcp@latestas the command
Architecture
Nostr MCP is built with:
- Node - The JavaScript/TypeScript runtime
- @modelcontextprotocol/sdk - SDK for building MCPs
- Zod - TypeScript-first schema validation
- HTTP client for fetching documentation from:
- Nostr NIPs GitHub repository
- Nostrbook documentation service
