Nostr MCP Server

Nostr MCP Server

MCP-compliant server connecting AI models to the censorship-resistant Nostr network.

37
Stars
9
Forks
37
Watchers
4
Issues
Nostr MCP Server enables AI models to interact securely and programmatically with the Nostr protocol, facilitating the posting of notes and integration with decentralized social networks. It provides an MCP-compliant API that supports real-time communication, multi-relay support, and Lightning zaps for payments. Built with TypeScript, the server is designed for easy deployment, supports server-sent events and stdio modes, and is configured for extensibility by developers.

Key Features

Post notes to Nostr network
Connect to multiple Nostr relays
MCP-compliant API
Send Lightning zaps to users
Server-Sent Events for real-time updates
Supports stdio and sse server modes
Configurable environment variables
TypeScript implementation
Easy installation and hot reload in development
Structured tool-based API for post and zap actions

Use Cases

Enabling language models to participate on decentralized social networks
Automated note posting and broadcasting via Nostr
Integrating Lightning micropayments in AI-driven apps
Real-time AI agent communication with social protocols
Building censorship-resistant content bots
Aggregating and relaying AI-generated content to multiple Nostr relays
Developing plugins for AI chat clients to interact with Nostr
Running private Nostr bridges for model context exchange
Experimenting with decentralized payment flows in conversational AI
Monitoring and moderating Nostr activity using AI models

README

🌐 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.

smithery badge TypeScript MCP Nostr

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:

bash
npx -y @smithery/cli install @AbdelStark/nostr-mcp --client claude

Manual Installation

  1. Clone the repository:
bash
git clone https://github.com/AbdelStark/nostr-mcp
cd nostr-mcp
  1. Install dependencies:
bash
npm install
  1. Create a .env file:

💡 You can copy the .env.example file and modify it as needed.

env
# 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

bash
# Development mode with hot reload
npm run dev

# Production mode
npm start

Available Tools

post_note

Posts a new note to the Nostr network.

Example input:

json
{
  "content": "Hello from Nostr! 👋"
}

send_zap

Sends a Lightning zap to a Nostr user.

Example input:

json
{
  "nip05Address": "user@domain.com",
  "amount": 1000
}

🔧 Development

Project Structure

text
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

Running Tests

bash
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

📬 Contact

Feel free to follow me if you'd like, using my public key:

text
npub1hr6v96g0phtxwys4x0tm3khawuuykz6s28uzwtj5j0zc7lunu99snw2e29

Or just scan this QR code to find me:

Nostr Public Key QR Code


Star History

Star History Chart

Repository Owner

AbdelStark
AbdelStark

User

Repository Details

Language TypeScript
Default Branch main
Size 305 KB
Contributors 2
License MIT License
MCP Verified Nov 11, 2025

Programming Languages

TypeScript
89.44%
JavaScript
6.13%
Dockerfile
4.17%
Shell
0.26%

Tags

Topics

llm mcp-server nostr

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • NWC MCP Server

    NWC MCP Server

    Bridge your Bitcoin Lightning wallet with LLMs using Nostr Wallet Connect.

    NWC MCP Server enables users to connect Bitcoin Lightning wallets to language models through Nostr Wallet Connect (NWC) and NIP-47 protocols. It leverages the official Model Context Protocol (MCP) TypeScript SDK and supports various transport modes such as STDIO, HTTP streamable, and SSE. The solution can be integrated with platforms like N8N, Claude Desktop, Goose, and Cline, and allows authentication and context management using NWC connection secrets. Although now deprecated in favor of Alby MCP, it provides tooling for leveraging Lightning payment workflows within AI agent interactions.

    • 12
    • MCP
    • getAlby/nwc-mcp-server
  • Opik MCP Server

    Opik MCP Server

    A unified Model Context Protocol server for Opik with multi-transport IDE integration.

    Opik MCP Server is an open-source implementation of the Model Context Protocol (MCP) designed for the Opik platform. It enables seamless integration with compatible IDEs and provides a unified interface to manage Opik's features such as prompts, projects, traces, and metrics. Supporting multiple transport mechanisms like stdio and experimental SSE, it simplifies workflow integration and platform management for LLM applications. The tool aims to streamline development and monitoring by offering standardized access and control over Opik's capabilities.

    • 182
    • MCP
    • comet-ml/opik-mcp
  • HackMD MCP Server

    HackMD MCP Server

    MCP server connecting LLM clients to the HackMD collaborative note platform.

    HackMD MCP Server implements the Model Context Protocol (MCP) to provide a standardized interface between large language model (LLM) clients and the HackMD collaborative note service. Through HTTP and STDIO transports, it enables creation, retrieval, update, and deletion of notes, along with management of teams, user profiles, and history data. It supports deployment in both local and cloud environments, with secure API token-based authentication and configuration via environment variables or HTTP headers.

    • 43
    • MCP
    • yuna0x0/hackmd-mcp
  • Alby Bitcoin Payments MCP Server

    Alby Bitcoin Payments MCP Server

    Connect Bitcoin Lightning wallets to LLMs using Nostr Wallet Connect within the Model Context Protocol framework.

    Alby Bitcoin Payments MCP Server provides a way to integrate Bitcoin Lightning wallets with large language models (LLMs) via the Model Context Protocol (MCP). This server supports Nostr Wallet Connect (NWC), LNURL, and L402, enabling secure payment and authentication flows. Leveraging the official MCP TypeScript SDK along with Alby SDKs and tools, it allows agents and clients to interact with lightning wallets using various transport protocols like SSE and HTTP Streamable. The server can be integrated with tools such as Claude, Goose, and Cline for seamless wallet operations within AI workflows.

    • 36
    • MCP
    • getAlby/mcp
  • Bitcoin & Lightning Network MCP Server

    Bitcoin & Lightning Network MCP Server

    Enable AI models to safely interact with Bitcoin and Lightning Network in a standardized way.

    The Bitcoin & Lightning Network MCP Server implements the Model Context Protocol, allowing AI models to interface with Bitcoin and Lightning Network functionalities such as key generation, address validation, transaction decoding, blockchain queries, and lightning payments. It provides standardized endpoints for AI model integration, including support for Claude Desktop and Goose. The solution supports querying blockchain data, parsing transactions and invoices, and managing cryptographic operations in a secure and extensible manner.

    • 65
    • MCP
    • AbdelStark/bitcoin-mcp
  • Nocodb MCP Server

    Nocodb MCP Server

    Natural language access and management for NocoDB using the Model Context Protocol.

    Nocodb MCP Server enables seamless CRUD operations and schema management on NocoDB databases via the Model Context Protocol (MCP). It allows users to perform database actions such as creating, reading, updating, deleting records, and altering table structures through natural language commands. The tool integrates easily with external platforms like Claude Desktop and supports both API and CLI usage. TypeScript-based, it provides modern maintainability and compatibility enhancements.

    • 54
    • MCP
    • edwinbernadus/nocodb-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results