rubien-mcp-server

v0.3.7
rubien-mcp-server Checked 1 day ago Published 10 days ago

MCP 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.

ParameterTypeDescription
query *stringSearch query (space-separated tokens)
inarrayRestrict FTS to these columns (default: all 12 indexed columns).
limitintegerMaximum results (default 20)
opstringCombine multiple query tokens with AND (every token must match) or OR (any token). Default: and.
scopestringContent 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).

ParameterTypeDescription
ascbooleanSort ascending (default is descending)
authorstringFilter by author name (fuzzy)
hasPdfboolean
journalstringFilter by journal name (fuzzy)
keywordstringKeyword across title/abstract/notes
limitintegerMaximum results (0 = all)
offsetintegerSkip first N
readingStatusstringFilter by reading status. Validated live against the user-extensible Status options (case-sensitive) — see rubien_list_properties for the current set.
sortBystring
tagintegerFilter by tag ID
typestringReference type, e.g. 'Journal Article'
viewintegerSaved view ID — rows filtered/sorted by that view. Mutually exclusive with the inline filter/sort params below. Discover ids via rubien_list_views.
yearFrominteger
yearTointeger

rubien_get_reference Get reference by ID

Fetch a single reference by ID. Returns ReferenceDTO.

ParameterTypeDescription
id *integerReference 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…

ParameterTypeDescription
bibtexstringInline BibTeX source (can hold multiple entries; persists per entry, continuing past entry failures)
downloadPdfbooleanResolver 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…
formatstringFile/stdin routes only: format hint; disambiguates a folder holding both .bib and .md.
propertystringFolder route only: property to stamp on every imported reference (default: Tags)
sourcestringAny 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.
titlestringTitle for a minimal manual entry
valuestringFolder 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…

ParameterTypeDescription
id *integer
abstractstring
authorsstring
clearFieldsarrayField names to clear (set to NULL).
doistring
editionstring
isbnstring
issnstring
issuestring
journalstring
languagestring
notesstring
pagesstring
propertiesobjectProperty-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",…
publisherstring
readingStatusstringNew reading status. Validated live against the user-extensible Status options (case-sensitive).
titlestring
typestring
urlstring
volumestring
yearinteger

rubien_delete_reference Delete references

Permanently delete references by ID. Accepts one or many IDs. Returns { deleted: 'id1,id2,...' }.

ParameterTypeDescription
ids *arrayOne 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.

ParameterTypeDescription
ids *arrayReference IDs to cite
formatstringOutput format (default text). 'bibliography' for reference-list entries only; 'docx-cc' for Word content-control tags.
stylestringCitation 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.

ParameterTypeDescription
formatstringDefault is json
idsarrayReference IDs in output order
viewintegerSaved 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.

ParameterTypeDescription
idsarrayRepeatable property IDs to include. Errors if any ID does not exist.
namesarrayRepeatable property names (exact, case-sensitive) to include. Errors if any name does not exist.
visiblebooleanRestrict 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.)

ParameterTypeDescription
name *stringProperty name (must not be all digits)
type *string
optionsstringFor 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.

ParameterTypeDescription
id *integerProperty ID
namestringNew display name
visiblebooleanShow (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).

ParameterTypeDescription
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.)

ParameterTypeDescription
propertyId *integerProperty ID
value *stringOption label (or, for Tags, the new tag's display name)
colorstringOptional 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…

ParameterTypeDescription
option *stringExisting option value (stringified tag id for Tags)
propertyId *integerProperty ID
colorstringNew hex color (#RRGGBB)
namestringNew 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…

ParameterTypeDescription
propertyId *integerProperty ID
value *stringOption value to delete (stringified tag id for Tags)
clearInUsebooleanClear the option from affected references instead of migrating. Mutually exclusive with replaceWith.
replaceWithstringReplacement 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.

ParameterTypeDescription
name *string
filtersstringJSON string: ViewFilter[]
groupBystringJSON string: GroupConfig
sortsstringJSON string: ViewSort[]

rubien_update_view Update saved view (rename)

Change a saved view's name.

ParameterTypeDescription
id *integer
name *string

rubien_delete_view Delete saved view

Remove a saved view by ID.

ParameterTypeDescription
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.

ParameterTypeDescription
id *integerReference 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.

ParameterTypeDescription
id *integerReference ID
page *integerPage number (1-indexed)
formatstringOutput format (default jpeg)
maxBytesintegerHard cap on rendered image bytes (default 2000000)
scalenumberRender 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…

ParameterTypeDescription
id *integerReference ID
forcebooleanReplace 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…

ParameterTypeDescription
id *integerReference ID
formatstringWeb representation. Markdown is the default; html returns the extracted HTML fragment. Implies web.
maxCharsintegerCap returned characters (default 50000). PDF truncates at page boundary (always ≥ 1 page); web at the character boundary.
pagesstringPDF page range, e.g. '1-3' or '1-3,8-10' or '12-'. Implies pdf. Mutually exclusive with `sections`.
sectionsarrayPDF section title substrings (case-insensitive). Implies pdf. Mutually exclusive with `pages`.
sourcestringForce a source. Default: pages/sections imply pdf, start/format imply web, else PDF wins.
startintegerCharacter 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…

ParameterTypeDescription
id *integerReference ID
sourcestringFilter 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.

ParameterTypeDescription
id *integerReference ID
query *stringLiteral phrase (default) or regex (`regex: true`). Case-insensitive.
contextCharsintegerSnippet window width (default 160).
formatstringWeb representation. Markdown is the default; html searches extracted HTML. Implies web.
maxMatchesintegerCap returned web match entries (default 20). Implies web.
maxPagesintegerCap returned PDF page-hits (default 30). Implies pdf.
pagesstringPDF page range scope, e.g. '1-3,8-10'. Implies pdf.
regexbooleanTreat `query` as a regular expression.
snippetsPerPageintegerCap snippets per PDF page (default 3). Implies pdf.
sourcestringForce 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.

ParameterTypeDescription
yearinteger

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.

ParameterTypeDescription
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.

ParameterTypeDescription
files *array
referenceId *integer
namestring

rubien_attachment_status

Verify an attachment's local bytes and report availability, removal, pending upload intent, and errors. Pending intent does not mean uploaded.

ParameterTypeDescription
id *stringAttachment UUID

rubien_attachment_retry

Retry pending attachment downloads and recovery lookups. Does not recreate missing previously synced annotations. Requires an enabled sync session.

ParameterTypeDescription
id *stringAttachment 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.

ParameterTypeDescription
id *stringAttachment UUID
maxCharsinteger
pagesstring
startinteger

rubien_attachment_export

Write an attachment's original bytes to a new local output path. Existing files and library-owned paths are never overwritten.

ParameterTypeDescription
id *stringAttachment UUID
output *string

rubien_attachment_rename

Change an attachment's display name. Original bytes and filename are retained.

ParameterTypeDescription
id *stringAttachment 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.

ParameterTypeDescription
id *stringAttachment 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.