Skip to main content
MCP server CX Codex

bray — Claude Code MCP server: what it does, how to install

Connects Claude Code to the Nostr protocol for publishing notes, reading feeds, and handling private messages. Useful whenever an AI agent needs decentralized identity.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add bray -e NOSTR_SECRET_KEY=<NOSTR_SECRET_KEY> -e NOSTR_RELAYS=<NOSTR_RELAYS> -e NWC_URI=<NWC_URI> -- npx -y nostr-bray
Open on GitHub

What bray does

The nostr-bray package connects your assistant to Nostr through 261 tools organized into 29 groups. Only 50 tools are exposed directly to the model, covering profile checks, feed fetching, direct messaging, and balance lookups. Remaining actions stay in a catalog: the agent locates them with search-actions and runs them through execute-action. This structure prevents context exhaustion.

Running the server requires Node.js 24 or newer. Storing raw keys in NOSTR_SECRET_KEY exposes them directly to the process environment. For ongoing operations, configure a NIP-46 signer bunker via BUNKER_URI or use encrypted keys with NOSTR_NCRYPTSEC instead.

What it helps with

  • publish notes and read user feeds across Nostr relays
  • exchange encrypted direct messages with contacts
  • check zap balances and inspect wallet status
  • generate a key pair and recovery mnemonic via npx nostr-bray create

Example prompts for the agent

  • Check our active Nostr identity with whoami.
  • Post a short note to my Nostr feed saying "Testing Claude Code integration".
  • Search the action catalog for relay health inspection tools.

How to install bray

Platform CLI

claude mcp add bray -e NOSTR_SECRET_KEY=<NOSTR_SECRET_KEY> -e NOSTR_RELAYS=<NOSTR_RELAYS> -e NWC_URI=<NWC_URI> -- npx -y nostr-bray

Replace <…> with your own values

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about bray

How do I install bray in Claude Code?

Run claude mcp add bray -e NOSTR_SECRET_KEY=<NOSTR_SECRET_KEY> -e NOSTR_RELAYS=<NOSTR_RELAYS> -e NWC_URI=<NWC_URI> -- npx -y nostr-bray. If you lack a keypair, generate one first using npx nostr-bray create.

What does bray do?

It provides an MCP interface for Nostr, letting AI agents publish events, read direct messages, interact with communities, and query relays.

What are the runtime requirements for bray?

The package requires Node.js 24 or higher, along with relay endpoints set in NOSTR_RELAYS.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor