
Nostr Ops Mcp
io.github.llmops-pro由 GitHub 账号 llmops-pro 发布v0.2.3更新于 Oct 25, 2026
Nostr publishing, queries, and DMs for AI agents, with allowlists, rate limits, and an audit log.
概览
一个本地 MCP 服务器,为 AI 助手提供 Nostr 身份,可签名、发布、查询并发送加密私信,配有白名单、速率限制和审计日志。
- 可以做什么
- 在本地解码和编码 NIP-19 标识符,无需签名器即可查询资料和 NIP-05 名称。用 NIP-01 过滤器查询事件,并列出已配置的中继池及其连接状态。发布事件、文本笔记、个人资料元数据和可替换事件,并请求软删除,均受事件类型白名单和速率限制约束。在显式启用私信工具后,发送、列出并解密加密私信。
- 适用场景
- 当你希望助手以某个特定 Nostr 身份行动时使用:发布笔记、管理资料、查询中继,或运行由私信驱动的工作流。其安全护栏使其更适合持续或半自动发布,而非无需签名器的一次性读取。
- 运行要求
- 需要 Node.js 20 或更高版本,以 stdio 在本地运行。必须提供 NOSTR_RELAYS,填入 wss:// 中继地址。写入需要签名器:优先使用 NOSTR_NIP46_URI 中的 NIP-46 bunker URI,或在 NOSTR_PRIVATE_KEY 中填入原始 nsec。配置签名器后必须提供 NOSTR_ALLOWED_KINDS。服务器会加载其构建产物旁的 .env 文件。
安装
在 SourceWeft 中
- 打开 控制台中的 Nostr Ops Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
nostr-ops-mcp
A NOSTR identity for your LLM agent. MCP server that exposes NOSTR protocol primitives — sign, publish, query, NIP-19 encode/decode, NIP-05 lookup, encrypted DMs — as tools your agent can call. Drop it into Claude Desktop, Claude Code, Cursor, or any MCP-speaking client. Hand the agent a NIP-46 bunker key (not a raw nsec). Set a kind allowlist. Let it post on your behalf within rails you control.
v0.1 — full read + write + DM surface. 16 tools wrapped in a defense-in-depth safety stack: kind allowlist (deny-by-default), recipient allowlist, rate limits, optional two-step confirmation, structured audit log. Supports both nsec (dev) and NIP-46 bunker (production).
What you can do with this
- A bot that publishes kind:1 notes from your npub — daily summaries, scheduled posts, programmatic reactions to incoming events.
- A NOSTR sales agent — pair with
marketplace-mcpto publish NIP-15 stalls + products as the same identity. - Profile management —
nostr_publish_metadatafor kind:0 (always demands confirmation — overwriting your profile is irreversible without older relay data). - DM-driven workflows — a storefront agent that watches incoming DMs (with
nostr_list_dms), decrypts orders, and replies vianostr_send_dm. Default-off behindNOSTR_DM_TOOLS_ENABLED. - Cross-server identity — share the same NIP-46 bunker URI across
nostr-ops-mcpandmarketplace-mcp. One key, one identity, two specialized tool surfaces.
The safety stack is the load-bearing reason this is usable in production: an agent with the keys to publish as you can ruin your reputation in seconds if unconstrained. The server enforces what kinds it'll sign, what rate, optional second-step confirmation, and writes every call to a structured audit log.
The sixteen tools
Read-only — local (no network, no signer needed)
Read-only — network (no signer needed for query/profile/nip05)
Write (require signer; gated by KindAllowlist + RateLimiter + optional confirm)
DMs (highest-risk; default-off via NOSTR_DM_TOOLS_ENABLED=true)
NIP-17 sealed/gift-wrapped DMs are not yet supported — deferred to a future v0.2 (rumor events + gift-wrapping add nontrivial complexity).
Requirements
- Node 20+
- A NOSTR signer — strongly preferred: a NIP-46 bunker URI from Amber (Android), nsec.app (web), or any other NIP-46 implementation. Legacy path: a raw nsec in
.env. The server logs a stderr warning at startup when nsec-on-disk is detected.
Install
Configure
The server auto-loads .env from this binary's own directory (next to dist/) — deliberately NOT from cwd, to avoid env-var collision when multiple MCP servers run in the same Claude Code session.
Required
Signer — provide AT MOST one
Optional safety knobs
Wire into an MCP client
Claude Code (project-scoped)
Claude Desktop / Cursor / other clients
Because the server loads its own .env, leave the env block empty in the client config — keep secrets out of any committed file.
Safety model
Every write tool runs the pipeline in this order:
NOSTR_READ_ONLYgate — refuse outright.- Signer presence — refuse if neither nsec nor NIP-46 URI is configured.
- KindAllowlist — refuse if the event kind isn't in
NOSTR_ALLOWED_KINDS. - RateLimiter — refuse if the rolling 60s
eventsbucket is full. - Confirm gate — if
NOSTR_REQUIRE_CONFIRM=true(or the tool always-confirms, likepublish_metadata), return a 16-byte hex token instead of signing. - Sign + publish — via NDK; the signer handshake completes lazily on first use (relevant for NIP-46 where the bunker handshake is async).
- Audit log — append-only JSON line for every attempt (ok / blocked / error).
DM tools add three more checks on top: NOSTR_DM_TOOLS_ENABLED, DmAllowlist (per-recipient), and a separate dms rate bucket.
The floor is your signer. If using NIP-46, the bunker can refuse any sign request — that's the strongest safety boundary. This server's checks are belt-and-suspenders on top.
Verifying calls actually went through
Successful publish: {"ts":"...","tool":"nostr_publish_text_note","outcome":"ok","result":{"event_id":"...","relays_accepted":[...]}}. Blocked / error lines are equally structured. The audit log is append-only by intent — rotate it as part of your operational hygiene.
Testing
For end-to-end testing against live relays, configure a throwaway nsec + a couple of public relays (damus.io, nos.lol) and run a small loop: nostr_publish_text_note → nostr_query_events to confirm the note round-tripped. The nostr_send_dm → nostr_list_dms loop validates the DM path (you can DM yourself for a closed-loop check).
Companion servers
nwc-mcp— Lightning wallet over NWC. Pair these to build sats-spending NOSTR agents.marketplace-mcp— NIP-15 marketplace publish (Shopstr-compatible). Uses the same signer setup as this server.
License
MIT — see LICENSE.
Contact / Issues
Built by LLMOps.Pro.
- NOSTR:
npub1hdg932jvwc3jdvkqywgqv0ue4nn60exrf92asy8mtazt3hjg7d2s2yw0nw— follow, DM, zap. - Lightning Address:
[email protected]— for support zaps and "this was useful" tips. - Bug reports / feature requests: open a GitHub issue (link forthcoming).
- Security issues: please disclose privately via NOSTR DM before opening a public issue.
来源:README.md,提交 8c6daf6
工具
0版本历史
1- v0.2.3最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分