Posts a new note to the Nostr network
Sends a Lightning zap to a Nostr user
A Model Context Protocol server that enables AI models to interact with the Nostr network, a decentralized and censorship-resistant social protocol. This integration allows AI assistants to post notes to the Nostr network and send Lightning zaps to Nostr users, promoting freedom of speech for AI systems. The server connects to multiple Nostr relays, providing reliable access to the network. It supports both Server-Sent Events (SSE) and standard I/O communication modes, making it flexible for different integration scenarios.
The Nostr Protocol Integration MCP server allows AI assistants to interact with the Nostr network, a decentralized protocol for censorship-resistant social media. This integration is particularly valuable for ensuring AI systems have access to open communication channels.
npx -y @smithery/cli install @AbdelStark/nostr-mcp --client claude
git clone https://github.com/AbdelStark/nostr-mcp
cd nostr-mcp
npm install
.env
file with the following configuration:# Log level (debug, info, warn, error)
LOG_LEVEL=debug
# Node environment (development, production)
NODE_ENV=development
# List of Nostr relays to connect to
NOSTR_RELAYS=wss://relay.damus.io,wss://relay.primal.net,wss://nos.lol
# Your Nostr private key (starts with nsec)
NOSTR_NSEC_KEY=your_nsec_key_here
# Server mode (stdio or sse)
SERVER_MODE=sse
# Port for SSE mode
PORT=9000
Important: You'll need a Nostr private key (nsec) to use this MCP. If you don't have one, you can create a Nostr account through services like start.njump.me.
For development with hot reload:
npm run dev
For production:
npm start
The server can be configured through environment variables:
LOG_LEVEL
: Sets the logging verbosity (debug, info, warn, error)NODE_ENV
: Environment mode (development, production)NOSTR_RELAYS
: Comma-separated list of Nostr relay WebSocket URLsNOSTR_NSEC_KEY
: Your Nostr private keySERVER_MODE
: Communication mode (sse or stdio)PORT
: Port number for SSE modeTo add this MCP to your AI client (like Claude Desktop), add the following to your client's configuration:
{
"mcpServers": {
"nostr": {
"command": "npm",
"args": ["start"],
"cwd": "/path/to/nostr-mcp"
}
}
}
Replace /path/to/nostr-mcp
with the actual path where you've installed the server.
For more information about Nostr: