cheap-eyes

io.github.st412m由 GitHub 账号 st412m 发布v0.2.1更新于 Oct 26, 2026

Hands bulk reading to cheap OpenRouter models, masks secrets, checks each answer against the source

概览

AI 生成的概览

把大段日志、文档和网页的阅读交给便宜的 OpenRouter 模型,并逐行核对模型引用的内容与原文,再返回简短答案。

可以做什么
  • 以 extract、draft、edits、schema 或 grep 模式对文件或网址执行阅读任务,返回简短且经过核对的摘要头
  • 读取已保存的结果:分页内容、grep 输出、核对报告、模型看到的原文,或取消正在运行的任务
  • 查看今日与累计花费、API 密钥状态,并列出候选模型
  • 读取文本、HTML、PDF、Word、RTF、PowerPoint、OpenDocument、EPUB、FB2 和邮件文件,或由服务器自行抓取 http(s) 网址
  • 在内容发往模型前遮蔽密钥,并把读取范围限制在配置的目录内
适用场景
适合需要按语义阅读大量文本的场景,例如日志归档、长文档、网页、“关于某主题的全部内容”,以节省上下文。若只是精确查找、看结构或处理约 30 KB 以下的小文件,用 grep 或分段读取更便宜也更可靠。
运行要求
本机需 Node.js 22.17 或更高版本(也可用 Docker 或 Home Assistant 应用)。需要 OpenRouter API 密钥,放在 CHEAP_EYES_OPENROUTER_KEY 中,并为其单独设置每日限额。需要 JSON 配置文件(路径由 CHEAP_EYES_CONFIG 指定),其中定义 read_roots 和模型别名。需能访问 openrouter.ai 及任务中指定的网址;HTTP 模式还需至少 32 字符的令牌并在前面加 TLS。
安装前请注意
会把文件内容和任务文本经 OpenRouter 发送给第三方模型,仅依靠密钥遮蔽和 Zero Data Retention 供应商。任务会产生费用:除密钥自身限额外,还有本地 daily_budget_usd 上限(默认 1.0 美元)。核对只能证明引用真实,不能证明答案完整或相关。edits 模式只提出修改建议,不会实际应用。HTTP 模式下令牌等同于密码。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

cheap-eyes

Cheap eyes for an expensive agent.

An AI agent's context is expensive. When it reads a big log, a long doc, a web page or a whole code tree, it burns that context on lines it mostly doesn't need. cheap-eyes is an MCP server that hands the reading to a cheap model. It then checks every line of that model's answer against the source, so the agent gets back a short answer it can trust.

What it looks like

A real header from the server (trimmed), with a stubbed model answer. The agent asked for every ERROR line after 08:10 in an app log, plus the traceback that follows it:

text
eyes_run result: 2026-09-26_152246-extract-889090model: alias fast -> qwen/qwen3.6-35b-a3b (used: qwen/qwen3.6-35b-a3b)tokens in 412 / out 96; cost $0.000080; 2 mscheck (extract): refs ok 4 / bad 1 — ok 4, ok~ 0, partial 0, not-in-input 0  L9 [bad] text differs from the source line--- untrusted model output ---L3| 2026-09-20 08:14:09.031 ERROR [sync] upload failed: timeout after 30 sL4| 2026-09-20 08:14:09.032 Traceback (most recent call last):L6| TimeoutError: timed outL8| 2026-09-20 08:15:31.550 ERROR [sync] upload failed: HTTP 503 from api.example.comL9| 2026-09-20 08:16:00.000 ERROR [sync] retry 2/3 failed--- end ---

The model quoted five lines. In the real log, line 9 says INFO [sync] retry 2/3 ok, so the model made up an error. The check compared each quote with the source line and flagged L9 as bad. The agent sees that before it relies on the answer.

Why you can trust the answer

  • The model has no tools. It can't open files, browse or call anything. It sees only the numbered lines cheap-eyes chose to send.
  • Secrets are masked before anything leaves your machine. Passwords, tokens and keys become [token], [key] and so on, in the files and in the task.
  • Only Zero Data Retention providers. Those are providers that don't store your prompts. cheap-eyes talks only to OpenRouter and asks for them on every call.
  • Every quote and line reference is checked mechanically against the lines that were sent. Wrong values and uncited claims are flagged.
  • What the check does not prove: that the answer is complete or relevant. It proves what was quoted is real, not that nothing was missed.

Requirements

RuntimeNode.js ≥ 22.17, or Docker, or Home Assistant OS / Supervised
Architecture (Home Assistant app)amd64, aarch64
Networkoutbound HTTPS to openrouter.ai, and to the web pages you name in a job; for claude.ai, a TLS reverse proxy reachable from the internet
Diskabout 56 MB installed, 33 MB of it pdfjs-dist with its CMaps and fonts; the optional @napi-rs/canvas adds a native binary of about 37 MB that text extraction does not need (npm install --omit=optional skips it)
OpenRouteran API key with its own daily limit

Installation

Claude Code / Claude Desktop (npx)

  1. Write a config file at ~/.config/cheap-eyes/config.json, or %APPDATA%\cheap-eyes\config.json on Windows (see Configuration).

  2. Check it (no network, no secrets printed): npx -y cheap-eyes check-config

  3. Add the server to Claude Code:

    sh
    claude mcp add --env CHEAP_EYES_OPENROUTER_KEY=<OPENROUTER_KEY> --transport stdio cheap-eyes -- npx -y cheap-eyes
  4. Try it: "Use eyes_run to list every TODO in /home/me/notes/**/*.md, with the line it's on."

Claude Desktop, .mcp.json and a global install: installation.

Home Assistant app

Home Assistant renamed add-ons to apps in 2026.2; on older versions the same menus say Add-ons and Add-on Store.

  1. Add this repository:

    [Open your Home Assistant instance and show the add app repository dialog with a specific repository URL pre-filled.]

    Or by hand: Settings → Apps → App Store → ⋮ → Repositories → + Add, paste https://github.com/st412m/cheap-eyes, select Add.

  2. Find cheap-eyes in the store and select Install.

  3. In Configuration, set openrouter_key, an http_token of at least 32 characters (openssl rand -hex 32 gives one) and your read_roots.

  4. Select Start. The app serves MCP on port 3400.

Options and the connector URL: app documentation.

Docker / HTTP

cheap-eyes serve --http runs the same server over Streamable HTTP with a token; the repository's Dockerfile and compose.example.yaml wrap it. See installation.

Configuration

A JSON config file. The fields to set first:

FieldWhat it is
read_rootsThe folders (or single files) the server may read. Absolute paths.
modelsAliases: an alias like fast is a short name for a list of model ids.
defaultsThe alias each mode uses when a call names none.
daily_budget_usdLocal spending cap per UTC day, default 1.0.
json
{  "read_roots": ["/home/me/notes"],  "models": { "fast": { "ids": ["qwen/qwen3.6-35b-a3b"], "params": { "reasoning": { "effort": "none" } } } },  "defaults": { "extract": "fast", "draft": "fast", "edits": "fast" }}

The key goes in the env var CHEAP_EYES_OPENROUTER_KEY, never in the file. Every field, env var and file location: configuration.

Connecting to claude.ai

Run the HTTP server (or the Home Assistant app) and publish it through a reverse proxy that terminates TLS. The endpoint is:

text
https://<your-host>/private_<your-token>/mcp

Add it in claude.ai → Settings → Connectors → Add custom connector. A wrong path gets a bare 404, and there is no OAuth by design. See security.

Using it

You talk to your agent as usual. It calls cheap-eyes when a job fits. Pick the mode by what you want back:

  • extract when you need exact lines: errors in a log, a config value, every mention of something. Invented lines are flagged.
  • draft when you want notes or a summary. Every line must cite its source lines. Values that aren't in those lines, and lines with no citation, are flagged.
  • edits when you want fixes proposed. You get JSON edits whose old text is checked against the file. cheap-eyes never applies them.
  • schema when you want fields filled: a JSON schema in, the same JSON out with a line ref and a verbatim quote for every value. Conflicting values are reported, not resolved.
  • grep when you know the exact pattern: matching windows, no model, $0.

Files can be text, HTML, PDF (with a text layer), Word (DOCX, DOC), RTF, PowerPoint (PPTX, PPT), OpenDocument text and presentations (ODT, ODP), EPUB, FB2 and mail (EML, MSG, attachments included), or an http(s) URL that the server fetches itself. Spreadsheets and scans are refused with the reason. Refs name the page, slide, chapter or attachment of a line: L40 (slide 3), L12 (attachment: offer.pdf, p.2) (formats).

Prompts you might type (the files must lie inside your read_roots):

  • "Use eyes_run to pull every ERROR from /var/log/app/app.log since 08:00 today, with the tracebacks."
  • "Have cheap-eyes draft a summary of /home/me/notes/deploy.md: versions, ports, backup times."
  • "Use eyes_run in edits mode to fix the dead links in /home/me/notes/*.md."
  • "Use eyes_run in schema mode on /home/me/docs/tender.pdf: customer, maximum price, deadline, and the list of items with quantities."

What each check catches and misses: checks.

When to use cheap-eyes and when grep

cheap-eyes pays off for reading by meaning over large text: logs, archives, long documents, web pages, "everything about X", chronologies. For exact lookups — a key, which blocks contain X, a list by a field, a value in a table — and for files under about 30 KB, grep, a ranged read or code is cheaper and more reliable. That is why spreadsheets are not read at all.

On a benchmark of 2026-09-30 with independent ground truth:

  • An 887 KB log archive, task "everything about power": recall 96 %, precision 100 %, $0.08, about 12k tokens of the agent's context instead of about 227k for reading it whole.
  • A structural task over Home Assistant automations ("who sends to Telegram"): precision 41 % with a green check. The check catches invented lines, not wrongly chosen ones.

A snippet for CLAUDE.md or your Claude settings:

Reading by meaning over large text (logs, archives, long documents, web pages, "everything about X") → cheap-eyes eyes_run (extract/draft; fields → schema). Exact values, structure, small files (< ~30 KB) → grep / ranged read (no model: eyes_run mode grep). Verify any value from cheap-eyes against the source (eyes_result source) before relying on it.

To compare models on your own documents, run cheap-eyes bench.

Tools

  • eyes_run — does the job and returns a short, checked header.
  • eyes_result — reads a stored result: pages, grep, the check report, the source text the model was given; cancels a running job.
  • eyes_stats — spend today and all time, your key's status; on request, the model table.

Inputs and outputs: tools.

Models and cost

No model is pinned in code. You name models in your config under aliases (fast, long, …), and switching means editing the config and restarting. Each alias lists model ids in priority order; if one can't be used, the next is tried. The example ids were valid on 2026-09-26 and will age. To pick new ones:

sh
cheap-eyes models --candidates

This lists cheap Zero Data Retention models, and shows how well each of your aliases passed its checks on your own jobs. If your OpenRouter account's Guardrails don't allow a model, cheap-eyes skips it and marks it blocked by account. Allow it at openrouter.ai → Guardrails if you want it used.

With cheap models a job costs fractions of a cent. Your key's own daily limit on OpenRouter is the real ceiling. On top of that, daily_budget_usd (default $1 a day) stops calls before they would go over. More: models and spending.

Limitations

  • The check proves quotes are real, not that the answer is complete. A relevant line the model skipped is not flagged.
  • No OCR. Scanned PDFs are refused with the reason; layout and images are lost in extraction.
  • No spreadsheets. Excel and OpenDocument spreadsheets are refused: questions about a table are exact lookups, which grep or code answers and a model reading the table as text gets wrong.
  • Size caps. A text file (or the text extracted from a document) over 2 MB is refused, never truncated; a document over 50 MB and a URL over 10 MB likewise; a job is capped at 5 MB after filtering and 200 files.
  • No reduce pass for draft. With several chunks, each chunk's notes come back under their own header.
  • The hook covers Claude Code's Read tool only. Shell commands are not intercepted.

Troubleshooting

  • OpenRouter answers 403 "Access denied by security policy". OpenRouter refuses some regions; route the calls through a proxy.
  • A model is blocked by account. Allow it at openrouter.ai → Guardrails, or put another id in the alias.
  • The server won't start and names an alias. A value in defaults is not defined in models.
  • The client shows old tools after an update. Refresh the connector's tool list and start a new chat.

More: troubleshooting.

Security

  • The model gets no tools; everything it returns is framed as untrusted output.
  • Only files inside read_roots are read, after resolving symlinks; .env*, keys, secrets.yaml, databases and .git are always refused.
  • Secrets are masked before anything leaves the machine; model calls go only to openrouter.ai, with Zero Data Retention required.
  • URLs in a job are fetched by the server with private and local addresses refused, also against DNS rebinding.
  • The server writes nowhere outside its own state folder unless you opt into export.
  • In HTTP mode the token works as a password. It needs at least 32 characters and is never logged; put TLS in front. Request bodies over 1 MiB are refused.

More: security.

Links

Prior art

Both MIT-licensed; cheap-eyes is written from scratch (see NOTICE).

  • BardyLaw/claude-worker-delegation — the server reads files by path, short preview, usage log, daily budget, PreToolUse hook. cheap-eyes adds what it lacked: a realpath path guard, refusal instead of silent truncation, masking, line numbers and checking the output.
  • aashahin/claude-opencode-delegate — async task registry, compact status header.

License

MIT — by st412m.

来源:README.md,提交 e51112c

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

2
  1. v0.2.1最新Oct 26, 2026
  2. v0.2.0Oct 9, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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