@defarm/mcp
@defarm/mcp
面向 DeFarm 的 MCP 服务器——让 AI 智能体仅凭描述即可密封、开启、验证和摄取可验证的农产品溯源数据,无需编写任何代码。它构建于 @defarm/sdk 之上:被密封的字段在客户端完成加密,DeFarm 服务器在结构上对其完全不可见。
与 SDK 开源的理由一样,本项目使用 MIT 协议开源:不要信任 DeFarm——请审计这个客户端。
安全状态(建议先读这一部分)
凭据永远不会流经模型。 认证属于服务器配置(见下文的环境变量)。没有登录工具;也没有任何工具接受密码、API 密钥或密钥材料——测试套件强制保证这一点。
私钥永远不会离开本地密钥库。 任何工具都不会返回密钥材料;智能体只能看到 id 和指纹。
安全默认值继承自 SDK:除非显式指定收件人,否则密封默认是私有且面向自身的;密码学套件是固定的,绝不是可选项。
Related MCP server: Wallet4Agent MCP Server
环境配置
// 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"
}
}
}
}请先将 DEFARM_GATEWAY 指向一个测试环境;使用生产环境是一个需要明确做出的决定。
工具
工具 | 作用 |
| 显示已配置凭据对应的用户与工作空间 |
| (本地)生成并注册工作空间密钥对——只返回 id 和指纹 |
| 导出该工作空间的公开接收者包,用于经线外分享 |
| 合作伙伴数据接入,支持 |
| 为指定收件人密封字段——DeFarm 依然不可见;绑定关系会被重新验证 |
| 在本地解密密封字段;并在本地重新验证作者身份 |
| 公开验证(时间戳、RFC3161、密封承诺)——匿名操作 |
| 需要成员权限 / 公开读取(统一返回 404) |
| 根据 SISBOV/耳标/… 解析 |
等待后端支持的操作(grant、grantLink、revoke——engines#584/#574)不会暴露为工具:智能体不应看到注定失败的工具。
开发
依赖:@defarm/sdk,按 semver(^0.2.0)来自 npm——SHA 固定提交时代(及其“pin 跟随最新 SDK squash”的规则)约定已故。在 0.2.0 发布之时已按承诺正式结束。
npm install
npm test # tool-table contract tests (no network, fake gateway)
npm run build && DEFARM_GATEWAY=... node dist/index.js # stdio server许可证
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to certify their creations with verifiable, timestamped proof anchored to Bitcoin, and to verify certificates.3MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI agents with a DID-based identity, secure wallet, and cloud KMS-backed signing keys, enabling trusted interactions with persons, companies, and other agents via standards like OIDC4VCI, OIDC4VP, and SD-JWT.Apache 2.0
- FlicenseAqualityCmaintenanceEnables AI agents to discover verifiable DeFi yield opportunities, generate algorithmic portfolio plans, and track cryptographic proof receipts, bridging LLMs with blockchain yield protocols.9
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to query cryptographically verified facts with zero-knowledge proofs, selective disclosure, and tamper-evident provenance.1791Apache 2.0
Related MCP Connectors
Trust infrastructure for AI agents: read a verifiable Trust Rating, claim an identity, earn a badge.
Issue signed receipts for AI agent actions; verify any receipt offline - free, no account.
Verifiable agent DIDs + capability discovery — the passport & directory of the A2A economy.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/defarm-repo/defarm-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server