PaperCortex
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OLLAMA_URL | No | Base URL of the Ollama service. | http://localhost:11434 |
| OLLAMA_MODEL | No | Chat model for classification, extraction and queries. | qwen2.5:14b |
| PAPERLESS_URL | No | Base URL of your Paperless-ngx instance. Required with PAPERLESS_TOKEN to execute document tools. | |
| VECTOR_DB_PATH | No | Local SQLite file for the vector index. | ./data/vectors.db |
| PAPERLESS_TOKEN | No | Paperless API token for document operations. Optional for listing tools. | |
| OLLAMA_VISION_MODEL | No | Optional vision model for photo receipts. | |
| PAPERCORTEX_DATA_DIR | No | Directory for settings and the receipt cache. | |
| OLLAMA_EMBEDDING_MODEL | No | Embedding model used for semantic search. | nomic-embed-text |
| PAPERCORTEX_EXPORT_DIR | No | Directory for generated exports. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Listing tools requires no credentials. To run them, configure PAPERLESS_URL and PAPERLESS_TOKEN and restart the server. Use an Ollama service you trust with document text. Build the local search index before using search or query.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| papercortex_searchA | Find matching documents in the local Paperless search index. Returns ranked IDs, titles, tags, similarity scores and short excerpts as text. Use the IDs for receipt extraction or classification. Use papercortex_query for a synthesized answer. Only indexed documents are searched. |
| papercortex_classifyA | Suggest metadata for one existing Paperless document using its OCR text and Ollama. Returns a text report with suggested tags, type, correspondent, language, summary and confidence. The suggestions are for review. The tool leaves the document and its tags unchanged, including when applyTags is true. |
| papercortex_receiptA | Read one receipt or invoice by Paperless document ID. Ollama extracts vendor, date, currency, totals, tax and line items into a labeled text report with model confidence. Missing totals default to 0 and missing currencies to EUR. Check these values against the original. Uses OCR text or a configured vision model and reports an error if extraction fails. Use papercortex_search to find an ID and papercortex_export to produce accounting files. |
| papercortex_queryA | Answer a question using Ollama and the closest matching excerpts from the local search index. Returns an answer with source IDs, titles and relevance scores, or a message when no sources match. Use papercortex_search to browse matches. For exact archive-wide totals, a sample of retrieved excerpts is insufficient. |
| papercortex_exportA | Export selected Paperless receipts, using a local extraction cache. DATEV requires configured accounting settings and writes batch files in the export directory, replacing matching filenames. Its text report lists paths and skipped receipts. CSV returns successful rows inline. Use papercortex_receipt to inspect a single receipt first. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 5 tools
Each tool targets a distinct capability: retrieval (search), synthesis (query), metadata suggestion (classify), receipt field extraction (receipt), and file generation (export). The search/query pair is the only potential overlap, and both descriptions explicitly cross-reference each other and explain when to use which. classify and receipt both invoke Ollama on a single document but produce clearly different outputs (tags/type/correspondent vs. vendor/totals/line items).
All five tools use a uniform `papercortex_` prefix followed by a single lowercase noun/verb in snake_case (search, classify, receipt, query, export). No camelCase mixing, no stray suffixes, and the prefix makes the server's tools trivially groupable.
Five tools is tightly scoped for a Paperless document-intelligence server, and each covers a genuinely different stage of the workflow (find → answer → classify → extract → export). There are no redundant or filler tools, and the count stays well inside the comfortable 3-15 range.
The surface is read/analyze-only: there is no way to apply suggested tags, update a document, or list correspondents/tags, and the `applyTags` parameter on classify is explicitly a no-op, which is a misleading dead end for agents expecting a write path. Core read workflows (search, query, classify, receipt, export) are covered, but lifecycle coverage for acting on results is missing.