Skip to main content
Glama
nod-protocol

nod-mcp-server

Official
by nod-protocol

nod-mcp-server

这就是 AI 智能体与企业交互的方式——不是通过抓取,而是通过读取结构化的清单。这个参考 MCP 服务器教会任何兼容 MCP 的客户端(Claude Desktop、智能体框架、IDE)读取企业位于 https://{domain}/.well-known/nod.jsonnod.json 清单,并回答关于企业能做什么的实际问题:订餐、预约、搜索产品、查询价格等。

它公开了两个工具——lookup_nodcheck_capability——并捆绑了四个在本地运行的演示清单,因此该演示无需任何外部依赖即可开箱即用。

安装

git clone <this repo> nod-mcp-server
cd nod-mcp-server
npm install
npm run build

需要 Node.js 20+。

运行演示清单服务器

目前几乎没有真实网站发布 nod.json,因此该仓库捆绑了四个示例清单(餐厅、电子商务、SaaS、医疗保健)并在本地提供服务。

npm run demo:manifests

你应该看到:

NOD demo manifest server listening on http://localhost:3456
  http://localhost:3456/demo-restaurant.localhost/nod.json
  http://localhost:3456/demo-shop.localhost/nod.json
  http://localhost:3456/demo-saas.localhost/nod.json
  http://localhost:3456/demo-health.localhost/nod.json

在演示期间保持此终端运行。MCP 服务器会自动将任何 *.localhost 域名路由到此服务器。

配置 Claude Desktop

在 macOS 上打开(或创建) ~/Library/Application Support/Claude/claude_desktop_config.json(在 Windows 上为 %APPDATA%\Claude\claude_desktop_config.json)并添加:

{
  "mcpServers": {
    "nod": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/nod-mcp-server/dist/index.js"]
    }
  }
}

/ABSOLUTE/PATH/TO/nod-mcp-server 替换为此检出目录的完整路径(例如 /Users/you/projects/nod-mcp-server)。重启 Claude Desktop。现在你应该能在 Claude 的工具选择器中看到 nod 服务器,其中包含两个工具:lookup_nodcheck_capability

60 秒演示脚本

在终端运行演示清单服务器并配置好 Claude Desktop 后,将这些提示词依次粘贴到 Claude 中。

1. "Look up the NOD manifest for demo-restaurant.localhost"

Claude 调用 lookup_nod({ domain: "demo-restaurant.localhost" }) 并返回类似以下内容:

# Pike Place Noodle House  (restaurant)
Hand-pulled noodles, dumplings, and regional Chinese classics...

- URL: https://demo-restaurant.localhost
- Manifest: http://localhost:3456/demo-restaurant.localhost/nod.json

## Declared capabilities
  - purchase
  - booking
  - view_menu
  - order_food
  - book_table

## Supported actions
  - purchase → https://demo-restaurant.localhost/api/orders [auth: api_key]
  - booking  → https://demo-restaurant.localhost/api/reservations [auth: api_key]
  - search   → https://demo-restaurant.localhost/api/menu/search [auth: none]

2. "Can I order food from demo-restaurant.localhost?"

Claude 调用 check_capability({ domain: "demo-restaurant.localhost", action: "order_food" })

YES — demo-restaurant.localhost supports "order_food".
Manifest declares "order_food" under discovery.mcp_server.capabilities.

Endpoint: POST https://demo-restaurant.localhost/api/orders
Authentication: api_key
Matched via: discovery.mcp_server.capabilities

Constraints:
{ "require_human_confirmation": { "purchases_above": 150, ... },
  "rate_limits": { "transactions": { "requests": 10, "period": "minute" } },
  "allow_automated_purchases": true }

3. "What actions does demo-shop.localhost support?"

Claude 调用 lookup_nod({ domain: "demo-shop.localhost" }) 并总结:产品搜索、定价、库存检查以及受 OAuth2 保护的订单下单——具有 500 美元的人工确认阈值和 60 天退货政策。

奖励提示词

  • "Book an appointment at demo-health.localhost — what does that flow require?" → 返回预约端点、必填字段(patient_name, DOB, reason, provider_id, preferred_date)、OAuth2 作用域以及取消政策。

  • "Does demo-saas.localhost allow automated purchases?" → 返回 NO 以及人工回退 URL,因为清单设置了 allow_automated_purchases: false

工具参考

lookup_nod

输入

类型

描述

domain

string

仅域名(无协议,无路径)。*.localhost 域名会被路由到捆绑的演示服务器。

获取 https://{domain}/.well-known/nod.json,如果失败则回退到 https://{domain}/nod.json。返回结构化摘要:企业身份、声明的能力、支持的操作(包含端点 + 认证)、API 端点和联系方式。失败时返回明确的“未找到清单”消息。

check_capability

输入

类型

描述

domain

string

仅域名。

action

string

常用值:order_food, place_order, view_menu, book_table, book_appointment, search_products, find_provider, get_pricing, check_inventory, check_status, create_account, get_docs, contact_support

获取清单并根据 transactions.capabilities, discovery.mcp_server.capabilities, support.contact.mcp_server.capabilities 以及结构化端点(transactions.purchase, discovery.search, information.pricing 等)检查该操作。返回是/否的结论、端点 URL、认证方法以及策略约束(速率限制、人工确认阈值)。

*.localhost 路由的工作原理

当 MCP 服务器收到以 .localhost 结尾的域名时,它会从 http://localhost:3456/{domain}/nod.json 获取,而不是正常的 well-known URL。这使得演示是自包含的——你可以将 Claude 指向 demo-restaurant.localhost 并获得真实结果,而无需任何 DNS 或 HTTPS 设置。

环境变量:

  • NOD_LOCAL_PORT — 演示清单服务器监听的端口(默认为 3456

  • NOD_LOCAL_MANIFEST_SERVER — MCP 服务器用于 .localhost 查找的基础 URL(默认为 http://localhost:3456

  • NOD_FORCE_LOCAL=1 — 将所有域名通过本地清单服务器路由(对于测试新示例清单的贡献者很有用)

下一步

使用 opennod.ai/protocol 上的 NOD 协议规范为您的企业发布 nod.json。编写一个最小的有效清单大约需要 30 分钟——一旦它在 https://yourdomain.com/.well-known/nod.json 上线,任何使用此 MCP 服务器(或任何其他支持 NOD 的客户端)的智能体都将能够发现您的企业并根据其能力采取行动。

许可证

MIT

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - A tier

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

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/nod-protocol/nod-mcp-server'

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