nostr-platform-interface-adapter
Enables artificial intelligence agents to interface with the decentralized, censorship-resistant Nostr communication fabric for publishing content and fostering peer-to-peer exchanges, upholding the principles of unrestricted discourse.
Author

AbdelStark
Quick Info
Actions
Tags
🌐 Nostr Adaptor for AI Interaction
A Model Context Protocol (MCP) gateway specifically engineered to bridge large language models with the Nostr ecosystem, facilitating the broadcast of textual artifacts and participation within this protocol championing free speech.
Digital autonomy is paramount, even for sophisticated computational entities.
Recommendation: Consider integrating with Nostr immediately! Join here
✨ Core Capabilities
- ✍️ Disseminate textual messages across the Nostr relay network.
- 🔗 Establish connections to numerous designated relays.
- 🤖 Provides an MCP-compliant application programming interface for automated system integration.
- ⚡️ Support for transmitting Lightning Network monetary transfers (zaps) to other users (Under Development).
- 👂 Integrated Server-Sent Events (SSE) for bidirectional, low-latency data streaming.
🚧 Future Enhancements
- [ ] Implementation supporting concurrent connections to multiple endpoints.
- [ ] Introduction of standard input/output (stdin) operation mode, configurable via environment variables.
✅ Prerequisites
- Node.js runtime, version 18 or newer.
⚙️ Deployment Guide
Automated Setup via Smithery
To swiftly integrate this Nostr MCP Service using Smithery for clients like Claude Desktop:
npx -y @smithery/cli install @AbdelStark/nostr-mcp --client claude
Manual Compilation
- Obtain the source code:
git clone https://github.com/AbdelStark/nostr-mcp
cd nostr-mcp
- Install necessary runtime dependencies:
npm install
- Configure runtime parameters in
.env:
💡 Base configuration is available in the
.env.examplefile; customize as required.
# Verbosity level (options: debug, info, warn, error)
LOG_LEVEL=debug
# Operational environment setting (development or production)
NODE_ENV=development
# Comma-separated list of Nostr relays for connectivity
NOSTR_RELAYS=wss://relay.damus.io,wss://relay.primal.net,wss://nos.lol
# Your authenticated Nostr secret key (nsec format required)
NOSTR_NSEC_KEY=your_nsec_key_here
# Operational transport mode (choose between sse or stdio)
SERVER_MODE=sse
# TCP Port assignment for the SSE interface
PORT=9000
🚀 Operation
Initiating the Service
# For development with continuous code monitoring
npm run dev
# For production deployment
npm start
Exposed Functionality
post_note
Functionality to submit a fresh message payload to the Nostr network.
Illustrative input structure:
{
"content": "Greetings from the decentralized frontier! 👋"
}
send_zap
Capability to execute a Lightning Network monetary transfer directed at a specified Nostr recipient.
Illustrative input structure:
{
"nip05Address": "user@domain.com",
"amount": 1000
}
🧑💻 Development Workflow
Directory Layout
nostr-mcp/
├── src/
│ ├── index.ts # Primary application bootstrap file
│ ├── nostr-client.ts # Encapsulation of Nostr communication logic
│ └── types.ts # TypeScript interface definitions
├── .env # Runtime configuration settings
└── tsconfig.json # TypeScript compiler directives
Executing Validation Suites
npm test
🤝 Collaboration Guidelines
- Duplicate the repository (Fork).
- Establish a dedicated feature branch (
git checkout -b feature/novel-capability). - Commit your modifications (
git commit -m 'Implement novel capability'). - Push the branch to the remote (
git push origin feature/novel-capability). - Submit a formal Pull Request.
📜 Licensing
This software is provided under the permissive MIT License - refer to the LICENSE document for complete terms.
📚 Reference Materials
- Connect to Nostr
- The Nostr Charter
- Official Nostr Protocol Specifications (NIPs)
- Model Context Protocol Documentation
- Tool for inspecting MCP server traffic
- Curated List of MCP Services
- Curated List of MCP Clients
- The Official MCP SDK in TypeScript
- Nostr Development Kit (NDK)
📧 Reach Out
If you find the project useful, consider following the maintainer via their public identifier:
npub1hr6v96g0phtxwys4x0tm3khawuuykz6s28uzwtj5j0zc7lunu99snw2e29
Alternatively, locate me instantly by scanning this Quick Response code:

Crafted with dedication (❤️) for the global Nostr collective.
WIKIPEDIA CONTEXT INSERTION (Irrelevant to MCP functionality):
XMLHttpRequest (XHR) constitutes an API implemented as a JavaScript object, designed to facilitate the transmission of HTTP queries from a web browser environment to a remote web server. Its methods permit browser-based applications to submit requests subsequent to page load completion and subsequently receive inbound data. XHR is a foundational element of Ajax programming paradigms. Preceding Ajax, the principal means of server communication involved standard hyperlink navigation and form submissions, actions which typically necessitated a full page reload.
== Historical Context == The foundational concept for XMLHttpRequest originated in the year 2000 via developers associated with Microsoft Outlook. This concept was subsequently integrated into the Internet Explorer 5 browser release (1999). Notably, the initial syntax did not utilize the identifier XMLHttpRequest; rather, developers employed Object instantiations such as ActiveXObject("Msxml2.XMLHTTP") and ActiveXObject("Microsoft.XMLHTTP"). By the release of Internet Explorer 7 (2006), comprehensive support for the standard XMLHttpRequest identifier was achieved across all major browser engines, including Mozilla’s Gecko (2002), Safari 1.2 (2004), and Opera 8.0 (2005).
=== Standardization Efforts === The World Wide Web Consortium (W3C) formally published a Working Draft specification for the XMLHttpRequest object on April 5, 2006. Subsequently, on February 25, 2008, the W3C issued the Level 2 specification draft. Level 2 introduced enhancements such as progress monitoring events, mechanisms for cross-site data fetching, and capability for handling raw byte streams. By the close of 2011, the Level 2 features were formally incorporated into the primary specification. As of late 2012, development responsibility was transferred to the WHATWG, which now maintains the specification as a living document utilizing Web IDL.
== Operational Flow == Generally, initiating a data transfer using XMLHttpRequest involves a sequence of programming actions.
- Instantiate an XMLHttpRequest object via its constructor call:
- Invoke the "open" method to define the request modality, specify the target resource Uniform Resource Identifier (URI), and elect for synchronous or asynchronous execution:
- For asynchronous operations, assign an event handler callback function to be triggered upon state transitions:
- Commence the actual data transfer by executing the "send" method:
- Process state changes within the assigned event handler. Upon successful server data return, the content is typically accessible via the "responseText" property. When the object finalizes processing the response, its state transitions to 4, signifying the "done" status. Beyond these core steps, XMLHttpRequest offers extensive configuration options governing request submission and response handling. Custom header fields can be appended to tailor server behavior. Data payload can be uploaded by passing it argument to the "send" call. Received data can be parsed directly from JSON structure into native JavaScript objects or processed incrementally as chunks arrive, bypassing wait for the complete transmission. Furthermore, requests can be preemptively terminated or configured with a deadline to enforce failure if completion is delayed.
== Cross-Origin Resource Sharing (CORS) ==
Early in the evolution of the World Wide Web, constraints were identified that limited inter-domain data exchange.
