rubien-mcp-server 0.1.0 → 0.2.0

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,179 +1,164 @@
1
1
  # rubien-mcp-server
2
2
 
3
- A Model Context Protocol server that wraps `rubien-cli`, making the Rubien reference library available to Claude Code, Claude Desktop, and claude.ai chat as a callable tool catalog.
3
+ A Model Context Protocol server that wraps `rubien-cli`, exposing your Rubien library to Claude Code, Claude Desktop, and claude.ai (web) as a tool catalog. It spawns `rubien-cli` under the hood and speaks MCP over two transports:
4
4
 
5
- The server is a thin Node/TypeScript process. It spawns `rubien-cli` under the hood and speaks MCP over one of two transports:
5
+ - **stdio** Claude Code and Claude Desktop. The client spawns the server locally. No network, no auth. What most people want; see [Install](#install).
6
+ - **Streamable HTTP + bearer token** — claude.ai (web) connects as a *remote MCP server* (it can't spawn a local process), so it needs a tunnel. See [claude.ai web](#claudeai-web-remote-mcp-server).
6
7
 
7
- - **stdio** used by **Claude Code** and **Claude Desktop**. The client launches the server as a child process and talks to it over the pipe. No network, no auth.
8
- - **Streamable HTTP with bearer-token auth** — used by **claude.ai (web)** via a custom MCP connector. Requires a tunnel (e.g. Cloudflare Tunnel) because your library lives on your Mac.
8
+ ## Requirement: `rubien-cli` on the host
9
9
 
10
- Pick the section below that matches your client. Most users want one of the two stdio paths.
10
+ The server is only a wrapper. It needs **Node.js 20** and the `rubien-cli` binary:
11
11
 
12
- ## Install (Claude Code)
12
+ - **Mac:** install **Rubien.app** (the DMG). The entitled `rubien-cli` ships inside it and is found automatically.
13
+ - **Linux:** install the runtime libs and extract the CLI tarball, keeping `rubien-cli` and its `*.resources` folders together (the CLI loads citation styles from beside the binary):
14
+ ```bash
15
+ sudo apt install libsqlite3-0 libcurl4 libxml2 libpoppler-glib8 libcairo2 libgdk-pixbuf-2.0-0 libglib2.0-0 ca-certificates
16
+ # download rubien-cli-*-linux-x86_64.tar.gz, extract, then:
17
+ export RUBIEN_CLI=/path/to/extracted/rubien-cli
18
+ ```
19
+ Tarball: <https://github.com/devzhk/Rubien-releases/releases>. Don't put the bare binary on `PATH` alone — it loses its resource bundles.
13
20
 
14
- ```bash
15
- claude mcp add rubien -- npx -y rubien-mcp-server
16
- ```
17
-
18
- This needs `rubien-cli` on the host:
19
- - **Mac:** install Rubien.app (DMG) — the entitled `rubien-cli` ships inside it; nothing else to do.
20
- - **Linux:** `sudo apt install libsqlite3-0 libcurl4 libxml2 libpoppler-glib8 libcairo2 libgdk-pixbuf-2.0-0 libglib2.0-0 ca-certificates`, then download `rubien-cli-*-linux-x86_64.tar.gz` from
21
- https://github.com/devzhk/Rubien-releases/releases and **extract it to a directory, keeping `rubien-cli` and the `*.resources` folders together** (the CLI loads citation styles from beside the binary). Point the server at it: `export RUBIEN_CLI=/path/to/extracted/rubien-cli`. Do **not** copy the bare binary onto `PATH` alone — it would lose its resource bundles.
22
-
23
- The server checks the CLI's build at startup; if it's too old it prints an update
24
- instruction and exits (rather than failing mid-call). On **Mac**, update Rubien.app
25
- (Sparkle). On **Linux**, run `rubien-cli self-update` (signature-verified, replaces in
26
- place) — or re-download the tarball.
27
-
28
- ## Prerequisites
21
+ At startup the server checks the CLI's build and exits with an update instruction if it's too old. Update via Rubien.app / Sparkle on Mac, or `rubien-cli self-update` on Linux.
29
22
 
30
- - Node.js ≥ 20
31
- - `rubien-cli` reachable on the host. The server looks for it in this order:
32
- 1. `$RUBIEN_CLI` env var (explicit path)
33
- 2. `/Applications/Rubien.app/Contents/Helpers/rubien-cli` (installed app bundle, Mac)
34
- 3. `~/Applications/Rubien.app/Contents/Helpers/rubien-cli` (Mac)
35
- 4. `./build/Rubien.app/Contents/Helpers/rubien-cli` (dev build output, Mac)
36
- 5. `rubien-cli` on `PATH` (Linux installs land here — see the **Install** section above)
23
+ ## Install
37
24
 
38
- **On Mac, prefer the bundled helper.** It's signed with the App Group entitlement and reads the same `library.sqlite` the Rubien app uses. A bare `rubien-cli` on PATH is typically an SPM dev build without the entitlement, which hits a *different* database see "Database location" in `Docs/CLI-Reference.md`.
25
+ Both stdio clients use the published npm package via `npx -y` — no global install.
39
26
 
40
- **On Linux**, the server runs against a `rubien-cli` installed per the **Install** section above (prebuilt Linux tarball, or built from source). Everything works except `rubien_sync_status`, which always errors (`sync` subcommand isn't registered on Linux builds — CloudKit doesn't exist there).
41
-
42
- To pin the spawned CLI to a specific library directory regardless of which binary resolves, set `RUBIEN_LIBRARY_ROOT` in the MCP server's `env` block (Claude Code: `claude mcp add rubien --env RUBIEN_LIBRARY_ROOT=...`; Claude Desktop: under `mcpServers.rubien.env` in `claude_desktop_config.json`). The path is used verbatim — point it at the directory that contains `library.sqlite`:
43
-
44
- - Mac sandboxed: `~/Library/Group Containers/9TXK4V3SS8.com.rubien.shared/Rubien`
45
- - Mac unsandboxed: `~/Library/Application Support/Rubien`
46
- - Linux: `~/.local/share/rubien` (or wherever `$XDG_DATA_HOME/rubien` resolved to)
47
-
48
- ## Claude Code (stdio)
49
-
50
- The npx command above is the recommended path. To run a local checkout instead (see [Development](#development) for the build):
27
+ ### Claude Code
51
28
 
52
29
  ```bash
53
- claude mcp add rubien node $(pwd)/dist/index.js
30
+ claude mcp add rubien -- npx -y rubien-mcp-server
54
31
  ```
55
32
 
56
- Try it:
57
-
58
- > List my 5 most recently added references.
59
- > Cite reference 42 in Nature style.
33
+ ### Claude Desktop
60
34
 
61
- Claude Code's permission UI prompts for the destructive tools (`rubien_delete`, `rubien_update`, `rubien_import`, and the property write tools) on first use.
62
-
63
- ## Claude Desktop (stdio)
64
-
65
- Claude Desktop spawns MCP servers itself — no tunnel, no bearer token. Add Rubien to `claude_desktop_config.json` via either route:
66
-
67
- - **Edit the file directly** at `~/Library/Application Support/Claude/claude_desktop_config.json`.
68
- - **Settings → Developer → Edit Config** in Claude Desktop, which opens the same file in your editor.
69
-
70
- Add Rubien under `mcpServers`:
35
+ **Settings Developer Edit Config** (or edit `~/Library/Application Support/Claude/claude_desktop_config.json`), then restart Claude Desktop:
71
36
 
72
37
  ```json
73
38
  {
74
39
  "mcpServers": {
75
40
  "rubien": {
76
- "command": "node",
77
- "args": ["/absolute/path/to/Rubien/mcp-server/dist/index.js"]
41
+ "command": "npx",
42
+ "args": ["-y", "rubien-mcp-server"]
78
43
  }
79
44
  }
80
45
  }
81
46
  ```
82
47
 
83
- Restart Claude Desktop and Rubien appears in the tool picker. To pin the spawned CLI to a specific library (see *Prerequisites* above for paths), add an `env` block:
48
+ **macOS PATH gotcha:** Claude Desktop launches servers with launchd's minimal `PATH`, not your shell's. If `npx` isn't found, set `"command"` to its absolute path (`which npx` e.g. `/opt/homebrew/bin/npx`). Affects every npx-based server; Claude Code is unaffected. No `.dxt` one-click package yet.
84
49
 
85
- ```json
86
- "rubien": {
87
- "command": "node",
88
- "args": ["/absolute/path/to/Rubien/mcp-server/dist/index.js"],
89
- "env": {
90
- "RUBIEN_LIBRARY_ROOT": "/Users/you/Library/Group Containers/9TXK4V3SS8.com.rubien.shared/Rubien"
91
- }
92
- }
93
- ```
94
-
95
- > **Future work — Desktop Extension (`.dxt`).** Claude Desktop also supports one-click MCP installs via `.dxt` packages (a zip containing a `manifest.json` + bundled server). Rubien doesn't ship one yet; packaging it would replace the config-file edit above with a double-click install from a GitHub Release asset.
50
+ ## claude.ai web (remote MCP server)
96
51
 
97
- ## claude.ai web (Streamable HTTP + Cloudflare Tunnel)
98
-
99
- claude.ai (the web app at https://claude.ai) can't spawn a local process, so it talks to the server over HTTPS via a custom MCP connector. Since your library lives on your Mac, you'll need a tunnel to expose the local server, and bearer-token auth to keep strangers out.
52
+ claude.ai connects to rubien as a **remote MCP server** over Streamable HTTP it can't spawn a local process. It's the *same npm package* in HTTP mode: the server still runs on your Mac (where the library and `rubien-cli` live), and claude.ai reaches it through a Cloudflare Tunnel, with a bearer token to keep strangers out.
100
53
 
101
54
  ```bash
102
- # 1. Start the server with a bearer token
55
+ # 1. Start the server in HTTP mode with a bearer token
103
56
  RUBIEN_MCP_BEARER=$(openssl rand -hex 32) \
104
- node dist/index.js --http --port 4000 --bearer-token "$RUBIEN_MCP_BEARER"
57
+ npx -y rubien-mcp-server --http --port 4000 --bearer-token "$RUBIEN_MCP_BEARER"
105
58
 
106
59
  # 2. Open a tunnel
107
60
  cloudflared tunnel --url http://localhost:4000
108
61
  # → copy the https://*.trycloudflare.com URL
109
62
 
110
- # 3. In claude.ai: Settings → Connectors → Add custom MCP connector
111
- # URL: https://<your-tunnel>.trycloudflare.com
112
- # Token: $RUBIEN_MCP_BEARER (from step 1)
63
+ # 3. claude.ai Settings → Connectors → Add custom MCP connector
64
+ # URL: the tunnel URL; Token: $RUBIEN_MCP_BEARER
113
65
  ```
114
66
 
115
- Save the bearer token — you'll need it to reconnect after restarts.
67
+ Save the token — you need it to reconnect after restarts.
68
+
69
+ ### Security model
116
70
 
117
- ## Security model
71
+ The remote path is **single-user personal use only.**
118
72
 
119
- This server is designed for **single-user personal use** only.
73
+ - The bearer token is a long-lived static secret — no rotation, revocation, rate limiting, or replay protection. Treat it like an SSH key; regenerate if leaked.
74
+ - Cloudflare Tunnel terminates TLS, so the token travels over HTTPS. A plaintext tunnel (e.g. raw ngrok HTTP) exposes it to sniffing.
75
+ - A leaked URL without the token is safe (every request gets a 401) — but rotate both if in doubt.
120
76
 
121
- - The bearer token is a long-lived static secret. There's no rotation, revocation, rate limiting, or replay protection.
122
- - The server will happily accept any request with the correct token. Don't paste the token into anything you don't trust, and treat a leaked token like an SSH key — regenerate immediately.
123
- - Cloudflare Tunnel provides TLS termination; the token travels over HTTPS. If you use a plaintext tunnel (e.g. raw ngrok HTTP) the token can be sniffed.
124
- - A leaked URL without the token is safe — every request gets a 401 — but rotate both if in doubt.
77
+ Multi-user would need a real auth story: OAuth, short-lived tokens, per-client revocation.
125
78
 
126
- If this setup ever becomes multi-user, the auth layer needs a real story: OAuth, short-lived tokens, and per-client revocation.
79
+ ## Optional configuration
80
+
81
+ ### Pin the library directory
82
+
83
+ By default the CLI resolves its own library location. To force one, set `RUBIEN_LIBRARY_ROOT` to the directory containing `library.sqlite`:
84
+
85
+ - Claude Code: `claude mcp add rubien --env RUBIEN_LIBRARY_ROOT=<dir> -- npx -y rubien-mcp-server`
86
+ - Claude Desktop: add `"env": { "RUBIEN_LIBRARY_ROOT": "<dir>" }` beside `command`/`args`.
87
+
88
+ | Host | Directory |
89
+ |---|---|
90
+ | Mac (sandboxed app) | `~/Library/Group Containers/9TXK4V3SS8.com.rubien.shared/Rubien` |
91
+ | Mac (unsandboxed dev) | `~/Library/Application Support/Rubien` |
92
+ | Linux | `~/.local/share/rubien` (or `$XDG_DATA_HOME/rubien`) |
93
+
94
+ ### How the server finds `rubien-cli`
95
+
96
+ First hit wins:
97
+
98
+ 1. `$RUBIEN_CLI` (explicit path)
99
+ 2. `/Applications/Rubien.app/Contents/Helpers/rubien-cli` (Mac)
100
+ 3. `~/Applications/Rubien.app/Contents/Helpers/rubien-cli` (Mac)
101
+ 4. `./build/Rubien.app/Contents/Helpers/rubien-cli` (dev build, Mac)
102
+ 5. `rubien-cli` on `PATH` (Linux installs land here)
103
+
104
+ **On Mac, prefer the bundled helper** (2–4): it's signed with the App Group entitlement and reads the same `library.sqlite` as the app. A bare `rubien-cli` on PATH is usually an unentitled dev build hitting a *different* database (see "Database location" in `Docs/CLI-Reference.md`).
105
+
106
+ **On Linux**, everything works except `rubien_sync_status` (no CloudKit — the `sync` subcommand isn't built).
107
+
108
+ ### Run a local checkout
109
+
110
+ For development, point the client at a built `dist/` (see [Development](#development)):
111
+
112
+ ```bash
113
+ claude mcp add rubien -- node $(pwd)/dist/index.js # Claude Code
114
+ ```
115
+ ```json
116
+ { "mcpServers": { "rubien": { "command": "node", "args": ["/abs/path/to/mcp-server/dist/index.js"] } } }
117
+ ```
127
118
 
128
119
  ## Tool catalog
129
120
 
130
- Roughly 36 tools covering every `rubien-cli` subcommand mode. Names are `rubien_<subject>_<action>` so Claude can pick the right tool from a single-word hint:
121
+ 35 tools, one per `rubien-cli` subcommand mode, named `rubien_<subject>_<action>`:
131
122
 
132
123
  | Surface | Tools |
133
124
  |---|---|
134
125
  | References | `rubien_search`, `rubien_list`, `rubien_get`, `rubien_add`, `rubien_update`, `rubien_delete` |
135
126
  | Citations | `rubien_cite`, `rubien_styles_list` |
136
127
  | Import/Export | `rubien_import`, `rubien_export` |
137
- | PDFs | `rubien_pdf_info`, `rubien_pdf_text`, `rubien_pdf_page_image`, `rubien_pdf_download`, `rubien_annotations_list` |
138
- | Web clips | `rubien_web_get`, `rubien_web_annotations` |
128
+ | Reading | `rubien_read_text`, `rubien_read_annotations`, `rubien_grep_text` |
129
+ | PDFs | `rubien_pdf_info`, `rubien_pdf_page_image`, `rubien_pdf_download` |
139
130
  | Properties (incl. Tags) | `rubien_properties_list`, `rubien_properties_create`, `rubien_properties_delete`, `rubien_properties_rename`, `rubien_properties_show`, `rubien_properties_hide`, `rubien_properties_add_option`, `rubien_properties_rename_option`, `rubien_properties_delete_option`, `rubien_properties_set`, `rubien_properties_add_values`, `rubien_properties_remove_values`, `rubien_properties_clear` |
140
131
  | Saved views | `rubien_views_list`, `rubien_views_create`, `rubien_views_delete`, `rubien_views_rename`, `rubien_views_query` |
141
- | Sync | `rubien_sync_status` (Mac-only — errors on Linux hosts) |
132
+ | Sync | `rubien_sync_status` (Mac-only — errors on Linux) |
133
+
134
+ `rubien_import` accepts an absolute path on the host or a direct HTTP(S) URL with a `.pdf`, `.md`, or `.markdown` path extension. Direct URLs are validated by `rubien-cli` before import; stdin (`"-"`) is intentionally unavailable through MCP.
142
135
 
143
- The PDF tools cover inspection and acquisition `rubien_pdf_info` returns page count plus a flattened outline, `rubien_pdf_text` extracts text by page range or section title, `rubien_pdf_page_image` renders a page to PNG for figure inspection, and `rubien_pdf_download` fetches an open-access PDF for an existing reference and attaches it to the library. `rubien_annotations_list` returns the user's highlights/underlines/anchored-notes on the attached PDF.
136
+ Reading tools operate on any reference without your knowing whether it holds a PDF or a clipped web page. `rubien_read_text` returns the readable body text — the attached PDF or the clipped web page routed automatically: omit `source` and `pages`/`sections` imply the PDF, `start` implies the web body, else PDF wins when both exist. Every response reports `source` (what was read) and `available` (which sources are readable now). PDF results are page-keyed (`pages[]` items with `text` + `sectionPath`, selected by a `pages` range or `sections` title-substrings); web results are one paginated body window (`content` + `contentLength`, `start`/`maxChars`; `contentFormat` markdown or HTML). `rubien_read_annotations` merges the user's highlights/underlines/anchored notes across both kinds into one array, each item tagged `source`; web items carry a W3C TextQuoteSelector triple (`prefixText`/`anchorText`/`suffixText`) that locates them inside the `rubien_read_text` body. `rubien_grep_text` is the lookup half of the same workflow: it finds *where* a reference's body mentions a phrase or regex — PDF hits grouped by page (`sectionPath` breadcrumbs), web hits as exact character offsets — so you can then pull just those spots with `rubien_read_text` (`pages` for PDF, `start` for web). All three are library-only — none hit the network.
144
137
 
145
- The web-clip tools are the counterpart for clipped web pages — `rubien_web_get` returns the extracted body (markdown or HTML, paginated by character offset) along with `siteName` and `annotationCount`, and `rubien_web_annotations` returns highlights with a W3C TextQuoteSelector triple (`prefixText` / `anchorText` / `suffixText`) so the highlight can be located inside the body. Library-only neither tool fetches from the network.
138
+ PDF tools: `rubien_pdf_info` (page count, `hasTextLayer`, outline sections call it before selecting `rubien_read_text` by `sections`), `rubien_pdf_page_image` (render a page to an image, for tables/figures/equations), `rubien_pdf_download` (fetch an open-access PDF and attach it).
146
139
 
147
- Destructive tools are tagged with `destructiveHint: true` so Claude Code's permission UI flags them. `rubien_delete` always passes `--force` — the confirmation happens in the MCP client permission UI, not in the CLI's TTY prompt. See the comment in `src/tools/references.ts` for rationale.
140
+ Destructive tools carry `destructiveHint: true` so Claude Code's permission UI flags them. `rubien_delete` passes `--force`; confirmation happens in the client UI, not a CLI prompt (see `src/tools/references.ts`).
148
141
 
149
142
  ## Contract pinning
150
143
 
151
- Every tool's argument shape is defined in zod in the tool file; the expected *response* shape is in `src/schemas.ts`, mirroring the Swift DTOs in `Sources/RubienCLI/RubienCLI.swift` (search for `*DTO`). Crucial convention (see tests in `test/schemas.test.ts`):
144
+ Argument shapes are zod schemas in each tool file; response shapes are in `src/schemas.ts`, mirroring the Swift `*DTO` types in `Sources/RubienCLI/RubienCLI.swift`. Convention (tested in `test/schemas.test.ts`):
152
145
 
153
- - `.optional()` in zod for Swift `Optional` fields — Swift's `JSONEncoder` **omits** nil optionals from output.
154
- - `.nullable()` only for `AlwaysEncodedOptional<T>` wrappers (currently just `DatabaseViewDTO.groupBy`).
146
+ - `.optional()` for Swift `Optional` fields — `JSONEncoder` omits nil optionals.
147
+ - `.nullable()` only for `AlwaysEncodedOptional<T>` (currently just `DatabaseViewDTO.groupBy`).
155
148
 
156
- If a Swift DTO changes, update both the Swift side and `src/schemas.ts` in the same commit, per the CLAUDE.md rule about keeping the CLI and data layer in lockstep.
149
+ Change a Swift DTO update `src/schemas.ts` in the same commit (CLAUDE.md CLI/data-layer lockstep rule).
157
150
 
158
151
  ## Development
159
152
 
160
- Build from a local checkout (instead of `npx`):
161
-
162
153
  ```bash
163
154
  cd mcp-server
164
155
  npm install
165
156
  npm run build # → dist/
166
- npm test # vitest unit tests
167
- ```
168
-
169
- Watch mode:
170
-
171
- ```bash
172
- npm run dev # tsc --watch
173
- npm run test:watch
157
+ npm test # vitest
158
+ npm run dev # tsc --watch
174
159
  ```
175
160
 
176
- MCP Inspector is the fastest way to poke at tool schemas by hand:
161
+ Poke at tool schemas by hand with MCP Inspector:
177
162
 
178
163
  ```bash
179
164
  npx @modelcontextprotocol/inspector node dist/index.js
package/dist/index.js CHANGED
@@ -21,11 +21,11 @@ Options:
21
21
 
22
22
  Examples:
23
23
  # Claude Code
24
- claude mcp add rubien node /path/to/mcp-server/dist/index.js
24
+ claude mcp add rubien -- npx -y rubien-mcp-server
25
25
 
26
- # claude.ai (remote MCP)
26
+ # claude.ai (remote MCP) — same package, HTTP mode
27
27
  RUBIEN_MCP_BEARER=$(openssl rand -hex 32) \\
28
- node dist/index.js --http --port 4000 --bearer-token "$RUBIEN_MCP_BEARER"
28
+ npx -y rubien-mcp-server --http --port 4000 --bearer-token "$RUBIEN_MCP_BEARER"
29
29
  # then: cloudflared tunnel --url http://localhost:4000
30
30
  `;
31
31
  function parseCliArgs(argv) {
package/dist/schemas.js CHANGED
@@ -130,13 +130,93 @@ export const DatabaseViewDTO = z.object({
130
130
  dateCreated: isoDateString,
131
131
  dateModified: isoDateString,
132
132
  });
133
- export const AnnotationDTO = z.object({
133
+ // Unified read-tool output mirrors (RubienCLI `read text` / `read annotations`).
134
+ // Superseded the permissive AnnotationDTO, which was retired alongside the
135
+ // kind-specific rubien_web_* / rubien_annotations_list tools.
136
+ export const ReadTextPdfOutput = z.object({
137
+ id: z.number().int(),
138
+ source: z.literal("pdf"),
139
+ available: z.array(z.enum(["pdf", "web"])),
140
+ pageCount: z.number().int(),
141
+ selection: z.object({
142
+ mode: z.string(),
143
+ pages: z.string().optional(),
144
+ requested: z.array(z.string()).optional(),
145
+ matchedSections: z.array(z.string()).optional(),
146
+ unmatched: z.array(z.string()).optional(),
147
+ }),
148
+ pages: z.array(z.object({
149
+ index: z.number().int(),
150
+ text: z.string(),
151
+ sectionPath: z.array(z.string()),
152
+ })),
153
+ truncated: z.boolean(),
154
+ hasTextLayer: z.boolean(),
155
+ });
156
+ export const ReadTextWebOutput = z.object({
157
+ id: z.number().int(),
158
+ source: z.literal("web"),
159
+ available: z.array(z.enum(["pdf", "web"])),
160
+ url: z.string().optional(),
161
+ siteName: z.string().optional(),
162
+ contentFormat: z.enum(["markdown", "html"]),
163
+ content: z.string(),
164
+ contentLength: z.number().int(),
165
+ start: z.number().int(),
166
+ returnedChars: z.number().int(),
167
+ truncated: z.boolean(),
168
+ annotationCount: z.number().int(),
169
+ });
170
+ export const ReadAnnotationItem = z.object({
171
+ source: z.enum(["pdf", "web"]),
134
172
  id: z.number().int(),
135
173
  type: z.string(),
136
- color: z.string().optional(),
174
+ color: z.string(),
175
+ noteText: z.string().optional(),
176
+ dateCreated: isoDateString,
177
+ dateModified: isoDateString,
137
178
  pageIndex: z.number().int().optional(),
138
179
  selectedText: z.string().optional(),
139
- noteText: z.string().optional(),
180
+ anchorText: z.string().optional(),
181
+ prefixText: z.string().optional(),
182
+ suffixText: z.string().optional(),
183
+ });
184
+ // Unified grep-tool output mirrors (RubienCLI `grep <id> <query>`). PDF hits are
185
+ // page-grouped (PageSearchHit); web hits carry character offsets (GrepWebMatch).
186
+ export const GrepTextPdfOutput = z.object({
187
+ id: z.number().int(),
188
+ source: z.literal("pdf"),
189
+ available: z.array(z.enum(["pdf", "web"])),
190
+ query: z.string(),
191
+ isRegex: z.boolean(),
192
+ pageCount: z.number().int(),
193
+ hasTextLayer: z.boolean(),
194
+ totalMatches: z.number().int(),
195
+ totalMatchingPages: z.number().int(),
196
+ truncated: z.boolean(),
197
+ pages: z.array(z.object({
198
+ page: z.number().int(),
199
+ sectionPath: z.array(z.string()),
200
+ matchCount: z.number().int(),
201
+ snippetsTruncated: z.boolean(),
202
+ snippets: z.array(z.string()),
203
+ })),
204
+ });
205
+ export const GrepTextWebOutput = z.object({
206
+ id: z.number().int(),
207
+ source: z.literal("web"),
208
+ available: z.array(z.enum(["pdf", "web"])),
209
+ query: z.string(),
210
+ isRegex: z.boolean(),
211
+ contentLength: z.number().int(),
212
+ totalMatches: z.number().int(),
213
+ totalEntries: z.number().int(),
214
+ truncated: z.boolean(),
215
+ matches: z.array(z.object({
216
+ start: z.number().int().nonnegative(),
217
+ matchCount: z.number().int(),
218
+ snippet: z.string(),
219
+ })),
140
220
  });
141
221
  export const StyleDTO = z.object({
142
222
  id: z.string(),
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gFAAgF;AAChF,8EAA8E;AAC9E,EAAE;AACF,yEAAyE;AACzE,mEAAmE;AACnE,6EAA6E;AAC7E,4DAA4D;AAC5D,iFAAiF;AACjF,gEAAgE;AACh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AAQ,EAAE;CAC3C,CAAC;KACD,WAAW,EAAE,CAAC,CAAC,uDAAuD;AAEzE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;KACxD,WAAW,EAAE,CAAC;AAEjB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC"}
package/dist/server.js CHANGED
@@ -4,13 +4,12 @@ import { registerCitationTools } from "./tools/citations.js";
4
4
  import { registerIOTools } from "./tools/io.js";
5
5
  import { registerPropertyTools } from "./tools/properties.js";
6
6
  import { registerViewTools } from "./tools/views.js";
7
- import { registerAnnotationTools } from "./tools/annotations.js";
8
7
  import { registerSyncTools } from "./tools/sync.js";
9
8
  import { registerPdfTools } from "./tools/pdf.js";
10
- import { registerWebTools } from "./tools/web.js";
9
+ import { registerReadTools } from "./tools/read.js";
11
10
  export const SERVER_INFO = {
12
11
  name: "rubien-mcp-server",
13
- version: "0.1.0",
12
+ version: "0.2.0",
14
13
  };
15
14
  export function buildServer() {
16
15
  const server = new McpServer(SERVER_INFO, {
@@ -24,9 +23,8 @@ export function buildServer() {
24
23
  // rubien_tags_* tool family was retired — see properties.ts.
25
24
  registerPropertyTools(server);
26
25
  registerViewTools(server);
27
- registerAnnotationTools(server);
28
26
  registerPdfTools(server);
29
- registerWebTools(server);
27
+ registerReadTools(server);
30
28
  registerSyncTools(server);
31
29
  return server;
32
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":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","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;CACR,CAAC;AAEX,MAAM,UAAU,WAAW;IACzB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,WAAW,EAAE;QACxC,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;KAC5B,CAAC,CAAC;IAEH,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC/B,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC9B,eAAe,CAAC,MAAM,CAAC,CAAC;IACxB,wEAAwE;IACxE,sEAAsE;IACtE,6DAA6D;IAC7D,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC9B,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzB,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAE1B,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/tools/io.js CHANGED
@@ -2,24 +2,24 @@ import { z } from "zod";
2
2
  import { flagsFromOptions, runCliAsTool } from "../toolHelpers.js";
3
3
  export function registerIOTools(server) {
4
4
  server.registerTool("rubien_import", {
5
- title: "Import from BibTeX/RIS/Zotero folder",
6
- description: "Import references from a file (BibTeX .bib / RIS .ris) or a Zotero-exported folder. For folder imports you can stamp a single-/multi-select property value on every imported reference via property + value.",
5
+ title: "Import a PDF, BibTeX/RIS, Markdown, or folder",
6
+ description: "Import references from a local file (PDF .pdf / BibTeX .bib / RIS .ris / Markdown .md — Obsidian Web Clipper frontmatter is mapped, plain notes import too), a direct HTTP(S) PDF/Markdown file URL with a supported path extension, or a folder (Zotero export, or a folder of .md files). Folder imports stamp a single-/multi-select property value on every imported reference via property + value (default: Tags = folder basename). A folder containing both .bib and .md needs format to disambiguate.",
7
7
  inputSchema: {
8
8
  file: z
9
9
  .string()
10
- .describe("Absolute path on the host. Stdin piping ('-') is not supported through the MCP wrapper; if you need it, invoke rubien-cli directly."),
10
+ .describe("Absolute path on the host, or a direct HTTP(S) URL with a .pdf, .md, or .markdown path extension. Stdin piping ('-') is not supported through the MCP wrapper; if you need it, invoke rubien-cli directly."),
11
11
  format: z
12
- .enum(["bib", "ris"])
12
+ .enum(["bib", "ris", "md"])
13
13
  .optional()
14
- .describe("Override the format inferred from the file extension."),
14
+ .describe("For folders, disambiguates when both .bib and .md are present. Direct HTTP(S) URLs must have a .pdf, .md, or .markdown path extension."),
15
15
  property: z
16
16
  .string()
17
17
  .optional()
18
- .describe("(Zotero folder only) Property name to stamp on imported refs"),
18
+ .describe("(Folder imports) Property name to stamp on imported refs"),
19
19
  value: z
20
20
  .string()
21
21
  .optional()
22
- .describe("(Zotero folder only) Value for --property on imported refs"),
22
+ .describe("(Folder imports) Value for --property on imported refs"),
23
23
  },
24
24
  annotations: { destructiveHint: true },
25
25
  }, async ({ file, format, property, value }) => runCliAsTool([
@@ -1 +1 @@
1
- {"version":3,"file":"io.js","sourceRoot":"","sources":["../../src/tools/io.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAA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AAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,CAC1C,YAAY,CACV;QACE,QAAQ;QACR,IAAI;QACJ,GAAG,gBAAgB,CAAC;YAClB,UAAU,EAAE,MAAM;YAClB,YAAY,EAAE,QAAQ;YACtB,SAAS,EAAE,KAAK;SACjB,CAAC;KACH,EACD,EAAE,SAAS,EAAE,OAAO,EAAE,CACvB,CACJ,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EACT,4HAA4H;QAC9H,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE;iBACjD,QAAQ,CAAC,iBAAiB,CAAC;SAC/B;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;KACpC,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACnB,MAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;QACxB,IAAI,MAAM;YAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,KAAK,CAAC;QACzD,OAAO,YAAY,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC1C,CAAC,CACF,CAAC;AACJ,CAAC"}
package/dist/tools/pdf.js CHANGED
@@ -4,60 +4,12 @@ import { flagsFromOptions, runCliAsTool } from "../toolHelpers.js";
4
4
  export function registerPdfTools(server) {
5
5
  server.registerTool("rubien_pdf_info", {
6
6
  title: "Probe PDF metadata + outline",
7
- description: "Return page count, hasTextLayer (sampled across first/middle/last page), file size, isEncrypted, documentTitle, and the flattened outline `sections` (or null when the PDF has no outline). Each section carries title, level (1=top), startPage, and endPage; parent ranges span their descendants. Call this before `rubien_pdf_text` so you know whether to use sections or page ranges.",
7
+ description: "Return page count, hasTextLayer (sampled across first/middle/last page), file size, isEncrypted, documentTitle, and the flattened outline `sections` (or null when the PDF has no outline). Each section carries title, level (1=top), startPage, and endPage; parent ranges span their descendants. Call this before `rubien_read_text` when you plan to select by `sections` or page ranges.",
8
8
  inputSchema: {
9
9
  id: z.number().int().describe("Reference ID"),
10
10
  },
11
11
  annotations: { readOnlyHint: true },
12
12
  }, async ({ id }) => runCliAsTool(["pdf", "info", String(id)]));
13
- server.registerTool("rubien_pdf_text", {
14
- title: "Extract text from a PDF",
15
- description: "Extract page-keyed text from a reference's attached PDF. Two mutually-exclusive selection modes: `pages` (e.g. '1-3' or '1-3,8-10') or `sections` (array of section title substrings; case-insensitive). When neither is provided the whole document is returned (subject to maxChars). Each returned page carries `text` and `sectionPath` (breadcrumb of containing sections). Errors with `no-outline` when `sections` is requested but the PDF has no outline — fall back to `pages` in that case.",
16
- inputSchema: {
17
- id: z.number().int().describe("Reference ID"),
18
- pages: z
19
- .string()
20
- .optional()
21
- .describe("Page range string, e.g. '1-3' or '1-3,8-10' or '12-'. Mutually exclusive with `sections`."),
22
- sections: z
23
- .array(z.string().min(1))
24
- .optional()
25
- .describe("Section title substrings (case-insensitive, repeatable). Mutually exclusive with `pages`. Use after `rubien_pdf_info` confirms `sections != null`."),
26
- maxChars: z
27
- .number()
28
- .int()
29
- .positive()
30
- .max(500_000)
31
- .optional()
32
- .describe("Cap total returned characters (default 50000). Truncation is at page boundary."),
33
- },
34
- annotations: { readOnlyHint: true },
35
- }, async (args) => {
36
- if (args.pages && args.sections && args.sections.length > 0) {
37
- return {
38
- content: [
39
- {
40
- type: "text",
41
- text: JSON.stringify({
42
- error: "pages-and-sections-mutually-exclusive",
43
- }),
44
- },
45
- ],
46
- isError: true,
47
- };
48
- }
49
- const cliArgs = ["pdf", "text", String(args.id)];
50
- if (args.pages)
51
- cliArgs.push("--pages", args.pages);
52
- if (args.sections) {
53
- for (const s of args.sections)
54
- cliArgs.push("--section", s);
55
- }
56
- cliArgs.push(...flagsFromOptions({
57
- "--max-chars": args.maxChars,
58
- }));
59
- return runCliAsTool(cliArgs);
60
- });
61
13
  server.registerTool("rubien_pdf_page_image", {
62
14
  title: "Render a PDF page as an image",
63
15
  description: "Render a single PDF page (1-indexed) and return it as an MCP image content block. Use this when text extraction is empty/garbled (scanned page, dense math) or when a figure/table is referenced in the surrounding text. Defaults: JPEG at scale=2.0 (~192 DPI) with quality stepdown to honor maxBytes. PNG mode is opt-in for lossless output but hard-fails on maxBytes.",
@@ -1 +1 @@
1
- {"version":3,"file":"pdf.js","sourceRoot":"","sources":["../../src/tools/pdf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAYnE,MAAM,UAAU,gBAAgB,CAAC,MAAiB;IAChD,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,KAAK,EAAE,8BAA8B;QACrC,WAAW,EACT,6XAA6X;QAC/X,WAAW,EAAE;YACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;SAC9C;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;KACpC,EACD,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAC5D,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,KAAK,EAAE,yBAAyB;QAChC,WAAW,EACT,weAAwe;QAC1e,WAAW,EAAE;YACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,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,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7C,IAAI,KAAK;YAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChC,OAAO,YAAY,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,105 @@
1
+ import { z } from "zod";
2
+ import { flagsFromOptions, runCliAsTool } from "../toolHelpers.js";
3
+ export function registerReadTools(server) {
4
+ server.registerTool("rubien_read_text", {
5
+ title: "Read the body text of any reference",
6
+ description: "Return the readable body text of any reference — its attached PDF or its clipped web page — without needing to know which it has. Source selection when `source` is omitted: `pages`/`sections` imply pdf, `start` implies web, otherwise PDF wins when both exist. Every response carries `source` (what was read) and `available` (which sources are readable now, e.g. [\"pdf\",\"web\"]). PDF responses are page-keyed: each `pages[]` item carries `text` and `sectionPath`, selected via `pages` ('1-3' or '1-3,8-10') or `sections` (title substrings, case-insensitive; errors `no-outline` when the PDF has no outline — fall back to `pages`). Web responses are one flat windowed body: `content` + `contentLength`, paginated via `start`/`maxChars`; `contentFormat` is \"markdown\" or \"html\" (treat html as a fragment). To find WHERE the body mentions something before reading, use `rubien_grep_text`. Library-only — never fetches from the network. Use `rubien_read_annotations` for the user's highlights/notes, and `rubien_pdf_info` first when you plan to select by `sections`.",
7
+ inputSchema: {
8
+ id: z.number().int().describe("Reference ID"),
9
+ source: z.enum(["pdf", "web"]).optional()
10
+ .describe("Force a source. Default: pages/sections imply pdf, start implies web, else PDF wins."),
11
+ pages: z.string().optional()
12
+ .describe("PDF page range, e.g. '1-3' or '1-3,8-10' or '12-'. Implies pdf. Mutually exclusive with `sections`."),
13
+ sections: z.array(z.string().min(1)).optional()
14
+ .describe("PDF section title substrings (case-insensitive). Implies pdf. Mutually exclusive with `pages`."),
15
+ start: z.number().int().nonnegative().optional()
16
+ .describe("Character offset into the web body (default 0). Implies web."),
17
+ maxChars: z.number().int().positive().max(500_000).optional()
18
+ .describe("Cap returned characters (default 50000). PDF truncates at page boundary (always ≥ 1 page); web at the character boundary."),
19
+ },
20
+ annotations: { readOnlyHint: true },
21
+ }, async (args) => {
22
+ if (args.pages && args.sections && args.sections.length > 0) {
23
+ return {
24
+ content: [{ type: "text", text: JSON.stringify({ error: "pages-and-sections-mutually-exclusive" }) }],
25
+ isError: true,
26
+ };
27
+ }
28
+ const pdfParams = Boolean(args.pages) || Boolean(args.sections && args.sections.length > 0);
29
+ if (pdfParams && args.start !== undefined) {
30
+ return {
31
+ content: [{ type: "text", text: JSON.stringify({ error: "pages/sections-and-start-mutually-exclusive" }) }],
32
+ isError: true,
33
+ };
34
+ }
35
+ const cliArgs = ["read", "text", String(args.id)];
36
+ if (args.pages)
37
+ cliArgs.push("--pages", args.pages);
38
+ if (args.sections)
39
+ for (const s of args.sections)
40
+ cliArgs.push("--section", s);
41
+ cliArgs.push(...flagsFromOptions({
42
+ "--start": args.start,
43
+ "--max-chars": args.maxChars,
44
+ "--source": args.source,
45
+ }));
46
+ return runCliAsTool(cliArgs);
47
+ });
48
+ server.registerTool("rubien_read_annotations", {
49
+ title: "List a reference's annotations (PDF + web merged)",
50
+ description: "Return the user's annotations (highlights, underlines, anchored notes) on a reference — PDF and web-clip annotations in one array, each item tagged `source`: \"pdf\" | \"web\" (optional `source` param filters to one kind). PDF items carry `pageIndex` + `selectedText`; web items carry a W3C TextQuoteSelector (`prefixText`/`anchorText`/`suffixText`) — use it to locate the highlight inside the body returned by `rubien_read_text`. All items carry `type`, `color`, `noteText`, `dateCreated`, `dateModified`. Ordered: PDF items first (by pageIndex), then web items (by dateCreated). Empty array when the reference doesn't exist or has no annotations (not an error).",
51
+ inputSchema: {
52
+ id: z.number().int().describe("Reference ID"),
53
+ source: z.enum(["pdf", "web"]).optional().describe("Filter to one kind."),
54
+ },
55
+ annotations: { readOnlyHint: true },
56
+ }, async (args) => {
57
+ const cliArgs = ["read", "annotations", String(args.id)];
58
+ cliArgs.push(...flagsFromOptions({ "--source": args.source }));
59
+ return runCliAsTool(cliArgs);
60
+ });
61
+ server.registerTool("rubien_grep_text", {
62
+ title: "Find where a reference's body says something",
63
+ description: "Find WHERE a phrase or regex occurs inside one reference's body text — its attached PDF or its clipped web page — without retrieving the body. Returns anchored locations, not text: PDF hits are page-grouped (`pages[]` with `page`, `sectionPath` breadcrumbs, `matchCount`, snippets) — drill in with `rubien_read_text` + `pages`; web hits carry exact character offsets (`matches[].start`, same coordinates as `rubien_read_text`'s `start`) — drill in with `rubien_read_text` + `start`. Matching is case-insensitive (`regex: true` treats the query as a regular expression; `(?-i:…)` restores case). Source selection mirrors `rubien_read_text`: explicit `source` wins; `pages`/`maxPages`/`snippetsPerPage` imply pdf and `maxMatches` implies web; otherwise PDF wins when both exist. Every response carries `source` and `available`. A scanned PDF returns success with `hasTextLayer: false` and no hits — fall back to `rubien_pdf_page_image`. To find which REFERENCES match, use `rubien_search` (library metadata) instead. Library-only — never fetches from the network.",
64
+ inputSchema: {
65
+ id: z.number().int().describe("Reference ID"),
66
+ query: z.string().min(1).describe("Literal phrase (default) or regex (`regex: true`). Case-insensitive."),
67
+ regex: z.boolean().optional().describe("Treat `query` as a regular expression."),
68
+ source: z.enum(["pdf", "web"]).optional()
69
+ .describe("Force a source. Default: pdf-scoped params imply pdf, maxMatches implies web, else PDF wins."),
70
+ contextChars: z.number().int().positive().max(2_000).optional()
71
+ .describe("Snippet window width (default 160)."),
72
+ pages: z.string().optional()
73
+ .describe("PDF page range scope, e.g. '1-3,8-10'. Implies pdf."),
74
+ maxPages: z.number().int().positive().max(200).optional()
75
+ .describe("Cap returned PDF page-hits (default 30). Implies pdf."),
76
+ snippetsPerPage: z.number().int().positive().max(20).optional()
77
+ .describe("Cap snippets per PDF page (default 3). Implies pdf."),
78
+ maxMatches: z.number().int().positive().max(200).optional()
79
+ .describe("Cap returned web match entries (default 20). Implies web."),
80
+ },
81
+ annotations: { readOnlyHint: true },
82
+ }, async (args) => {
83
+ const pdfParams = Boolean(args.pages) || args.maxPages !== undefined || args.snippetsPerPage !== undefined;
84
+ if (pdfParams && args.maxMatches !== undefined) {
85
+ return {
86
+ content: [{ type: "text", text: JSON.stringify({ error: "pdf-scoped-and-maxMatches-mutually-exclusive" }) }],
87
+ isError: true,
88
+ };
89
+ }
90
+ const cliArgs = ["grep", String(args.id), args.query];
91
+ if (args.regex)
92
+ cliArgs.push("--regex");
93
+ if (args.pages)
94
+ cliArgs.push("--pages", args.pages);
95
+ cliArgs.push(...flagsFromOptions({
96
+ "--source": args.source,
97
+ "--context-chars": args.contextChars,
98
+ "--max-pages": args.maxPages,
99
+ "--snippets-per-page": args.snippetsPerPage,
100
+ "--max-matches": args.maxMatches,
101
+ }));
102
+ return runCliAsTool(cliArgs);
103
+ });
104
+ }
105
+ //# sourceMappingURL=read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/tools/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnE,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,KAAK,EAAE,qCAAqC;QAC5C,WAAW,EACT,8iCAA8iC;QAChjC,WAAW,EAAE;YACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;YAC7C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE;iBACtC,QAAQ,CAAC,sFAAsF,CAAC;YACnG,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;iBACzB,QAAQ,CAAC,qGAAqG,CAAC;YAClH,QAAQ,EA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,CAAC,CACH,CAAC;QACF,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * The minimum rubien-cli build this server requires. Equals the release build
3
- * that first shipped the `version` subcommand. Bump only when a future server
4
- * release genuinely needs a newer CLI feature; the released CLI's build must
5
- * always be >= this value.
3
+ * that first shipped `grep`. Bump only when a future server release genuinely
4
+ * needs a newer CLI feature; the released CLI's build must always be >= this
5
+ * value.
6
6
  */
7
- export const MIN_CLI_BUILD = 8;
7
+ export const MIN_CLI_BUILD = 21;
8
8
  const RELEASES = "https://github.com/devzhk/Rubien-releases/releases";
9
9
  /** Pure decision: is the discovered CLI new enough? `info` is null when the
10
10
  * CLI has no `version` subcommand (i.e. predates this mechanism). */
@@ -1 +1 @@
1
- {"version":3,"file":"versionGuard.js","sourceRoot":"","sources":["../src/versionGuard.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAY/B,MAAM,QAAQ,GAAG,oDAAoD,CAAC;AAEtE;sEACsE;AACtE,MAAM,UAAU,kBAAkB,CAChC,IAAuB,EACvB,QAAgB;IAEhB,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,OAAO,EACL,yDAAyD;gBACzD,oDAAoD;gBACpD,+DAA+D,QAAQ,WAAW;SACrF,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,CAAC,KAAK,GAAG,QAAQ,EAAE,CAAC;QAC1B,OAAO;YACL,EAAE,EAAE,KAAK;YACT,OAAO,EACL,oDAAoD,IAAI,CAAC,KAAK,IAAI;gBAClE,kCAAkC,QAAQ,IAAI;gBAC9C,+DAA+D,QAAQ,WAAW;SACrF,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AACtB,CAAC"}
1
+ {"version":3,"file":"versionGuard.js","sourceRoot":"","sources":["../src/versionGuard.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAYhC,MAAM,QAAQ,GAAG,oDAAoD,CAAC;AAEtE;sEACsE;AACtE,MAAM,UAAU,kBAAkB,CAChC,IAAuB,EACvB,QAAgB;IAEhB,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,OAAO,EACL,yDAAyD;gBACzD,oDAAoD;gBACpD,+DAA+D,QAAQ,WAAW;SACrF,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,CAAC,KAAK,GAAG,QAAQ,EAAE,CAAC;QAC1B,OAAO;YACL,EAAE,EAAE,KAAK;YACT,OAAO,EACL,oDAAoD,IAAI,CAAC,KAAK,IAAI;gBAClE,kCAAkC,QAAQ,IAAI;gBAC9C,+DAA+D,QAAQ,WAAW;SACrF,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AACtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rubien-mcp-server",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "MCP server wrapping rubien-cli so Claude Code and claude.ai can manage the Rubien reference library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "devzhk",