@sylphx/image-reader-mcp 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,34 +1,240 @@
1
- # Image Reader MCP
1
+ <div align="center">
2
2
 
3
- > Evidence-first image reading for AI agents — metadata, OCR text, regions, and citeable evidence without generative LLM.
3
+ # Iris
4
4
 
5
- **Status:** v0.1.0 shipped `read_image` MCP tool available (metadata, dimensions, optional OCR, trust warnings).
5
+ ### Image evidence for agents
6
6
 
7
- Orchestrated by [smart-reader-mcp](https://github.com/SylphxAI/smart-reader-mcp) — portfolio ADR lives there, not in pdf-reader-mcp.
7
+ **Iris** (transitional package `@sylphx/image-reader-mcp`) — local-first image facts, not default VLM guesses.
8
8
 
9
- | Repository | Role |
9
+ <p align="center">
10
+ <img src="https://mark.sylphx.com/api/v1/banner?type=holo&theme=tokyonight&text=image+reader+mcp&desc=Evidence-first+image+reading+for+AI+agents+%E2%80%94+metadata%2C+OCR+text%2C+regions%2C+and+ci&height=200&animation=rise&credit=0" alt="image-reader-mcp — Sylphx Mark banner" width="100%" />
11
+ </p>
12
+
13
+ ### Your agent looked at the image. **Did it see the truth?**
14
+
15
+ Evidence-first image reading for AI agents. One call turns any local image into an
16
+ **Agent Media Twin** — dimensions, metadata, optional OCR with bounding boxes, and
17
+ trust warnings you can cite without asking a vision LLM to guess.
18
+
19
+ [![npm version](https://img.shields.io/npm/v/@sylphx/image-reader-mcp?style=flat-square)](https://www.npmjs.com/package/@sylphx/image-reader-mcp)
20
+ [![License](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](https://opensource.org/licenses/MIT)
21
+ [![CI/CD](https://img.shields.io/github/actions/workflow/status/SylphxAI/image-reader-mcp/ci.yml?style=flat-square&label=CI/CD)](https://github.com/SylphxAI/image-reader-mcp/actions/workflows/ci.yml)
22
+ [![TypeScript](https://img.shields.io/badge/TypeScript-7.0-blue.svg?style=flat-square)](https://www.typescriptlang.org/)
23
+
24
+ **Local-first** · **One smart `read_image` call** · **Evidence with bbox + provenance** · **23 tests**
25
+
26
+ SOTA family roadmap: [docs/roadmap/sota-family-roadmap.md](docs/roadmap/sota-family-roadmap.md).
27
+
28
+ [⭐ Star this repo](https://github.com/SylphxAI/image-reader-mcp) if agents should read images with facts, not vision-model guesses.
29
+ · [Quick start](#quick-start) · [See it work](#see-it-work) · [Why not vision LLM guess?](#why-not-vision-llm-guess)
30
+
31
+ This repository is product SSOT. Sibling agent tools live in separate repos.
32
+ Each instrument is an independent repository (marketplace + stars).
33
+
34
+ </div>
35
+
36
+ ---
37
+
38
+
39
+ ## Product docs
40
+
41
+ | Doc | Purpose |
10
42
  | --- | --- |
11
- | [pdf-reader-mcp](https://github.com/SylphxAI/pdf-reader-mcp) | PDF (production) |
12
- | **image-reader-mcp** (this repo) | Image |
13
- | [video-reader-mcp](https://github.com/SylphxAI/video-reader-mcp) | Video |
14
- | [smart-reader-mcp](https://github.com/SylphxAI/smart-reader-mcp) | Unified read + delegate |
43
+ | [docs/POSITIONING.md](docs/POSITIONING.md) | Strategic positioning |
44
+ | [docs/COMPETITIVE.md](docs/COMPETITIVE.md) | Peer anchors and wedge |
45
+ | [docs/EVIDENCE_CONTRACT.md](docs/EVIDENCE_CONTRACT.md) | Evidence = result contract |
46
+ | [docs/TOOL_SURFACE.md](docs/TOOL_SURFACE.md) | Few clear tools policy |
47
+ | [docs/PRODUCT_INDEPENDENCE.md](docs/PRODUCT_INDEPENDENCE.md) | This repo is SSOT |
48
+ | [docs/IPPB.md](docs/IPPB.md) | Independent public product bar |
49
+ | [docs/PUBLISH.md](docs/PUBLISH.md) | npm/git publish status |
15
50
 
16
- ## Read vs interpret
51
+ ## The problem
17
52
 
18
- **Read** (this repo): extract facts, metadata, transcripts, regions, and timelines with provenance — **no generative LLM required**.
53
+ Images are not filenames. They are pixels, EXIF, orientation, embedded GPS,
54
+ hidden metadata, and text that only exists if you OCR it with geometry.
19
55
 
20
- **Interpret** (out of scope): summarize, classify, or answer open questions belongs in the agent or an optional remote provider adapter.
56
+ Most agent stacks route images through a **vision LLM** and get a plausible
57
+ description. Dimensions get rounded. OCR text gets paraphrased. Metadata
58
+ disappears. Citations become "the model said so." Then the agent hallucinates —
59
+ confidently.
21
60
 
22
- ## MCP surface
61
+ **Image Reader MCP is built for the moment your agent needs measurable facts about
62
+ an image, not a creative caption.**
23
63
 
24
- Primary tool: `read_image` returns an Agent Media Twin JSON payload with filename, mime, dimensions, metadata (GPS redacted), optional OCR lines with bounding boxes, and trust warnings.
64
+ ## Why not vision LLM guess?
65
+
66
+ | Typical vision path | Image Reader MCP |
67
+ | --- | --- |
68
+ | "Describe this image" | Return filename, mime, dimensions, and structured metadata |
69
+ | Paraphrased OCR | Optional Tesseract lines with bounding boxes and confidence |
70
+ | GPS and EXIF leak into context | GPS redacted; trust warnings for suspicious metadata |
71
+ | No provenance | Agent Media Twin JSON with measurable, citeable fields |
72
+ | Cloud API by default | **Local-first** — sharp + exifr on your machine |
73
+ | Ship and pray | **23** unit tests on schema, metadata, OCR hooks, safety limits, doctor, and release gate |
25
74
 
26
- ## Quick start
75
+ ## See it work
76
+
77
+ ### Install (30 seconds)
78
+
79
+ ```bash
80
+ npm install -g @sylphx/image-reader-mcp
81
+ iris doctor
82
+ claude mcp add iris -- npx @sylphx/image-reader-mcp
83
+ ```
84
+
85
+ **Install once. Call once.**
86
+
87
+ ```bash
88
+ claude mcp add image-reader -- npx @sylphx/image-reader-mcp
89
+ ```
90
+
91
+ ```json
92
+ {
93
+ "path": "/absolute/path/to/photo.jpg",
94
+ "include_metadata": true,
95
+ "include_ocr": true
96
+ }
97
+ ```
98
+
99
+ `read_image` inspects the file locally and returns an Agent Media Twin — no
100
+ generative LLM required:
101
+
102
+ ```json
103
+ {
104
+ "filename": "photo.jpg",
105
+ "mime": "image/jpeg",
106
+ "dimensions": { "width": 4032, "height": 3024 },
107
+ "orientation": 1,
108
+ "metadata": {
109
+ "Make": "ExampleCamera",
110
+ "Model": "Pro X",
111
+ "DateTimeOriginal": "2026-03-15T14:22:10"
112
+ },
113
+ "ocr": {
114
+ "available": true,
115
+ "lines": [
116
+ {
117
+ "text": "INVOICE #1042",
118
+ "bbox": { "x": 120, "y": 48, "width": 310, "height": 36 },
119
+ "confidence": 92
120
+ }
121
+ ]
122
+ },
123
+ "trust_warnings": []
124
+ }
125
+ ```
126
+
127
+ Abbreviated shape — optional OCR skips gracefully when Tesseract is not installed.
128
+
129
+ ## MCP Tool Surface
130
+
131
+ | Tool | Use it when the agent needs to... |
132
+ | --- | --- |
133
+ | `read_image` | Read a local image and return dimensions, mime, metadata, optional OCR, and trust warnings. |
134
+
135
+ Supported formats: PNG, JPEG, GIF, WebP, TIFF, and other formats sharp can decode.
136
+
137
+ ## Quick Start
138
+
139
+ ### Claude Code
140
+
141
+ ```bash
142
+ claude mcp add image-reader -- npx @sylphx/image-reader-mcp
143
+ ```
144
+
145
+ ### Claude Desktop
146
+
147
+ Add this to `claude_desktop_config.json`:
148
+
149
+ ```json
150
+ {
151
+ "mcpServers": {
152
+ "image-reader": {
153
+ "command": "npx",
154
+ "args": ["@sylphx/image-reader-mcp"]
155
+ }
156
+ }
157
+ }
158
+ ```
159
+
160
+ ### Any MCP Client
27
161
 
28
162
  ```bash
29
163
  npx @sylphx/image-reader-mcp
30
164
  ```
31
165
 
166
+ Node.js `>=22.13` is required. Optional OCR uses a local Tesseract adapter when
167
+ installed — no cloud credentials required by default.
168
+
169
+ ## Security model
170
+
171
+ - **Local-first** — `read_image` resolves paths on the local machine; no cloud vision API by default.
172
+ - **GPS redaction** — location metadata is stripped from agent-facing output unless explicitly opted in.
173
+ - **Size and format limits** — oversized or unsupported inputs return structured errors, not partial guesses.
174
+ - **Optional OCR** — Tesseract runs locally when installed; missing OCR is reported as `available: false`, not silent failure.
175
+ - **Trust warnings** — suspicious EXIF, orientation, or metadata anomalies surface in `trust_warnings` for agent verification.
176
+
177
+ ## Release proof
178
+
179
+ Claims are backed by CI `benchmark:release-gate` and the shipped-path matrix (Rust-default route, no legacy Node engine on primary tools).
180
+
181
+ ```bash
182
+ bun run benchmark:release-gate
183
+ ```
184
+
185
+ Artifact: `benchmark-artifacts/image_reader_release_gate.json` — must report `status: passed` before release.
186
+
187
+ ## Development
188
+
189
+ ```bash
190
+ git clone https://github.com/SylphxAI/image-reader-mcp.git
191
+ cd image-reader-mcp
192
+ bun install
193
+ bun run build
194
+ bun test
195
+ bun run doctor
196
+ bun run benchmark:release-gate
197
+ ```
198
+
199
+ Useful checks:
200
+
201
+ ```bash
202
+ bun run check
203
+ bun run typecheck
204
+ bun run validate
205
+ bun run benchmark:release-gate
206
+ ```
207
+
208
+ Example `read_image` requests live in [`examples/`](examples/).
209
+
210
+ ## Support
211
+
212
+ - [Issues](https://github.com/SylphxAI/image-reader-mcp/issues)
213
+ - [npm package](https://www.npmjs.com/package/@sylphx/image-reader-mcp)
214
+ - Portfolio orchestration: [smart-reader-mcp](https://github.com/SylphxAI/smart-reader-mcp)
215
+
216
+ ## Help this reach more builders
217
+
218
+ If vision-model guesses have wasted your context, your citations, or your trust
219
+ in agent output, you are exactly who this project is for.
220
+
221
+ **[⭐ Star the repo](https://github.com/SylphxAI/image-reader-mcp)** — it is the
222
+ fastest way to help more agent builders find evidence-first image reading. Share
223
+ it in your MCP client setup, team wiki, or agent stack README.
224
+
225
+ ### Discovery (in progress)
226
+
227
+ | Channel | Status |
228
+ | --- | --- |
229
+ | [Glama MCP directory](https://glama.ai/mcp/servers/SylphxAI/image-reader-mcp) | Listed — [claim server](https://glama.ai/mcp/servers/SylphxAI/image-reader-mcp/admin) for full discoverability |
230
+ | [Official MCP Registry](https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.SylphxAI/image-reader-mcp) | Listed — `io.github.SylphxAI/image-reader-mcp` @ v0.1.0 |
231
+ | [TensorBlock MCP Index PR #1113](https://github.com/TensorBlock/awesome-mcp-servers/pull/1113) | Open — multimedia/document processing listing |
232
+ | [MCP servers community issue #4500](https://github.com/modelcontextprotocol/servers/issues/4500) | Open — community server highlight |
233
+ | [mcp.so listing issue #3068](https://github.com/chatmcp/mcpso/issues/3068) | Open — directory submission request |
234
+ | [mcpservers.org submit](https://mcpservers.org/submit) | Not listed yet — free web-form submission |
235
+
236
+ Know another MCP directory? [Open an issue](https://github.com/SylphxAI/image-reader-mcp/issues/new) with the link.
237
+
32
238
  ## License
33
239
 
34
- MIT © [SylphxAI](https://github.com/SylphxAI)
240
+ MIT © [SylphxAI](https://github.com/SylphxAI)
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env bash
2
+ # Image Reader MCP launcher — Rust rmcp only (fail-closed, no TS stdio fallback).
3
+ set -euo pipefail
4
+
5
+ ROOT="$(cd "$(dirname "$0")/.." && pwd)"
6
+
7
+ resolve_rust_bin() {
8
+ if [[ -n "${IMAGE_READER_MCP_RUST_BIN:-}" && -x "${IMAGE_READER_MCP_RUST_BIN}" ]]; then
9
+ printf '%s\n' "${IMAGE_READER_MCP_RUST_BIN}"
10
+ return 0
11
+ fi
12
+
13
+ for candidate in \
14
+ "$ROOT/bin/native/image-reader-mcp-server" \
15
+ "$ROOT/target/release/image-reader-mcp-server" \
16
+ "$ROOT/target/debug/image-reader-mcp-server"; do
17
+ if [[ -x "$candidate" ]]; then
18
+ printf '%s\n' "$candidate"
19
+ return 0
20
+ fi
21
+ done
22
+
23
+ return 1
24
+ }
25
+
26
+ resolve_transport() {
27
+ if [[ -n "${IMAGE_READER_MCP_TRANSPORT:-}" ]]; then
28
+ printf '%s\n' "${IMAGE_READER_MCP_TRANSPORT}"
29
+ return 0
30
+ fi
31
+ if [[ -n "${MCP_TRANSPORT:-}" ]]; then
32
+ printf '%s\n' "${MCP_TRANSPORT}"
33
+ return 0
34
+ fi
35
+ printf '%s\n' "stdio"
36
+ }
37
+
38
+ if bin="$(resolve_rust_bin)"; then
39
+ transport="$(resolve_transport)"
40
+ if [[ "$transport" == "http" ]]; then
41
+ export MCP_TRANSPORT=http
42
+ export IMAGE_READER_MCP_TRANSPORT=http
43
+ fi
44
+ exec "$bin" "$@"
45
+ fi
46
+
47
+ echo "[image-reader-mcp] Rust MCP server (rmcp) is not built. Run: bun run build:rust" >&2
48
+ exit 1