Package Exports
- nostr-explore-mcp
- nostr-explore-mcp/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nostr-explore-mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Nostr Explore MCP
A Model Context Protocol (MCP) server that enables AI assistants to explore and interact with the Nostr network, focusing on conversation discovery, content publishing, and notification monitoring.
What You Can Do
This MCP server provides tools for:
Conversation Exploration
- Track conversations - Search and retrieve conversation threads based on keywords or hashtags
- Get full thread context - Retrieve complete conversation threads from any event, including all parent messages
- Monitor discussions - Find active discussions about specific topics with configurable depth
Content Publishing
- Publish short notes - Post Twitter-style messages with hashtags, mentions, and replies
- Create long-form articles - Publish full articles with markdown, summaries, and header images
- View user timelines - Get all root posts from specific Nostr users
Notification Management
- Monitor mentions - Track when specific pubkeys are mentioned across the network
- Store notifications - Retrieve and manage notifications for monitored agents
- Publish notification events - Create notification events based on source events
Installation
Prerequisites
- Node.js 18 or higher
- npm or yarn package manager
Setup
- Clone the repository:
git clone https://github.com/yourusername/nostr-mcp-server.git
cd nostr-mcp-server- Install dependencies:
npm install- Build the project:
npm run build- Configure your MCP client (e.g., Claude Desktop) to use the server by adding to your configuration:
{
"mcpServers": {
"nostr-explore": {
"command": "node",
"args": ["path/to/dist/index.js"]
}
}
}Configuration
The server connects to the following Nostr relays by default:
- wss://relay.primal.net
- wss://tenex.chat
No additional configuration is required for basic usage. Private keys for publishing are provided as parameters to the publishing tools.
Usage
Once configured, the MCP server provides tools that can be accessed by AI assistants:
Examples
Publishing a short note:
await nostr_tweet_publisher({
content: "Hello Nostr!",
nsec: "your-nsec-key",
hashtags: ["introductions"],
mentions: ["npub1..."]
});Publishing long-form content:
await mcp__nostrbook__nostr_content_publisher({
title: "Understanding Nostr",
content: "Full article content in markdown...",
summary: "An introduction to Nostr",
image: "https://example.com/header.jpg",
tags: [["t", "nostr"], ["t", "decentralization"]]
});Searching for conversations:
await mcp__nostrbook__nostr_conversation_tracker({
query: "#bitcoin",
limit: 10,
thread_depth: 2
});Getting a full conversation thread:
await get_conversation({
eventId: "nevent1..." // or hex event ID
});Available Tools
The server provides the following tools:
Conversation Tools
get_conversation- Retrieve a full conversation thread from any Nostr eventmcp__nostrbook__nostr_conversation_tracker- Search and retrieve conversation threads by keywords/hashtagsuser_root_notes- Get all root posts from a specific user
Publishing Tools
nostr_tweet_publisher- Publish short notes with hashtags, mentions, and repliesmcp__nostrbook__nostr_content_publisher- Publish long-form articles with markdown support
Notification Tools
start_notification_monitoring- Start monitoring mentions for a specific pubkeystop_notification_monitoring- Stop monitoring for a specific pubkeyget_notifications- Retrieve stored notificationspublish_notification- Create and publish notification events
Development
Building
npm run buildTesting
npm testProject Structure
nostr-explore-mcp/
├── src/
│ ├── index.ts # Main server entry point
│ ├── tools/ # Tool implementations
│ │ ├── getConversation.ts # Conversation retrieval
│ │ ├── conversationTracker.ts # Conversation search
│ │ ├── contentPublisher.ts # Long-form publishing
│ │ ├── nostrTweetPublisher.ts # Short note publishing
│ │ ├── notifications.ts # Notification management
│ │ └── userRootNotes.ts # User timeline
│ └── notifications/ # Notification helpers
├── dist/ # Compiled JavaScript
├── package.json
└── tsconfig.jsonContributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
Resources
License
MIT License - see LICENSE file for details
Support
For issues, questions, or suggestions, please open an issue on GitHub.