N

Nostr-MCP 服务器(模型上下文协议服务器)

@AbdelStark/nostr-mcp
0 Stars 433 次浏览 AbdelStark 更新于 2026-08-23

一个模型上下文协议(MCP)服务器,使人工智能模型能够与Nostr网络交互,促进笔记发布和与言论自由协议的交互。

该服务暂未提供标准配置,请参考 README 手动接入

服务介绍

🌐 Nostr MCP 服务器

一个模型上下文协议 (MCP) 服务器,使 AI 模型能够与 Nostr 交互,允许它们发布笔记并参与言论自由协议。

抗审查对于 LLMs 同样重要。

smithery 徽章
TypeScript
MCP
Nostr

顺便说一句,你应该 现在就加入 Nostr!

🚀 功能

  • 📝 向 Nostr 网络发布笔记
  • 🔌 连接到多个中继
  • 🤖 用于 AI 集成的 MCP 兼容 API
  • 💸 向 Nostr 用户发送闪电 Zap(进行中)
  • 📡 支持 Server-Sent Events (SSE) 以实现实时通信

👷‍♂️ 待办事项

  • 添加对多个同时连接的支持
  • 实现 stdin 传输模式(通过环境变量配置)

📋 前提条件

  • Node.js 18+

🛠️ 安装

通过 Smithery 安装

要通过 Smithery 自动为 Claude Desktop 安装 Nostr MCP 服务器:

npx -y @smithery/cli install @AbdelStark/nostr-mcp --client claude

手动安装

  1. 克隆仓库:
git clone https://github.com/AbdelStark/nostr-mcp
cd nostr-mcp
  1. 安装依赖项:
npm install
  1. 创建一个 .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 用户发送闪电 Zap。

示例输入:

{
  "nip05Address": "user@domain.com",
  "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

🤝 贡献

  1. 分叉仓库
  2. 创建您的功能分支 (git checkout -b feature/amazing-feature)
  3. 提交您的更改 (git commit -m 'Add some amazing feature')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 打开 Pull Request

📜 许可证

该项目根据 MIT 许可证许可 - 请参阅 LICENSE 文件以获取详细信息。

🔗 资源

📬 联系

如果您愿意,可以使用我的公钥关注我:

npub1hr6v96g0phtxwys4x0tm3khawuuykz6s28uzwtj5j0zc7lunu99snw2e29

或者直接扫描这个二维码找到我:

Nostr 公钥二维码


相关 MCP 服务