rubien-mcp-server
v0.3.7MCP server wrapping rubien-cli so Claude Code and claude.ai can manage the Rubien reference library.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
rubien_search_references Full-text search
Search the Rubien library. Optional `scope`: everything includes metadata, notes, and PDF/web annotations; papers searches metadata and abstracts across all reference types; notes searches reference notes and PDF/web highlights or annotation notes. Omit scope to retain the legacy search across all 12 indexed FTS columns. Use `in` to restrict legacy FTS columns (mutually exclusive with scope). Use `op: 'or'` to match any query token. Returns an array of ReferenceDTO, once per matching reference.
| Parameter | Type | Description |
|---|---|---|
query * | string | Search query (space-separated tokens) |
in | array | Restrict FTS to these columns (default: all 12 indexed columns). |
limit | integer | Maximum results (default 20) |
op | string | Combine multiple query tokens with AND (every token must match) or OR (any token). Default: and. |
scope | string | Content to search. Omit for legacy FTS. Mutually exclusive with in. |
rubien_list_references List references
List references with filters and sorting, or run a saved view. Returns ReferenceDTO[]. Use this for 'most recent', 'by author', 'by year range' queries. Pass `view` (a saved-view id from rubien_list_views) to run that view's persisted filter/sort config instead — `view` is mutually exclusive with the inline filter/sort params (limit/offset still apply).
| Parameter | Type | Description |
|---|---|---|
asc | boolean | Sort ascending (default is descending) |
author | string | Filter by author name (fuzzy) |
hasPdf | boolean | |
journal | string | Filter by journal name (fuzzy) |
keyword | string | Keyword across title/abstract/notes |
limit | integer | Maximum results (0 = all) |
offset | integer | Skip first N |
readingStatus | string | Filter by reading status. Validated live against the user-extensible Status options (case-sensitive) — see rubien_list_properties for the current set. |
sortBy | string | |
tag | integer | Filter by tag ID |
type | string | Reference type, e.g. 'Journal Article' |
view | integer | Saved view ID — rows filtered/sorted by that view. Mutually exclusive with the inline filter/sort params below. Discover ids via rubien_list_views. |
yearFrom | integer | |
yearTo | integer |
rubien_get_reference Get reference by ID
Fetch a single reference by ID. Returns ReferenceDTO.
| Parameter | Type | Description |
|---|---|---|
id * | integer | Reference ID |
rubien_create_reference Create reference (one door: locator, BibTeX, or title)
Create reference(s) — one door for every input. Pass exactly one of: `source` (ANY locator — DOI / arXiv / PMID / PMCID / ISBN, paper URL, PDF/Markdown file URL, local file path, or folder path; the CLI routes it), `bibtex` (inline BibTeX, can hold multiple entries), or `title` (minimal manual row). Resolver sources attempt an open-access PDF fetch by default; pass `downloadPdf: false` to opt out. The reference remains saved if the fetch is unavailable or fails. May return MULTIPLE items (multi-entry BibTeX, folders) and may return `status: 'existing'` instead of creating — the input mat…
| Parameter | Type | Description |
|---|---|---|
bibtex | string | Inline BibTeX source (can hold multiple entries; persists per entry, continuing past entry failures) |
downloadPdf | boolean | Resolver routes only (identifier / paper-URL source). true or absent = fetch the open-access PDF after resolution (default); false = explicitly skip. The reference is saved even if the fetch fails. Ad… |
format | string | File/stdin routes only: format hint; disambiguates a folder holding both .bib and .md. |
property | string | Folder route only: property to stamp on every imported reference (default: Tags) |
source | string | Any locator: identifier (DOI/arXiv/PMID/PMCID/ISBN), paper URL, PDF/Markdown file URL, absolute file path, or folder path. Stdin ('-') is not supported over MCP. |
title | string | Title for a minimal manual entry |
value | string | Folder route only: value to stamp on `property` (default: folder basename) |
rubien_update_reference Update reference fields and property cells
Modify an existing reference: metadata fields (pass only what changes), `clearFields` to null fields out, and/or `properties` — a cell payload editing built-in and custom property values in ONE atomic call. Payload keys are property names (exact, case-sensitive) or ids (digit-only strings); values: scalar = replace, array = replace multiSelect set, {add:[…], remove:[…]} = incremental multiSelect edit (idempotent), null = clear. For the built-in Tags property, values are stringified tag ids. This edits the VALUES on this reference — to create/rename/delete the choices themselves (option…
| Parameter | Type | Description |
|---|---|---|
id * | integer | |
abstract | string | |
authors | string | |
clearFields | array | Field names to clear (set to NULL). |
doi | string | |
edition | string | |
isbn | string | |
issn | string | |
issue | string | |
journal | string | |
language | string | |
notes | string | |
pages | string | |
properties | object | Property-cell edits keyed by property name or id: scalar/array = replace, {add/remove} = incremental multiSelect edit, null = clear. Example: {"Status": "Reading", "Tags": {"add": ["12"]}, "7": ["ml",… |
publisher | string | |
readingStatus | string | New reading status. Validated live against the user-extensible Status options (case-sensitive). |
title | string | |
type | string | |
url | string | |
volume | string | |
year | integer |
rubien_delete_reference Delete references
Permanently delete references by ID. Accepts one or many IDs. Returns { deleted: 'id1,id2,...' }.
| Parameter | Type | Description |
|---|---|---|
ids * | array | One or more reference IDs to delete |
rubien_cite Format citations
Generate formatted citations for one or more references. Output shape varies by format: `text` → { style, inline, bibliography }, `bibliography` → { style, entries }, `docx-cc` → { tag, text, style, isShortTag?, fallbackPayload? }. Use arbitrary CSL style IDs from `rubien_list_styles` if needed.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Reference IDs to cite |
format | string | Output format (default text). 'bibliography' for reference-list entries only; 'docx-cc' for Word content-control tags. |
style | string | Citation style (default apa). Built-ins: apa, mla, chicago, ieee, harvard, vancouver, nature. Any CSL ID from rubien_list_styles also works. |
rubien_list_styles List citation styles
List all available citation styles (built-in + installed CSL). Use the returned `id` as the `style` argument to rubien_cite.
rubien_export Export references
Export the library (or a subset) as JSON, BibTeX, or RIS. BibTeX/RIS output is plain text; JSON is a ReferenceDTO[] array.
| Parameter | Type | Description |
|---|---|---|
format | string | Default is json |
ids | array | Reference IDs in output order |
view | integer | Saved view ID |
rubien_list_properties List property definitions (incl. Tags)
List property definitions. Returns PropertyDefinitionDTO[] with options inlined: {value, label, color}. For the built-in Tags property each option is one Tag row (value = stringified tag id, label = name). Pass `ids` and/or `names` to filter; selectors are unioned, exact case-sensitive on names, and override `visible`. Unresolved selectors fail loudly with an `unresolved-selectors` error envelope.
| Parameter | Type | Description |
|---|---|---|
ids | array | Repeatable property IDs to include. Errors if any ID does not exist. |
names | array | Repeatable property names (exact, case-sensitive) to include. Errors if any name does not exist. |
visible | boolean | Restrict to user-visible properties. Ignored when ids/names are supplied. |
rubien_create_property Create custom property (column)
Create a new custom property definition (a column). All-digit names are rejected — they would shadow id selectors in rubien_update_reference's payload. To create a new tag instead, use rubien_create_option against the built-in Tags property. (These tools edit the available choices themselves. To assign/unassign values on a specific reference, use rubien_update_reference's `properties` payload.)
| Parameter | Type | Description |
|---|---|---|
name * | string | Property name (must not be all digits) |
type * | string | |
options | string | For singleSelect/multiSelect, comma-separated option labels. |
rubien_update_property Update property (rename and/or visibility)
Update a property definition: rename it and/or change its UI visibility, in one transaction. At least one of `name` / `visible` is required. Built-in properties (incl. Tags) cannot be renamed; visibility can be changed on any property. All-digit names are rejected.
| Parameter | Type | Description |
|---|---|---|
id * | integer | Property ID |
name | string | New display name |
visible | boolean | Show (true) or hide (false) in the app UI |
rubien_delete_property Delete custom property
Remove a property definition and all its values on references. Cannot delete default/built-in properties (Tags included — use rubien_delete_option to remove individual tags).
| Parameter | Type | Description |
|---|---|---|
id * | integer |
rubien_create_option Create select option (creates a Tag for the Tags property)
Append an option to a singleSelect/multiSelect property. For the built-in Tags property, this creates a new Tag row with `value` as the tag name and `color` as the tag color; the returned option's `value` is the new tag's stable id. (These tools edit the available choices themselves. To assign/unassign values on a specific reference, use rubien_update_reference's `properties` payload.)
| Parameter | Type | Description |
|---|---|---|
propertyId * | integer | Property ID |
value * | string | Option label (or, for Tags, the new tag's display name) |
color | string | Optional hex color (#RRGGBB) |
rubien_update_option Update a select option (rename and/or recolor)
Rename and/or recolor an existing option on a singleSelect/multiSelect property, in one transaction. `option` addresses the option by its original identity; at least one of `name` / `color` is required. Renames bulk-update affected references. For Tags: `option` is the stringified tag id (identity-stable), `name` is the new display name, recolor updates the Tag row. `color` accepts #RRGGBB only. The built-in Type property's options are fully immutable (recolor included). (These tools edit the available choices themselves. To assign/unassign values on a specific reference, use rubien_update_ref…
| Parameter | Type | Description |
|---|---|---|
option * | string | Existing option value (stringified tag id for Tags) |
propertyId * | integer | Property ID |
color | string | New hex color (#RRGGBB) |
name | string | New option value (new tag name for Tags) |
rubien_delete_option Delete a select option (deletes the underlying Tag for Tags)
Remove a select option from a property. For the built-in Tags property (defaultFieldKey == 'tags'): options are Tag rows addressed by stringified tag ID. Create new tags via rubien_create_option (value=name, color=hex). For Tags, deleting a tag with attached references requires `replaceWith` (the stringified id of another tag) — affected references are re-tagged before the old tag is removed. Without `replaceWith`, in-use options surface an `optionInUse` error. To delete an in-use option without migrating, set `clearInUse: true` — affected references have the option cleared from their valu…
| Parameter | Type | Description |
|---|---|---|
propertyId * | integer | Property ID |
value * | string | Option value to delete (stringified tag id for Tags) |
clearInUse | boolean | Clear the option from affected references instead of migrating. Mutually exclusive with replaceWith. |
replaceWith | string | Replacement option value for affected rows (required when the option is in use) |
rubien_list_views List saved views
List saved database views (persisted filter/sort/group configurations). Returns DatabaseViewDTO[]. To run a view (get its matching references), pass its id as `view` to rubien_list_references.
rubien_create_view Create saved view
Create a new saved view. filters / sorts / groupBy must be valid JSON matching the view configuration schema (mirrors what the GUI editor produces). Use rubien_list_views first to see the shape.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
filters | string | JSON string: ViewFilter[] |
groupBy | string | JSON string: GroupConfig |
sorts | string | JSON string: ViewSort[] |
rubien_update_view Update saved view (rename)
Change a saved view's name.
| Parameter | Type | Description |
|---|---|---|
id * | integer | |
name * | string |
rubien_delete_view Delete saved view
Remove a saved view by ID.
| Parameter | Type | Description |
|---|---|---|
id * | integer |
rubien_get_pdf_info Probe PDF metadata + outline
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.
| Parameter | Type | Description |
|---|---|---|
id * | integer | Reference ID |
rubien_render_pdf_page Render a PDF page as an image
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.
| Parameter | Type | Description |
|---|---|---|
id * | integer | Reference ID |
page * | integer | Page number (1-indexed) |
format | string | Output format (default jpeg) |
maxBytes | integer | Hard cap on rendered image bytes (default 2000000) |
scale | number | Render scale (default 2.0; 1.0 ≈ 96 DPI) |
rubien_download_pdf Download the open-access PDF for an existing reference
Fetch the open-access PDF (via DOI or arXiv resolution) and attach it to an EXISTING reference (creation via rubien_create_reference fetches PDFs itself with `downloadPdf`). Skip-if-attached by default; pass `force: true` to detach the existing PDF and re-download. Side effects: writes a file under the library's PDF storage and inserts a pdfCache row + pdfUploadQueue row (so the running app's sync engine will push to CloudKit). Returns `{ id, ok, action, filename? }` where `action` is `"downloaded" | "replaced" | "already-attached" | "already-pending"`. Errors (isError) when the reference is m…
| Parameter | Type | Description |
|---|---|---|
id * | integer | Reference ID |
force | boolean | Replace an existing attached PDF instead of skipping. |
rubien_read_text Read the body text of any reference
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`/`format` imply 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. Web responses are one flat windowed body: Markdown is returned by default, while `format: "html"` explicitly requests the extracted HTML fragment. `contentFormat` describes the retu…
| Parameter | Type | Description |
|---|---|---|
id * | integer | Reference ID |
format | string | Web representation. Markdown is the default; html returns the extracted HTML fragment. Implies web. |
maxChars | integer | Cap returned characters (default 50000). PDF truncates at page boundary (always ≥ 1 page); web at the character boundary. |
pages | string | PDF page range, e.g. '1-3' or '1-3,8-10' or '12-'. Implies pdf. Mutually exclusive with `sections`. |
sections | array | PDF section title substrings (case-insensitive). Implies pdf. Mutually exclusive with `pages`. |
source | string | Force a source. Default: pages/sections imply pdf, start/format imply web, else PDF wins. |
start | integer | Character offset into the web body (default 0). Implies web. |
rubien_read_annotations List a reference's annotations (PDF + web merged)
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 th…
| Parameter | Type | Description |
|---|---|---|
id * | integer | Reference ID |
source | string | Filter to one kind. |
rubien_grep_text Find where a reference's body says something
Find WHERE a phrase or regex occurs inside one reference's body text. Web matching uses Markdown by default; `format: "html"` explicitly searches extracted HTML. Web offsets feed `rubien_read_text` when called with the same format. Source selection mirrors `rubien_read_text`: explicit `source` wins; PDF-scoped parameters imply pdf and `maxMatches`/`format` imply web; otherwise PDF wins when both exist. Library-only — never fetches from the network.
| Parameter | Type | Description |
|---|---|---|
id * | integer | Reference ID |
query * | string | Literal phrase (default) or regex (`regex: true`). Case-insensitive. |
contextChars | integer | Snippet window width (default 160). |
format | string | Web representation. Markdown is the default; html searches extracted HTML. Implies web. |
maxMatches | integer | Cap returned web match entries (default 20). Implies web. |
maxPages | integer | Cap returned PDF page-hits (default 30). Implies pdf. |
pages | string | PDF page range scope, e.g. '1-3,8-10'. Implies pdf. |
regex | boolean | Treat `query` as a regular expression. |
snippetsPerPage | integer | Cap snippets per PDF page (default 3). Implies pdf. |
source | string | Force a source. Default: pdf-scoped params imply pdf, maxMatches/format imply web, else PDF wins. |
rubien_reading_activity Reading activity
Return Rubien's tracked reading and Assistant activity. A paper-day qualifies after at least 60 estimated foreground-reader seconds; only yearActivity is limited by year.
| Parameter | Type | Description |
|---|---|---|
year | integer |
rubien_attachment_list
List a reference's supplementary attachments with local existence and size checks. Use attachment status to verify contents. Reports the active sync session’s transfer state.
| Parameter | Type | Description |
|---|---|---|
referenceId * | integer |
rubien_attachment_add
Attach PDF or UTF-8 Markdown files to a reference. Each entry in files is a local path or an HTTP(S) URL to download (direct .pdf / .md / .markdown links). Optional name sets the display name and requires exactly one entry in files. Returns one added, duplicate, or error result per input; a failed download is an error result. Limits: PDF 250 MiB; Markdown 50 MiB.
| Parameter | Type | Description |
|---|---|---|
files * | array | |
referenceId * | integer | |
name | string |
rubien_attachment_status
Verify an attachment's local bytes and report availability, removal, pending upload intent, and errors. Pending intent does not mean uploaded.
| Parameter | Type | Description |
|---|---|---|
id * | string | Attachment UUID |
rubien_attachment_retry
Retry pending attachment downloads and recovery lookups. Does not recreate missing previously synced annotations. Requires an enabled sync session.
| Parameter | Type | Description |
|---|---|---|
id * | string | Attachment UUID |
rubien_attachment_read
Read this attachment by UUID, never its parent paper. PDF uses pages (1-based ranges) and truncates at page boundaries, always returning at least one page. Markdown uses start (character offset) and maxChars. Default maxChars 50000; maximum 500000. No network downloads.
| Parameter | Type | Description |
|---|---|---|
id * | string | Attachment UUID |
maxChars | integer | |
pages | string | |
start | integer |
rubien_attachment_export
Write an attachment's original bytes to a new local output path. Existing files and library-owned paths are never overwritten.
| Parameter | Type | Description |
|---|---|---|
id * | string | Attachment UUID |
output * | string |
rubien_attachment_rename
Change an attachment's display name. Original bytes and filename are retained.
| Parameter | Type | Description |
|---|---|---|
id * | string | Attachment UUID |
name * | string |
rubien_attachment_remove
Remove an attachment and close its reader. Retains removal markers; managed bytes are cleaned after iCloud acknowledges removal. Does not remove the parent paper.
| Parameter | Type | Description |
|---|---|---|
id * | string | Attachment UUID |
rubien_get_sync_status CloudKit sync status
Report the current CloudKit sync state without starting the engine. Shows entitlement presence, iCloud account availability, dirty counts per entity type, tombstones, and engine state snapshot.