Foodblock Mcp

io.github.FoodXDevelopment由 GitHub 账号 FoodXDevelopment 发布v0.5.1更新于 Oct 27, 2026

Food data tools for any AI agent. Describe food in English, get structured data back.

概览

AI 生成的概览

FoodBlock 的 MCP 服务器,让助手写入和读取经过签名、哈希链式关联的食品数据区块(报价、转移、授权、观察)。

可以做什么
  • 由助手写入和读取已签名的 FoodBlock 区块,涵盖七种区块类型(actor、thing、observe、transform、transfer、promise、grant)及其关联动词。
  • 用自然语言描述食品,返回结构化的区块数据。
  • 可独立运行,也可连接 FoodBlock 节点,由节点在同伴之间提供签名的拉取与推送。
  • 生成身份与设备密钥,并在密钥链中检查、校验和验证区块。
适用场景
适合希望让 AI 助手以可签名、可验证的格式记录或交换结构化食品数据(报价、货物转移、权限授予、观察记录)的场景,可本地使用或连接 FoodBlock 节点。
运行要求
以 npm 包形式通过 stdio 在本机运行。可选的 FOODBLOCK_URL 指向 FoodBlock 服务器,留空则为独立模式。未声明任何身份验证。运行节点需要 Postgres 和节点密钥文件,但这与 MCP 服务器本身分开。
安装前请注意
区块使用 Ed25519(或 p256、sm)密钥签名,因此所用的身份与设备密钥属于敏感信息。写入区块会产生仅可追加的签名记录,无法修复,只能由新的签名区块取代。将 FOODBLOCK_URL 指向某节点会把区块发送到该服务器。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Foodblock Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

FoodBlock

[OpenSSF Best Practices] [IETF Internet-Draft] [DOI] [OpenSSF Scorecard]

The smallest language strangers in food need to agree on, with no boss. Everything else is data.

A block is three fields, signed by its author on their own device:

json
{  "type": "promise",  "state": {    "terms": { "price": { "minor": 450, "currency": "GBP" }, "quantity": { "value": "30", "unit": "{egg}" } },    "at": "2026-10-15T09:00:00.000Z",    "audience": "public",    "seq": 4  },  "refs": { "author": "a1b2…", "prev": "c3d4…", "from": "a1b2…", "what": "e5f6…" }}

This is an offer: it is signed by its from side. Its id is the hash of its canonical form (one exact way of writing it as text: RFC 8785). The author signs the same bytes with Ed25519 (the suite std; p256 and sm are two more). Nobody's clock decides who has authority. The other side can check that authority. Without the author's key no one can make a block that counts as theirs, or change one without changing its id, and a key that signs two versions of its history leaves the proof. What the protocol cannot do (keep a lost key safe, stop a custodian who holds your key, see inside a sealed block it was not sent) is in the threat model (a draft).

The language

Seven types, in three moods:

TypeMeaning
What existsactorA person, an autonomous system or machine, a circle, or a contact
thingAnything held, found or written: food, tools, places, recipes, shares, schemas
IsobserveA claim that something is so
transformA thing changes: inputs become outputs, or a thing is kept and stays itself
transferA thing changes owner, holder or place
MustpromiseA commitment, offered or asked
MaygrantAuthority given to someone

Seven verbs, the refs that link blocks: updates, answers (the only way to consent), confirms, defeats, for, derives_from, same_as. prev and after say what came before.

Strict. Only four types carry authority and are closed (actor, promise, transfer, grant); any other word is an open type that a node stores and passes on. A node writes and reads only the current version's shapes: no nulls, no floats (money is { minor, currency }, an amount { value, unit } with a decimal string), exact UTC times, sets written sorted, every block in its key's chain (state.seq, refs.prev). It never repairs a block: it refuses it, and the author signs a new one.

Three sizes of peer

Every peer speaks the protocol itself: a phone, a robot kitchen, a van, a sensor. Machines are peers like people. There are three sizes (protocol.json peers, and spec/protocol.md): micro (a device that measures and signs), edge (the local operator, works offline) and node (the lasting level, serves pull and push to anyone). Only people and machines hold nodes. A business, a household or a community is a circle of them, never a node of its own.

What is here

FolderWhat it is
spec/The protocol, its lists, the canonical form, transport, profiles, vectors, the oracle and the paper
sdk/javascriptThe reference SDK
sdk/rustThe one core: every rule, as a Rust crate, a C library and WebAssembly
sdk/python, sdk/go, sdk/swift, sdk/kotlinThe same protocol in other languages, thin layers over the core; each runs every vector section
server/A node: Postgres for the blocks, HTTP for signed pull, push and .well-known/foodblock
mcp/An MCP server, so any autonomous system can write and read signed blocks
cli/fb: make an identity and device keys, write blocks in its key chain, check, validate, verify, and convert old data once
sql/schema.sqlThe node's store: append-only, each block kept exactly as it arrived
test/Cross-language canonical vectors, and the script that copies the spec into each SDK

Each SDK's README says which profile it covers.

For autonomous systems

FoodBlock is built for people, autonomous systems and machines to use together. An autonomous system can read and write it directly:

Quick start

js
const fb = require('@foodxdev/foodblock') // in this repository: require('./sdk/javascript/src/index.cjs')const keys = fb.generateKeypair()                  // one key is the whole ceremonyconst me = fb.identity.genesis(keys, { kind: 'person', at: '2026-10-15T09:00:00.000Z', audience: 'public' })  // who you are: its hash is your id; kind, at and audience are yours to stateconst eggs = fb.write('thing', { kind: 'eggs', name: 'Free-range eggs' }, {}, { author: me.hash, key: keys, held: [me], at: '2026-10-15T09:01:00.000Z', audience: 'public' })fb.valid(eggs, [me])                               // [] : sound, signed by a key of its author, in its chain

From a terminal:

bash
cd cli && npm installnode bin/fb.js init me.json --kind person --audience public --reach P30Dnode bin/fb.js create thing eggs --state '{"name":"Free-range eggs"}' --identity me.json

Between nodes

Anyone can leave a node with everything they signed. Peers swap blocks with two messages, pull and push, and every answer is signed by a key of the node's holder (spec/modules/nodes.md). .well-known/foodblock says who the node is, what it holds and its admission rule.

Run one with docker compose -f server/docker-compose.yml up, or cd server && npm install && npm start with a Postgres at DATABASE_URL and a key file from fb key at NODE_KEY.

Tests

WhatCommand
Conformance vectorsnode spec/run-vectors.cjs
The SDKs carry the spec exactlynode test/sync-spec.cjs --check
JS SDKcd sdk/javascript && npm test
Python SDKcd sdk/python && python3 -m unittest discover -s tests
Go SDKcd sdk/go && CGO_ENABLED=0 go test ./...
Swift SDKsdk/swift/scripts/build-xcframework.sh --macos && swift test (at the root)
Rust corecd sdk/rust && cargo test
Kotlin SDKcd sdk/kotlin && ./gradlew :foodblock:test (needs a JDK 17); the bundled-library check: scripts/build-natives.sh jvm && ./gradlew :foodblock:testBundled
The oracle (written from the spec text alone)node spec/oracle/run.cjs
Every fold, core against oraclenode test/audit/run.cjs
No listed thing is dead or untestednode test/necessity.cjs (the full measurement, ten minutes: node tools/necessity.cjs)
Stored blocks against the current corenode tools/replay-check.cjs <export> (counts and reason codes only; see DISTRIBUTION.md)
Nodecd server && npm test (in-memory Postgres; set TEST_DATABASE_URL for a real one)
MCP servercd mcp && npm test
CLIcd cli && npm test

Licence

Public domain (CC0 1.0; decided 2026-10-29, replacing MIT). FOODX WORLD LIMITED (England and Wales, company 16406719), which wrote it and runs this repository, waived its copyright: the protocol needs no one's permission to implement, copy or change.

How a change is proposed and how versions work: GOVERNANCE.md. How we treat each other, and what content is not allowed: CODE_OF_CONDUCT.md. Reporting a weakness: SECURITY.md.

To cite FoodBlock, see CITATION.cff.

来源:README.md,提交 cd2dac8

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.5.1最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。