README
🚀 🌐 Nostr MCP 服务器
Nostr MCP 服务器是一个支持 AI 模型与 Nostr 网络交互的 Model Context Protocol (MCP) 服务器。它允许 AI 模型发布笔记,并与自由发言协议进行互动。在当今环境下,即便对于 LLM(大型语言模型)而言,抵制审查制度也具有重要意义。
顺便提一句,你应该现在就 加入 Nostr 网络!
🚀 快速开始
安装
使用 Smithery 安装
通过 Smithery 可自动安装 Nostr MCP Server for Claude Desktop:
npx -y @smithery/cli install @AbdelStark/nostr-mcp --client claude
手动安装
- 克隆仓库:
git clone https://github.com/AbdelStark/nostr-mcp
cd nostr-mcp
- 安装依赖项:
npm install
- 创建一个
.env文件:
💡 你可以复制
.env.example文件并按需修改。
# 日志级别(debug, info, warn, error)
LOG_LEVEL=debug
# 环境(development, production)
NODE_ENV=development
# Nostr 中继服务器列表
NOSTR_RELAYS=wss://relay.damus.io,wss://relay.primal.net,wss://nos.lol
# 你的 Nostr 私钥(以 nsec 开头)
NOSTR_NSEC_KEY=your_nsec_key_here
# 服务器模式(stdio 或 SSE)
SERVER_MODE=stdio
启动
安装完成后,运行以下命令启动服务器:
npm run dev
默认情况下,服务器将在 ws://localhost:3001 和 http://localhost:3000 上运行。
✨ 主要特性
- 📝 向 Nostr 网络发布笔记
- 🔌 连接到多个中继服务器
- 🤖 与 AI 集成的 MCP 兼容 API
- 💸 发送 Lightning zaps 到 Nostr 用户(WIP)
- 📡 支持 Server-Sent Events (SSE) 实时通信
👷♂️ 待办事项
- [ ] 添加对多个同时连接的支持
- [ ] 实现标准输入传输模式(可通过环境变量配置)
📦 安装指南
使用 Smithery 安装
通过 Smithery 自动安装 Nostr MCP Server for Claude Desktop:
npx -y @smithery/cli install @AbdelStark/nostr-mcp --client claude
手动安装
- 克隆仓库:
git clone https://github.com/AbdelStark/nostr-mcp
cd nostr-mcp
- 安装依赖项:
npm install
- 创建一个
.env文件:
💡 你可以复制
.env.example文件并按需修改。
# 日志级别(debug, info, warn, error)
LOG_LEVEL=debug
# 环境(development, production)
NODE_ENV=development
# Nostr 中继服务器列表
NOSTR_RELAYS=wss://relay.damus.io,wss://relay.primal.net,wss://nos.lol
# 你的 Nostr 私钥(以 nsec 开头)
NOSTR_NSEC_KEY=your_nsec_key_here
# 服务器模式(stdio 或 SSE)
SERVER_MODE=stdio
📚 详细文档
依赖项
- Node.js 18+
注意事项
- 确保你已经安装了 Node.js 18+
- 如果你需要在生产环境中使用,建议配置适当的防火墙和安全措施
- 可以通过修改
.env文件来调整服务器行为
为 Nostr 社区用心打造
Scan to contact