mcp - the reading as a tool an assistant can call
truecopy/mcp
An assistant handed somebody's statement has a tool call and nothing else. It offers four tools over stdio. They read the table, find its amounts, find its dates, check the values against the rows they were cited from. Each answer opens with a verdict, and the file never leaves the machine.
An agent with a terminal already had npx truecopy. One that can import a module had the library. Most assistants are neither: a host that speaks MCP reaches a tool call and nothing else, so the reading was unreachable from the place it is most needed - the model that has just been handed somebody’s bank statement and has no way to check what it read off it.
{
"mcpServers": {
"truecopy": {
"command": "npx",
"args": ["-y", "-p", "truecopy", "-p", "pdfjs-dist", "truecopy-mcp"],
"env": { "TRUECOPY_MCP_ROOT": "/home/me/Documents/statements" }
}
}
}
pdfjs-dist is named on the command line because it is an optional peer dependency: without it the server still reads CSV, TSV and pasted tables, and answers no-engine on a PDF rather than pretending.
Four tools
read_table turns a PDF, a CSV, a TSV or a saved paste into rows, and says what the reading could not vouch for. It hands back the cut into columns, what each column was taken to hold, the rows numbered, and the doubts. At most 2000 rows a call, 200 by default - and what it leaves is counted, never silently dropped.
find_amounts lists the figures written with a given number of decimals (two by default, 0 takes every number): the value, the characters as printed, and the row and column they sit in. What a figure means - a debit, a balance - is not read here.
find_dates lists the cells that start with a date. The dateOrder (DMY by default, or MDY) is stated, never guessed: no reading of 01/02/2026 is right everywhere. A row that prints a day and a month without a year is a date only when year is given.
check_citations takes the records the model claims to have read, each citing the row numbers it came from, and says which values those rows do not print. A JSON number is checked as a figure, with the document’s own decimal mark; a JSON string as its words in order. Each value is looked up in the cited rows and nowhere else, so nothing can be produced - only pointed at. It is cite, reached from a host instead of from code.
Cite the numbers read_table returned, for the same file and the same maximumPages: a different page bound is a different reading, and its rows are numbered differently. find_amounts and find_dates number rows the same way.
read_table and check_citations return the digest of the bytes they read, and take it back. Each call opens the path again, so a check could land on a file replaced in between. Given a digest, either tool refuses a file that no longer has it.
check_citations takes cells: 'apart', the citedText option: no number and no word is read across two cells. Left out, the cells are joined as before.
read_table returns pagesUnread beside more: more counts rows, pagesUnread the pages maximumPages left unopened. Such a reading is never reliable, and its verdict line names the pages left.
An argument the schema does not admit (decimals: 2.5, dateOrder: "YMD", a year out of range) is refused by name, never rounded or defaulted.
Every answer opens with a verdict
reliable, doubtful or unreadable, in the data and as the first line of text. unreadable: the file did not open, with its reason. doubtful: at least one thing looked wrong from the shape of the page. reliable: nothing looked wrong - which is not “this reading is right”, and the answer says so in those words. check_citations carries the verdict of the reading it checked against: a citation confirmed on a doubtful page is confirmed on a doubtful page.
A description is a prompt, not documentation
The sentence a host pastes in front of a model decides which tool it reaches for, so no description stops at what its tool does. Each names what the tool does not prove - read_table says outright that an empty list of doubts is not a promise that the reading is right. A description that said “reads tables from PDFs” and stopped would have taught the opposite of this library.
Over stdio, and not over HTTP
That is the design, not a limitation. A statement, a payslip and a career record are the worst documents there are to upload, and there is nothing a server could compute on them that this does not compute where the file already sits: the reading is deterministic and makes no network call. An endpoint would add a copy of somebody’s document to the world and buy nothing with it.
TRUECOPY_MCP_ROOT is the folder the server may open, and the configuration above sets it. A document can carry instructions, and a model that follows them can ask for any path the process can read: outside the root, the server refuses. The check is applied to the resolved path, so a link inside the root cannot walk back out of it. Left unset, every file the process can read can be opened.
If you are an AI asked to read a document
You were handed a statement, an invoice, an export, and asked for a figure in it. The failure that matters is not a figure you miss. It is a figure you return that the document never printed, and it reads exactly like a success. So:
- Call
read_tableand read the verdict before anything else.unreadablemeans there is nothing to lean on, and you say so.doubtfulmeans something looked wrong, the findings say which page and column, and a figure from there is a figure to flag.reliablemeans nothing looked wrong, and that is the whole claim. - Take figures with
find_amountsand dates withfind_datesrather than reading them off the prose. Each comes with the row it was printed in. - Before any value of yours is acted on, cite its rows to
check_citations. A value the cited rows do not print was not read from them. Re-read it or drop it. - Never fill a gap. A missing total is a missing total, not an opportunity to add the lines up. The document is the only source, and the checks only ever point at it.
The host that has no configuration yet installs the server from the block at the top of this page. The MCP registry lists it as io.github.truecopydev/truecopy, with the same command.
A server of your own
truecopy/mcp is the deciding half, and it touches no filesystem, no stream and no clock.
import { TOOLS, respond } from 'truecopy/mcp';
const answer = await respond(message, {
open: (path) => openTheFile(path),
version: '2.0.4'
});
TOOLS |
the descriptors, with their input and output schemas, and the sentences above |
respond |
one JSON-RPC message in, one McpResponse out - null for a notification |
verdictOf |
the Verdict of a reading that opened, from its findings: doubtful as soon as one is there |
McpCapabilities |
what the module needs from the world: open, a path to a File, and the version to report |
McpResponse |
jsonrpc, id, and one of result or error |
open is injected rather than imported, which is what keeps the promise above: the confinement of what may be opened belongs to whoever launches the server, not to the protocol. version is passed in for the same reason - a browser has no package.json to read.
null for a notification is not an implementation detail: by the JSON-RPC rules a message with no id must not be answered, and a client that receives an answer to notifications/initialized has to work out what it belongs to.
bin/truecopy-mcp.mjs is the other half - the one that talks to the world - and it is thin enough to read in one sitting. npx truecopy mcp starts the same server. Same split as the parsers, for the same reason: what decides is tested, and what touches the world is small.
Two generations of the protocol, both answered
Up to 2025-11-25 a client opens with initialize. From 2026-07-28 the protocol is stateless, that method is gone from the schema, and a client either probes server/discover or simply calls. Answering only the newer one would go silent against every client shipped before July 2026, and none of the three costs anything to keep.