nostr-mcp
A Nostr MCP server that allows to interact with Nostr, enabling posting notes, and more.
Documentation
๐ Nostr MCP Server
A Model Context Protocol (MCP) server that enables AI models to interact with Nostr, allowing them to post notes and interact with the freedom of speech protocol.
Censorship resistance matters, even for LLMs.
BTW, you should join Nostr now!
๐ Features
- ๐ Post notes to Nostr network
- ๐ Connect to multiple relays
- ๐ค MCP-compliant API for AI integration
- ๐ธ Send Lightning zaps to Nostr users (WIP)
- ๐ก Server-Sent Events (SSE) support for real-time communication
๐ทโโ๏ธ TODOs
- [ ] Add support for multiple simultaneous connections
- [ ] Implement stdin transport mode (configurable via environment variable)
๐ Prerequisites
- Node.js 18+
๐ ๏ธ Installation
Installing via Smithery
To install Nostr MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @AbdelStark/nostr-mcp --client claudeManual Installation
1. Clone the repository:
git clone https://github.com/AbdelStark/nostr-mcp
cd nostr-mcp1. Install dependencies:
npm install1. Create a `.env` file:
> ๐ก You can copy the `.env.example` file and modify it as needed.
# 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๐ฆ Usage
Starting the Server
# Development mode with hot reload
npm run dev
# Production mode
npm startAvailable Tools
`post_note`
Posts a new note to the Nostr network.
Example input:
{
"content": "Hello from Nostr! ๐"
}`send_zap`
Sends a Lightning zap to a Nostr user.
Example input:
{
"nip05Address": "user@domain.com",
"amount": 1000
}๐ง Development
Project Structure
nostr-mcp/
โโโ src/
โ โโโ index.ts # Main server entry point
โ โโโ nostr-client.ts # Nostr client implementation
โ โโโ types.ts # TypeScript type definitions
โโโ .env # Environment configuration
โโโ tsconfig.json # TypeScript configurationRunning Tests
npm test๐ค Contributing
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Resources
- Join Nostr
- Nostr Manifesto
- Nostr Specifications
- Model Context Protocol
- Visual testing tool for MCP servers
- Awesome MCP Servers
- Awesome MCP Clients
- MCP TypeScript SDK
- Nostr Development Kit (NDK)
๐ฌ Contact
Feel free to follow me if you'd like, using my public key:
npub1hr6v96g0phtxwys4x0tm3khawuuykz6s28uzwtj5j0zc7lunu99snw2e29Or just scan this QR code to find me:

Made with โค๏ธ for the Nostr community
Frequently asked questions
What is nostr-mcp?
nostr-mcp is A Nostr MCP server that allows to interact with Nostr, enabling posting notes, and more.
How do I install nostr-mcp?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is nostr-mcp open source?
Yes โ it is hosted on GitHub at https://github.com/AbdelStark/nostr-mcp and has 35 stars.
Related MCP tools
๐ค A visualization mcp contains 25+ visual charts using @antvis. Using for chart generation and data analysis. TypeScript-based implementation.
A Unified MCP Server Management App TypeScript-based implementation. Trusted by 800+ developers. Trusted by 800+ developers.
Model Context Protocol server for GraphQL TypeScript-based implementation.
MCP Server for SearXNG TypeScript-based implementation.
๐ Cherry Studio is a desktop client that supports for multiple LLM providers. Built for the Model Context Protocol to enhance AI capabilities.
FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, ...
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP