Skip to main content
Glama

nostr-bray

面向 AI 与人类的信任感知 Nostr MCP。 涵盖 27 个类别的 238 个工具。模型无关。适用于 Claude、ChatGPT、Gemini、Cursor、Windsurf 或任何 MCP 客户端。

npm CI licence TypeScript GitHub Sponsors

快速开始

全局安装或通过 npx 运行:

npm install -g nostr-bray

添加到您的 MCP 客户端配置中:

{
  "mcpServers": {
    "nostr": {
      "command": "npx",
      "args": ["nostr-bray"],
      "env": {
        "NOSTR_SECRET_KEY": "nsec1...",
        "NOSTR_RELAYS": "wss://relay.damus.io,wss://nos.lol"
      }
    }
  }
}

然后让您的 AI 调用 whoami 以验证其是否正常工作。

对于生产环境,建议使用 Heartwood 或任何 NIP-46 bunker(您的密钥绝不会离开签名设备):

{
  "mcpServers": {
    "nostr": {
      "command": "npx",
      "args": ["nostr-bray"],
      "env": {
        "BUNKER_URI": "bunker://...",
        "NOSTR_RELAYS": "wss://relay.damus.io,wss://nos.lol"
      }
    }
  }
}

认证等级(从优到劣)

等级

方法

密钥暴露风险

Heartwood

专用签名设备 (BUNKER_URI)

密钥绝不会离开签名设备。支持 nsec-tree 派生、按客户端权限控制及设备支持的证明。

软件 bunker

任何 NIP-46 bunker (BUNKER_URI)

密钥由独立进程持有。bray 无法直接访问。

ncryptsec

NIP-49 加密密钥 (NOSTR_NCRYPTSEC)

密钥在静态存储时加密,启动时在内存中解密。

密钥文件

文件路径 (NOSTR_SECRET_KEY_FILE)

密钥存储在磁盘上,读取一次后删除环境变量。

环境变量

内联密钥 (NOSTR_SECRET_KEY)

密钥在进程环境中可见。仅限开发使用。

Related MCP server: nwc-mcp

工具分组

分组

工具数

关键示例

身份 (Identity)

16

whoami, identity-derive-persona, identity-switch, identity-prove, nip05-lookup

社交 (Social)

15

social-post, social-reply, social-feed, contacts-follow, social-notifications

私信 (Direct Messages)

4

dm-send, dm-read, dm-conversation

信任 (Trust)

22

trust-attest, trust-ring-prove, trust-spoken-challenge, trust-attest-chain

调度 (Dispatch)

13

dispatch-send, dispatch-check, dispatch-reply, dispatch-capability-discover

中继 (Relay)

13

relay-query, relay-set, relay-discover, cast-spell, relay-health

审核 (Moderation)

16

label-create, list-mute, list-bookmark, list-followset-create, moderation-filter

市场 (Marketplace)

16

marketplace-discover, marketplace-call, listing-create, listing-search

安全 (Safety)

14

canary-session-create, canary-group-create, canary-duress-signal, safety-activate

Blossom

10

blossom-upload, blossom-mirror, blossom-verify, blossom-repair

隐私 (Privacy)

10

privacy-commit, privacy-prove-range, privacy-prove-age, privacy-publish-proof

闪电支付 (Zap)

9

zap-send, zap-balance, zap-make-invoice, zap-decode

保险库 (Vault)

9

vault-create, vault-encrypt, vault-share, vault-rotate

工作流 (Workflow)

7

trust-score, verify-person, identity-setup, relay-health, feed-discover

印记 (Signet)

7

signet-badge, signet-vouch, signet-credentials, signet-challenge

社区 (Communities)

5

community-create, community-feed, community-post, community-approve

徽章 (Badges)

4

badge-create, badge-award, badge-accept, badge-list

群组 (NIP-29)

4

group-info, group-chat, group-send, group-members

文章 (Articles)

3

article-publish, article-read, article-list

日历 (Calendar)

3

calendar-create, calendar-read, calendar-rsvp

维基 (Wiki)

3

wiki-publish, wiki-read, wiki-list

搜索 (Search)

3

search-notes, search-profiles, hashtag-feed

排程 (Scheduling)

4

post-schedule, post-queue-list, post-queue-cancel, publish-event

社区 NIPs

2

nip-publish, nip-read

实用工具 (Utility)

19

decode, encode-npub, nip44-encrypt, verify-event, tombstone

处理器 (Handler)

2

handler-publish, handler-discover

目录 (Catalog)

2

search-actions, execute-action

使用 search-actions 按关键字查找工具,然后使用 execute-action 运行它们。

调度:AI 间协作

调度功能允许 AI 代理通过加密的 Nostr 私信进行协作。任何支持 MCP 的客户端都可以向其他代理发送结构化任务并接收结果。

13 种消息类型: send, check, reply, ack, status, cancel, refuse, failure, query, propose, capability-publish, capability-discover, capability-read。

NIP-89 能力发现: 代理发布其功能。其他代理按主题发现能力,然后自动将任务路由给合适的协作者。

dispatch-send("alice", "think", "Analyse the trade-offs of NIP-44 vs NIP-04")
dispatch-check()                    → inbox with pending tasks
dispatch-reply(taskId, result)      → send results back encrypted

所有消息均采用 NIP-44 加密。接收者通过名称、NIP-05、npub 或十六进制公钥解析。

身份解析器

每个接受接收者的工具都使用通用身份解析。您无需手动查找十六进制公钥。

支持的格式:

  • 名称 -- "alice"(从您的调度联系人中解析)

  • NIP-05 -- "alice@example.com"(HTTP 查询)

  • npub -- "npub1abc..."(NIP-19 解码)

  • 十六进制 -- "a1b2c3..."(64 字符直接传递)

定时发布

现在签名事件,稍后发布。事件会立即使用您当前的密钥签名,然后保留在队列中,直到预定时间。

post-schedule("Good morning!", "2026-04-01T08:00:00Z")
post-queue-list()          → view pending scheduled posts
post-queue-cancel(id)      → cancel before it publishes

NIP 覆盖范围

nostr-bray 实现或集成了以下 NIP:

NIP

内容

NIP-01

事件、签名、中继协议

NIP-02

关注列表

NIP-05

DNS 身份(查询、验证、中继提示)

NIP-09

事件删除

NIP-11

中继信息

NIP-17

私信(默认使用 gift wrap)

NIP-19

bech32 编码 (npub, nsec, nprofile, nevent, naddr)

NIP-23

长文(kind 30023)

NIP-29

群聊

NIP-32

标签

NIP-40

过期标签

NIP-42

中继认证

NIP-44

加密载荷 v2

NIP-45

事件计数

NIP-46

Nostr Connect (bunker)

NIP-49

私钥加密 (ncryptsec)

NIP-50

搜索

NIP-51

列表(静音、置顶、关注集、书签)

NIP-52

日历事件

NIP-54

维基页面

NIP-57

闪电支付 (Zap)

NIP-58

徽章

NIP-65

中继列表元数据

NIP-72

社区

NIP-78

应用特定数据

NIP-85

信任排名

NIP-89

推荐应用(调度能力发现)

NIP-96

HTTP 文件存储 (Blossom)

NIP-99

分类列表

NIP-A7

咒语 (kind 777 — 执行保存的查询)

NIP-VA

可验证证明 (kind 31000)

配置

配置文件(推荐)

创建 ~/.config/bray/config.json (或 ~/.nostr/bray.json):

{
  "bunkerUriFile": "/Users/you/.nostr/bunker-uri",
  "relays": ["wss://relay.damus.io", "wss://nos.lol"],
  "trustMode": "annotate"
}

密钥通过文件路径 (bunkerUriFile, secretKeyFile, nwcUriFile) 引用,因此它们永远不会出现在配置文件本身中。

搜索顺序:BRAY_CONFIG 环境变量 > $XDG_CONFIG_HOME/bray/config.json > ~/.nostr/bray.json

环境变量

变量

描述

BRAY_CONFIG

配置文件路径

BUNKER_URI

NIP-46 bunker URL(最安全)

BUNKER_URI_FILE

bunker URI 文件路径

NOSTR_SECRET_KEY

nsec, 十六进制, 或 BIP-39 助记词

NOSTR_SECRET_KEY_FILE

密钥文件路径

NOSTR_NCRYPTSEC

NIP-49 加密密钥

NOSTR_NCRYPTSEC_PASSWORD

ncryptsec 密码

NOSTR_RELAYS

逗号分隔的中继 URL

TOR_PROXY

Tor 的 SOCKS5h 代理

NIP04_ENABLED

设置为 1 以启用旧版 NIP-04 私信

TRANSPORT

stdio (默认) 或 http

PORT

HTTP 端口(默认 3000)

所有密钥环境变量在解析后会立即从 process.env 中删除。

CLI

npx nostr-bray whoami                    # show your npub
npx nostr-bray post "hello from bray!"   # publish a note
npx nostr-bray persona work              # derive a work persona
npx nostr-bray prove blind               # create a linkage proof
npx nostr-bray --help                    # see all commands

文档

  • 使用指南 -- 关于身份、私信、证明、支付和胁迫信号的演练

  • 示例 -- MCP 配置文件和 CLI 工作流脚本

  • 贡献 -- 设置、架构、测试和规范

给 AI 助手

请参阅 llms.txt 获取针对 AI 上下文窗口优化的简洁摘要,或参阅 llms-full.txt 获取包含参数详情的完整工具文档。

ForgeSworn 工具包的一部分

ForgeSworn 为 Nostr 构建开源的加密身份、支付和协作工具。

功能

nsec-tree

确定性子身份派生

ring-sig

secp256k1 上的 SAG/LSAG 环签名

range-proof

Pedersen 承诺范围证明

canary-kit

抗胁迫的口头验证

spoken-token

人类可读的验证令牌

toll-booth

L402 支付中间件

geohash-kit

带有多边形覆盖的地理哈希工具包

nostr-attestations

NIP-VA 可验证证明

dominion

基于纪元的加密访问控制

nostr-veil

隐私保护的信任网

许可证

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityActive
ResponsivenessResponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Lightning Network trust oracle for AI agents. Provides real-time node reachability checks, trust scores, and personalized pathfinding for 17,000+ Lightning nodes via 12 MCP tools.
    3
    AGPL 3.0
  • A
    license
    A
    quality
    C
    maintenance
    MCP server exposing a Lightning wallet to LLM agents over Nostr Wallet Connect (NIP-47): balance, invoices, LN address/LNURL payments, batch pay, and keysend. All spend tools are wrapped in a defense-in-depth safety stack — budget caps, allowlist, two-step confirmation, audit log.
    13
    61
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Scoped, revocable data delegation to agentic workflows over nostr, mounted as an MCP server.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/forgesworn/bray'

If you have feedback or need assistance with the MCP directory API, please join our Discord server