@defarm/mcp
Enables AI agents to seal, open, verify, and ingest verifiable agri-traceability data by description, with credentials and private keys kept out of the model's flow.
README
@defarm/mcp
MCP server for DeFarm — lets an AI agent seal, open, verify and ingest
verifiable agri-traceability data by description, no code required. Built on
@defarm/sdk: sealed fields are encrypted
client-side and the DeFarm server is structurally blind to them.
Open source (MIT) for the same reason the SDK is: don't trust DeFarm — audit the client.
Security posture (the part to read first)
- Credentials never flow through the model. Auth is server configuration (environment variables below). There is no login tool; no tool accepts a password, API key, or key material — and the test suite enforces that.
- Private keys never leave the local keystore. No tool returns private material; the agent sees ids and fingerprints only.
- Safe defaults are inherited from the SDK: sealing is private and self-addressed unless explicitly addressed; the crypto suite is fixed, never a choice.
Setup
// e.g. Claude Desktop / Claude Code MCP config
{
"mcpServers": {
"defarm": {
"command": "npx",
"args": ["-y", "github:defarm-repo/defarm-mcp"],
"env": {
"DEFARM_GATEWAY": "<your test-environment gateway>",
"DEFARM_EMAIL": "<workspace login>",
"DEFARM_PASSWORD": "<workspace password>",
"DEFARM_API_KEY": "<partner key, only if the agent should ingest>",
"DEFARM_KEYSTORE": "~/.defarm/keys.json"
}
}
}
}
Point DEFARM_GATEWAY at a test environment first; production is an explicit decision.
Tools
| Tool | What it does |
|---|---|
defarm_whoami |
user + workspace of the configured credentials |
defarm_ensure_keys |
generate (locally) + register the workspace key pairs — returns ids/fingerprints only |
defarm_export_recipient |
export this workspace's public recipient bundle for out-of-band sharing |
defarm_ingest |
partner ingestion, with preview dry-run |
defarm_seal |
seal a field for addressed recipients — DeFarm stays blind; bindings re-verified |
defarm_open |
decrypt a sealed field locally; authorship re-verified locally |
defarm_verify |
public verification (anchor, RFC3161, sealed commitments) — no account needed |
defarm_get_item / defarm_get_item_public |
membership-gated / public reads (uniform 404) |
defarm_resolve_identifier |
resolve by SISBOV/chip/… |
Blocked-on-backend operations (grant, grantLink, revoke — engines#584/#574) are NOT
exposed as tools: an agent should not see tools that always fail.
Development
Dependency: @defarm/sdk via semver (^0.2.0) from npm — the SHA-pin era (and its
"pin follows the latest SDK squash" rule) ended with the 0.2.0 publish, as promised.
npm install
npm test # tool-table contract tests (no network, fake gateway)
npm run build && DEFARM_GATEWAY=... node dist/index.js # stdio server
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。