nostr
A Nostr MCP server that allows to interact with Nostr, enabling posting notes, and more.
claude mcp add --transport stdio abdelstark-nostr-mcp node src/index.ts \ --env PORT="9000" \ --env NODE_ENV="development" \ --env LOG_LEVEL="debug" \ --env SERVER_MODE="sse" \ --env NOSTR_RELAYS="wss://relay.damus.io,wss://relay.primal.net,wss://nos.lol" \ --env NOSTR_NSEC_KEY="your_nsec_key_here"
How to use
This MCP server exposes an API that lets AI models interact with the Nostr network. It supports posting notes to Nostr, connecting to multiple relays, and real-time updates via Server-Sent Events (SSE). Tools exposed by the server include post_note for publishing notes to the Nostr network and potential support for sending zaps (Lightning payments) to Nostr users in future iterations. To start, ensure Node.js 18+ is installed and configure the environment variables for Nostr relays and your private key. Once running, you can integrate with the MCP client SDKs to send structured requests to post notes, subscribe to real-time events, and manage the relay connections.
How to install
Prerequisites:
- Node.js 18+ and npm
- A valid Nostr private key (NOSTR_NSEC_KEY)
Manual installation steps:
- Clone the repository
git clone https://github.com/AbdelStark/nostr-mcp
cd nostr-mcp
- Install dependencies
npm install
- Create a .env file (or copy from .env.example) and customize it
# .env (example)
LOG_LEVEL=debug
NODE_ENV=development
NOSTR_RELAYS=wss://relay.damus.io,wss://relay.primal.net,wss://nos.lol
NOSTR_NSEC_KEY=your_nsec_key_here
SERVER_MODE=sse
PORT=9000
- Run the server in development or production mode
# Development (with hot reload if configured)
npm run dev
# Production
npm start
Alternatively, install and run via Smithery if you prefer the automated approach described in the README.
Additional notes
Environment variables:
- NOSTR_RELAYS: comma-separated list of Nostr relay URLs
- NOSTR_NSEC_KEY: your Nostr private key (starts with nsec)
- SERVER_MODE: choose between stdio or sse (for real-time updates)
- PORT: port for SSE mode if applicable
Common issues:
- Ensure the Nostr private key is valid and has the necessary permissions
- Verify relay URLs are reachable and support the Nostr protocol version you rely on
- If using TypeScript sources directly (src/index.ts), ensure you have a runtime that can execute TS or adjust to compile to JS before running (e.g., ts-node or a build step)
Configuration tips:
- For local testing, start with a single relay and a low port, then scale up to multiple relays
- If you encounter connection errors, check firewall rules and network access to the configured relays
Related MCP Servers
context7
Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
mcp-graphql
Model Context Protocol server for GraphQL
rohlik
MCP server that lets you shop groceries across the Rohlik Group platforms (Rohlik.cz, Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro)
mcp -chart-minio
mcp-server-chart私有化部署方案
kanban
MCP Kanban is a specialized middleware designed to facilitate interaction between Large Language Models (LLMs) and Planka, a Kanban board application. It serves as an intermediary layer that provides LLMs with a simplified and enhanced API to interact with Planka's task management system.
mcp-typescribe
An MCP server implementation enabling LLMs to work with new APIs and frameworks