🌐 Nostr Mcp 伺服器
概覽
Nostr MCP 是什麼?
Nostr MCP 是一個旨在促進與 Nostr 協議互動的伺服器。它使使用者能夠有效地發佈筆記、管理內容並參與 Nostr 生態系統。這個伺服器充當橋樑,允許在 Nostr 框架內無縫通信和數據交換,使其成為對於有興趣於去中心化通信的開發者和使用者來說,必不可少的工具。
Nostr MCP 的特點
- 友好的介面:Nostr MCP 提供直觀的介面,簡化了發佈筆記和管理互動的過程。
- 去中心化通信:基於去中心化的原則,確保使用者對其數據和互動擁有控制權。
- 實時更新:伺服器支持實時更新,使用者可以即時收到有關其帖子和互動的通知。
- 開源:Nostr MCP 是開源的,這意味著任何人都可以參與其開發,確保持續改進和創新。
- 多平台支持:它被設計為能夠在各種平台上運行,使其對更廣泛的受眾可及。
如何使用 Nostr MCP
- 安裝:首先從 GitHub 克隆 Nostr MCP 倉庫。按照倉庫 README 文件中提供的安裝說明進行操作。
- 配置:根據您的需求配置伺服器設置。這可能包括設置用戶帳戶、權限和其他偏好設置。
- 發佈筆記:設置完成後,使用者可以通過介面直接開始發佈筆記。這個過程簡單且友好。
- 與社區互動:利用伺服器與其他使用者互動,分享見解,參與與 Nostr 相關的討論。
- 貢獻:作為一個開源項目,歡迎貢獻。使用者可以報告問題、建議功能,或甚至提交代碼以增強伺服器的功能。
常見問題
問:Nostr MCP 的目的是什么?
答:Nostr MCP 作為一個與 Nostr 協議互動的伺服器,使使用者能夠發佈筆記並參與去中心化通信。
問:Nostr MCP 是免費使用的嗎?
答:是的,Nostr MCP 是一個開源項目,因此免費使用和修改。
問:我如何能夠貢獻給 Nostr MCP?
答:您可以通過報告問題、建議功能或通過 GitHub 倉庫提交代碼改進來貢獻。
問:Nostr MCP 支持哪些平台?
答:Nostr MCP 被設計為與多個平台兼容,確保廣泛的使用者可及性。
問:我可以在哪裡找到 Nostr MCP 的文檔?
答:文檔通常可以在倉庫的 README 文件中或項目 GitHub 頁面的專門文檔部分找到。
詳細
🌐 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 claude
Manual Installation
- Clone the repository:
git clone https://github.com/AbdelStark/nostr-mcp
cd nostr-mcp
- Install dependencies:
npm install
- 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 start
Available 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 configuration
Running Tests
npm test
🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - 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:
npub1hr6v96g0phtxwys4x0tm3khawuuykz6s28uzwtj5j0zc7lunu99snw2e29
Or just scan this QR code to find me:
伺服器配置
{
"mcpServers": {
"nostr-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--abdelstark--nostr-mcp--nostr-mcp",
"npm run start"
],
"env": {
"LOG_LEVEL": "log-level",
"NODE_ENV": "node-env",
"NOSTR_RELAYS": "nostr-relays",
"NOSTR_NSEC_KEY": "nostr-nsec-key"
}
}
}
}