fm-mcp

io.github.yranganav0.1.0更新于 Oct 10, 2026

Delegate summarising, extraction, classification and OCR to the macOS 27 on-device model.

概览

AI 生成的概览

让编程助手把摘要、字段提取、分类和图片 OCR 等简单文本工作交给 macOS 27 上的端侧 Apple Foundation Models 模型处理。

功能
这是一个本地 stdio MCP 服务器,提供四个工具:summarise(把日志、文档、笔记或转录稿压缩成一段话或最多 7 条要点)、extract(按你给的 JSON Schema 把命名字段提取为 JSON)、classify(把文本归入你指定的标签,可用 multi 选多个)以及 ocr(读取 PNG、JPEG、HEIC、TIFF、GIF 或 BMP 图片中的文字,不支持 PDF)。前三个工具既可接收文本,也可接收最大 1 MB 的文本文件路径,助手无需自己读取文件。首次调用工具时它会自行启动 fm serve 模型服务,会话结束时停止。
适用场景
适合编程助手原本要花付费远程 token 处理例行文本任务的场景,例如总结日志或从文档中提取字段,同时希望文本留在本机。不适用于代码、数学、推理、文本中不存在的事实,以及答错代价高且无法核对的任务。
运行要求
需要 Apple Silicon 的 Mac(不支持 Intel)、开启 Apple Intelligence 的 macOS 27,并需先执行一次 fm license 接受许可。可通过 Homebrew、cargo 或安装脚本安装;fm-mcp install 会配置 Claude Code 和 Codex,也可使用 Claude Code 插件。可选环境变量 FM_MCP_REQUEST_TIMEOUT_SECS(默认 120)和 FM_MCP_LOG=debug。
安装前请注意
端侧模型较小且会出错:摘要可能遗漏或歪曲细节,extract 对文本中只是含义接近的字段可能给出错误值,重要结果需自行核对。输入与回答共享约 8K token,同一时间只处理一个请求,安全过滤器有时会拒绝无害输入。fm-mcp install 会写入 ~/.claude.json、~/.claude/skills/、~/.codex/config.toml 和 ~/.codex/AGENTS.md,写入前会备份;--dry-run 可预览,--uninstall 可移除。文本仅通过本地 Unix 套接字发送给本机模型。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

fm-mcp

An MCP server that lets coding agents such as Claude Code and Codex hand simple text work to the on-device model for Apple Foundation Models, the fm that ships with macOS 27. It's free, private, and runs offline.

mcp-name: io.github.yrangana/fm-mcp

Why

Coding agents spend paid, remote tokens on simple jobs, like summarising a log or pulling fields out of a document. A small model already on your Mac can do much of that for nothing, and your text never leaves the machine. fm-mcp lets the agent hand off that work, and tells it plainly what the small model can't do.

Install

You need a Mac with Apple Silicon (Intel Macs are not supported), macOS 27 with Apple Intelligence turned on, and the fm licence accepted once (fm license).

sh
brew install yrangana/tap/fm-mcpfm-mcp install    # sets up Claude Code and Codexfm-mcp doctor     # checks everything fm-mcp needs

Then start a new Claude Code or Codex session. fm-mcp starts the model server (fm serve) itself the first time a tool is called, and stops it when the session ends.

Other ways to get the binary:

sh
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/yrangana/fm-mcp/releases/latest/download/fm-mcp-installer.sh | shcargo install fm-mcp

What fm-mcp install changes

  • Claude Code: adds the fm-mcp MCP server to ~/.claude.json (through claude mcp add when the claude command is there), and installs the fm-delegate skill in ~/.claude/skills/.
  • Codex: adds [mcp_servers.fm-mcp] to ~/.codex/config.toml, and a marked section in ~/.codex/AGENTS.md (or in AGENTS.override.md, if you use one).

It backs up each file before changing it and prints every path it touched; running it again changes nothing. --claude or --codex picks one agent, --dry-run shows the changes without writing, and --no-guidance skips the skill and the AGENTS.md section. fm-mcp install --uninstall removes everything it added.

The skill and the AGENTS.md section tell the agent when to delegate. Without them the agent sees only the tool descriptions, and delegates less well.

Or: the Claude Code plugin

The plugin gives Claude Code the MCP server and the skill, without fm-mcp install. It still needs the binary on your PATH, so install that first (Homebrew above); otherwise Claude Code reports the server as failed to connect.

/plugin marketplace add yrangana/fm-mcp/plugin install fm-mcp@fm-mcp

Use the plugin or fm-mcp install for Claude Code, not both: both together give Claude Code two fm-mcp servers. With the plugin, run fm-mcp install --codex to set up Codex only.

Other MCP clients

fm-mcp is a plain stdio MCP server, so other clients that run local servers on the same Mac can use it. fm-mcp install doesn't set them up, and they don't get the delegation guidance: the agent decides from the tool descriptions alone. Each client below was tried on a real Mac; others may work but are untested.

Claude Desktop (tried with 2.31226.1, 2026-10-11). In Settings › Developer › Edit Config, add this to mcpServers in claude_desktop_config.json, then quit and reopen Claude Desktop:

json
"fm-mcp": {  "command": "/opt/homebrew/bin/fm-mcp",  "args": []}

Use the full path (which fm-mcp prints it). fm-mcp helps most with files on your Mac: give Claude the file's path and it passes path, so the text never goes through Claude. For a web page, Claude Desktop reads the page itself first, so delegating it saves nothing.

Devin (formerly Windsurf) (tried with Devin.app 3.8.20, 2026-10-11). Add this to mcpServers in ~/.config/devin/mcp_config.json:

json
"fm-mcp": {  "type": "stdio",  "command": "/opt/homebrew/bin/fm-mcp",  "args": []}

Tools

ToolWhat it doesHow much it takes
summariseCondenses logs, documents, notes and transcripts into a gist: a paragraph, or at most 7 bullets. Not a full record.About 30,000 words of prose, but only about 1,000 lines of a dense log. Long input is split and combined, which takes a minute or two and can drop details.
extractPulls named fields out of one text as JSON, from a JSON Schema you give. Works best with a flat schema.About 3,500 words of prose.
classifySorts one text into labels you choose (one label, or several with multi).About 3,500 words of prose.
ocrReads the text in a PNG, JPEG, HEIC, TIFF, GIF or BMP image. Not PDF.One image.

summarise, extract and classify take text, or a path to a text file (up to 1 MB) so the agent never has to read the file itself.

Limits

  • Small model, small context: about 8K tokens, shared by the input and the answer. Logs full of IDs and numbers use far more tokens per word than prose.
  • Not for code, maths, reasoning, facts the text doesn't contain, or anything where a wrong answer is costly and you can't check it.
  • It makes mistakes. Summaries can drop or distort details. extract usually returns null for a field the text doesn't contain, but when the text has something close in meaning (no PO number, but line items), about 1 in 3 such fields gets a wrong value. Nested schemas are less reliable than flat ones. Check what matters.
  • One request at a time. The model is shared by every session on the Mac, so calls queue: a short extract takes 1–2 s, a long summarise a minute or more.
  • Safety filter: the on-device model sometimes refuses harmless input. fm-mcp reports that clearly, and the agent does the task itself.

Privacy

Everything runs on your Mac. fm-mcp talks to fm serve over a local Unix socket and sends nothing over the network. Your text goes only to the on-device model.

Troubleshooting

Run fm-mcp doctor. It checks the Mac, macOS, fm, the licence, the model, a test request, and both agents' setup, and says how to fix anything that fails.

ProblemFix
Licence not agreedRun fm license once.
Model not availableTurn on Apple Intelligence in System Settings and wait for the model to finish downloading.
A tool says the model "got stuck"Usually a schema with fields the text doesn't contain, or another session using the model. Try a flatter schema.
A tool times out on long inputRaise the limit: set FM_MCP_REQUEST_TIMEOUT_SECS (default 120) in the MCP server's environment.
You need more detailSet FM_MCP_LOG=debug in the MCP server's environment. fm-mcp logs to stderr only (stdout carries the MCP protocol).

Uninstall

sh
fm-mcp install --uninstallbrew uninstall fm-mcp

Development

sh
git clone https://github.com/yrangana/fm-mcp.gitcd fm-mcpcargo build --release./target/release/fm-mcp install    # points your agents at this build
cargo test --features fake-fm      # needs no Apple Intelligence: uses a fake fmcargo clippy --all-targets --all-features -- -D warningscargo fmt --checkscripts/real_fm_smoke.sh           # checks against the real fm on this Mac

AGENTS.md has the architecture, the tested facts about fm serve, and the project rules. docs/MANUAL_TEST.md is the checklist for each release.

Licence

MIT. fm-mcp is not affiliated with or endorsed by Apple. It calls the fm tool installed on your Mac and includes nothing from Apple.

来源:README.md,提交 831d5dd

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v0.1.0最新Oct 10, 2026