A Nostr MCP server that allows to interact with Nostr, enabling posting notes, and more.
Harness the power of the Model Context Protocol (MCP) to connect your AI models to the decentralized world of Nostr. This server enables AI agents to post notes, interact with users, and leverage the censorship-resistant nature of Nostr for truly autonomous communication.
Why Nostr for AI? In an era of increasing content moderation, Nostr provides a vital platform for uncensored communication. By integrating your AI with Nostr, you ensure its voice remains independent and resilient.
Clone the Repository:
git clone https://github.com/AbdelStark/nostr-mcp cd nostr-mcp
Install Dependencies:
npm install
Configure Environment Variables:
.env
file (copy from .env.example
for a template).LOG_LEVEL
: Set the desired logging level (debug
, info
, warn
, error
).NODE_ENV
: Specify the environment (development
, production
).NOSTR_RELAYS
: A comma-separated list of Nostr relay URLs (e.g., wss://relay.damus.io,wss://relay.primal.net
).NOSTR_NSEC_KEY
: Your Nostr private key (starting with nsec
). Important: Handle this key with extreme care.SERVER_MODE
: Choose the server mode (stdio
or sse
).PORT
: The port for SSE mode (e.g., 9000
).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
# Development mode with hot reload npm run dev # Production mode npm start
The Nostr MCP Server exposes the following tools for AI interaction:
post_note
: Publishes a new note to the Nostr network.
{ "content": "Hello from my AI agent on Nostr! ๐" }
send_zap
(Work in Progress): Sends a Lightning zap to a Nostr user.
{ "nip05Address": "[email protected]", "amount": 1000 }
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 configuration
npm test
We welcome contributions to enhance the Nostr MCP Server!
git checkout -b feature/my-new-feature
).git commit -m 'Add cool feature'
).git push origin feature/my-new-feature
).Feel free to connect with me on Nostr:
npub1hr6v96g0phtxwys4x0tm3khawuuykz6s28uzwtj5j0zc7lunu99snw2e29
Built with โค๏ธ for a decentralized future.
๐ VOYP Voice Over Your Phone MCP Server for making calls.
๐ An MCP server with openAPI specs for using the WhatsApp unnoficial API (https://waha.devlike.pro/ also open source: https://github.com/devlikeapro/waha
๐ ๐ JMeter MCP Server for performance testing
๐ โ๏ธ Slack workspace integration for channel management and messaging