关于 🌐 Nostr MCP Server
Nostr MCP Server 是一个 MCP 服务,让 AI 模型可以与 Nostr 网络交互,例如发布笔记。它面向希望让 LLM 接入去中心化社交协议的开发者,支持同时连接多个中继。
主要功能
- 01发布笔记到 Nostr 网络
- 02连接多个中继
- 03符合 MCP 规范的 API
- 04通过 SSE 实现实时通信
- 05Lightning zap 功能(开发中)
适用场景
- 01让 AI 模型代为发布 Nostr 笔记
- 02在 Claude Desktop 等客户端中接入 Nostr
- 03测试 LLM 与去中心化社交网络的集成
MCP 相关
该项目是一个 MCP 服务,向 MCP 客户端暴露 post_note 和 send_zap 工具,其中 send_zap 仍在开发中。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
还没有获取到工具列表
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
🌐 Nostr MCP 服务
一种模型上下文协议(MCP)服务,可让 AI 模型与 Nostr 交互,使其能够发布笔记并参与这个言论自由协议。
即使对大模型而言,抗审查也很重要。
顺便说一句,你应该现在就加入 Nostr!
🚀 功能
- 📝 在 Nostr 网络上发布笔记
- 🔌 连接多个中继
- 🤖 符合 MCP 规范的 AI 集成 API
- 💸 向 Nostr 用户发送 Lightning zap(正在开发中)
- 📡 支持服务器发送事件(SSE),实现实时通信
👷♂️ 待办事项
- 添加对多个并发连接的支持
- 实现标准输入传输模式(可通过环境变量配置)
📋 前置条件
- Node.js 18+
🛠️ 安装
通过 Smithery 安装
通过 Smithery 自动为 Claude Desktop 安装 Nostr MCP Server:
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文件并按需修改。
# 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
🚦 使用方法
启动服务
# Development mode with hot reload
npm run dev
# Production mode
npm start
可用工具
post_note
向 Nostr 网络发布新笔记。
输入示例:
{
"content": "Hello from Nostr! 👋"
}
send_zap
向 Nostr 用户发送 Lightning zap。
输入示例:
{
"nip05Address": "[email protected]",
"amount": 1000
}
🔧 开发
项目结构
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
运行测试
npm test
🤝 参与贡献
- 复刻代码库
- 创建功能分支(
git checkout -b feature/amazing-feature) - 提交更改(
git commit -m 'Add some amazing feature') - 将更改推送到分支(
git push origin feature/amazing-feature) - 发起拉取请求
📜 许可证
本项目采用 MIT 许可证,详情请参阅 LICENSE 文件。
🔗 资源
- 加入 Nostr
- Nostr 宣言
- Nostr 规范
- 模型上下文协议
- MCP 服务可视化测试工具
- 精选 MCP 服务
- 精选 MCP 客户端
- MCP TypeScript SDK
- Nostr 开发套件(NDK)
📬 联系方式
欢迎通过我的公钥关注我:
npub1hr6v96g0phtxwys4x0tm3khawuuykz6s28uzwtj5j0zc7lunu99snw2e29
或者扫描此二维码找到我:

为 Nostr 社区倾情打造 ❤️
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。