A docs to PDF agent for Claude Code, Codex and Cursor
PDF lays out a source the person names (a doc, a plan, notes or markdown) as a PDF and stores it in the workspace. It works from the workspace's plans, tasks and docs.
Purpose-built for this one job and tested against a quality bar, it gets only the access the job needs, and a workspace owner or admin turns it on.
Or run it in the ContextStream web app, signed in with your ContextStream account. Version 0.1.0 · Updated
What does PDF do?
Makes a PDF from a doc, a plan, notes or markdown in the workspace, with contents, bookmarks and links, and stores it as media.
What it declines
It does one job. A task like one of these is declined with a reason:
Summarising, translating, rewriting or adding to the source: every word in the PDF is the source's.
Making a PDF from a web page, an image or a file outside ContextStream.
Editing an existing PDF, filling in a form or signing it.
Sending or sharing the PDF: it is stored as media for the person to use.
What can PDF access, and is it safe to turn on?
PDF gets a short-lived token for one workspace that lets it do only this: read a doc you name; read the workspace's plans, tasks, todos and reminders; store one file it made per run; and call models through ContextStream's model proxy, within a cap set for the run. It works in one project, only for that run, and declines any task outside its job. The only things PDF may change are these: it may store one file it made per run. A workspace owner or admin turns it on.
Model agent. A program on ContextStream's model proxy, with a short-lived token that acts for you in one workspace. It is stopped after 2 min 30 s.
Scope
What it lets a run do
docs.read
Read a doc you name
items.read
Read the workspace's plans, tasks, todos and reminders
media.write
Store one file it made per run
model.invoke
Call models through ContextStream's model proxy, within a cap set for the run
How is PDF tested?
PDF is checked on 11 cases, each with a known right answer: docs, plans and markdown to lay out, inputs it must refuse with a clear error, and requests outside its job it must decline. A case passes only if the run ends the way the case expects, declining what is not its job, and every check holds: the stored PDF, read back with an independent PDF reader, holds at least 98% of the source's words, is one well-formed PDF that matches what the result says, and has the expected key text, sections, contents page and title. The sources and the model's replies are fixed test data, while the PDF is really rendered and read back, so the cases check the PDF itself, not the live model's choice of title and sections. Version 0.1.0 passes all 11.
It is a program on general-purpose models, reached through ContextStream's model proxy, not a trained model. Its prompts are versioned and tuned against these tests, and a change that misses the quality bar fails them.
What does a real run of PDF look like?
The input, the result (shortened where it is long), how long it took and where it ran. Live runs used public or demo material only; a run marked as from its test suite is not a live run.
Live run on ContextStream
The public README of an MCP server, as a PDF
Version
0.1.0
Outcome
succeeded
Ran
2026-10-28 00:54 UTC
Took
30.0 s
ContextStream's Demos workspace; the source is the README.md of the public repository github.com/contextstream/mcp-server at v1.0.35, passed in as markdown.
{
"markdown": "<!-- mcp-name: io.github.contextstream/mcp-server -->\n\n<p align=\"center\">\n <img src=\"assets/contextstream-logo.png\" alt=\"ContextStream\" width=\"64\" />\n</p>\n\n<h1 align=\"center\">ContextStream MCP Server</h1>\n\n<p align=\"center\"><strong>The context platform for AI agents.</strong></p>\n\n## Your agent knows code. Give it the decisions behind yours.\n\nConnect your code, docs, and conversations so your agents can find the right\nfiles, recall saved decisions, and build on past work across sessions and tools.\n\n<a href=\"https://contextstream.io/benchmarks\">\n <picture>\n <source\n…",
"title": "ContextStream MCP Server: README",
"paper": "a4"
}
Result
Made "ContextStream MCP Server: README", a 5-page PDF of the markdown given with contents, and stored it as media.
Result
ContextStream MCP Server: README: 5 pages, 13901 bytes, 100% of the source's words read back out of the PDF.
Contents
Section
Page
Overview
2
Your agent knows code. Give it the decisions behind yours.
structure: The model placed every part exactly once.
text_recall: 1120 of 1120 source words read back out of the PDF (100.0%).
characters: Every character is printable in the standard fonts.
stored: Stored as media a0a2f216-94e2-493d-a3dc-e82d1f81dd7c (stored).
The input's markdown is the whole README; it is shortened here.
Task
92752bb3-0755-4e6f-b29a-fafc4b50aa0b
Which tools does PDF work with?
Claude Code, Codex, Cursor and other MCP clients: ContextStream's MCP gives them an agents tool that finds, runs and follows PDF. It also runs from a terminal or an agent's shell with csa run pdf, and from the ContextStream web app.
Claude Code, Codex, Cursor and other MCP clients: connect ContextStream's MCP once (setup for each editor), then ask your agent to hand the job to PDF.
A terminal or an agent's shell:csa run pdf, installed with ContextStream's command line.
The web app: the workspace's agent library.
How do I turn PDF on?
An owner or admin of your ContextStream workspace turns PDF on in the web app's agent library. Agents are opening workspace by workspace; if yours is not open yet, the library says so.
Sign in to ContextStream: the button below opens the agent library on PDF.
An owner or admin switches PDF on for the workspace.
Pick the project it works in, and run it from the library, from your coding agent or with csa run.
Ask your coding agent to hand the job to PDF, or call it yourself: csa run pdf in a terminal, or agents(action="run", agent="pdf", input={...}) over MCP.
Connect ContextStream's MCP (it also writes each editor's connection):
In a terminal (curl -fsSL https://contextstream.io/cs/install.sh | sh installs csa):
csa run pdf doc_id=00000000-0000-4000-8000-0000000000d1
Input
Field
Type
What it is
doc_id
string
A ContextStream doc to make the PDF from.
doc_title
string
A ContextStream doc to make the PDF from, by its title.
plan_id
string
A ContextStream plan to make the PDF from, with its steps and tasks.
markdown
string
Markdown to make the PDF from: notes, a Lens result, anything written down.
title
string
The PDF's title. Defaults to the source's own title.
instructions
string
How to arrange it, for example "one section per phase" or "put the open questions first".
paper
"a4" | "letter"
Paper size: a4 (the default) or letter.
toc
boolean
Add a table of contents, or leave it out. Left unset, long documents get one.
project_id
string
Store the PDF in this project instead of the source's.
What does PDF cost?
PDF costs 600 ContextStream credits a run, charged only when the run succeeds; a declined, failed, cancelled or timed-out run costs nothing. Credits come with every plan: Starter is free with 10,000 a month (16 runs of PDF, if spent on nothing else), and Pro is $19 a month with 25,000.
A run starts only once its price is accepted. Over MCP, a call without accepted_price_credits returns the price first; csa asks on a terminal, and scripts pass --yes.