Nostr MCP Server

by AbdelStark
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Used for version control and contributing to the project through git commands mentioned in the Contributing section.

  • References to GitHub repositories for the project itself, MCP specifications, and related resources.

  • Allows sending Lightning zaps (payments) to Nostr users through the 'send_zap' tool.

🌐 我们的 MCP 服务器

模型上下文协议 (MCP) 服务器使 AI 模型能够与 Nostr 交互,允许它们发布注释并与言论自由协议进行交互。

即使对于法学硕士来说,抵制审查也很重要。

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

🚀 功能

  • 📝 将笔记发布到 Nostr 网络
  • 🔌 连接到多个中继
  • 🤖 符合 MCP 标准的 AI 集成 API
  • 💸 向 Nostr 用户发送 Lightning 消息(开发中)
  • 📡 服务器发送事件(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 用户发送闪电。

示例输入:

{ "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. 打开拉取请求

📜 许可证

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

🔗 资源

📬 联系方式

如果您愿意,请随意使用我的公钥来关注我:

npub1hr6v96g0phtxwys4x0tm3khawuuykz6s28uzwtj5j0zc7lunu99snw2e29

或者直接扫描此二维码来找到我:


-
security - not tested
A
license - permissive license
-
quality - not tested

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

  1. 🚀 Features
    1. 👷‍♂️ TODOs
      1. 📋 Prerequisites
        1. 🛠️ Installation
          1. Installing via Smithery
          2. Manual Installation
        2. 🚦 Usage
          1. Starting the Server
          2. Available Tools
        3. 🔧 Development
          1. Project Structure
          2. Running Tests
        4. 🤝 Contributing
          1. 📜 License
            1. 🔗 Resources
              1. 📬 Contact
                ID: hum50a32bb