PostScript MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PostScript MCPValidate this PostScript and point out any errors before I send it."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PostScript MCP
An MCP server that gives AI agents the tools to write high-quality PostScript — grounded in the Adobe manuals and Kees van der Laan's PSlib rather than guessed from memory.
It exposes four capabilities:
Capability | Tools | What it does |
Render & validate |
| Run a program through Ghostscript, get a PDF/PNG/SVG and structured diagnostics — the write→check→fix loop that lets an agent self-correct. |
Operator lookup |
| Exact PLRM operator definitions (stack signature, LanguageLevel, errors). 270 operators shipped, offline. |
PSlib fragments |
| Retrieve van der Laan's vetted procedures by name, with their stack signatures and source, so agents reuse code instead of reinventing it. |
Reference search |
| Cited passages from the PLRM, Blue/Green books, DSC/EPS specs and tutorials. |
Plus postscript_capabilities for setup/debugging.
Why
LLMs write plausible-looking PostScript that fails on a real interpreter:
wrong operand order, undefined names, unbalanced gsave/grestore, EPS files
with no %%BoundingBox. This server closes that gap. The agent can confirm an
operator's signature before using it, paste in a procedure that is known to
work, quote the spec when behaviour is subtle, and — crucially — actually run
the program and read the errors back before handing code to a human.
Pair it with the skill suite for the authoring conventions.
Related MCP server: Font Tools MCP
Requirements
Python 3.10+
Ghostscript — the
gsbinary (rendering & validation)macOS:
brew install ghostscript· Debian/Ubuntu:apt install ghostscriptWindows: the official installer, then ensure
gswin64c.exeis onPATH
pdftotext (poppler-utils) — only needed to build the reference corpus
macOS:
brew install poppler· Debian/Ubuntu:apt install poppler-utils
Install
cd postscript-mcp
python -m venv .venv && source .venv/bin/activate # optional
pip install -e . # installs the `mcp` depThat is enough for operator lookup and render/validate to work
immediately (the operator dataset ships in data/operators.json).
Build the indexes (PSlib + reference corpus)
Point the ingester at your PostScript reference library — the folder with the
Adobe PDFs and the PSlib sources (this project was built around exactly such a
library; see the accompanying REFERENCE_INDEX.md):
python scripts/ingest.py --library "/path/to/postscript reference"This writes:
data/pslib_index.json— every PSlib procedure, parsed fromPSlib.ps/PSlib.eps(auto-discovered; or pass--pslib PSlib.ps).corpus/corpus_index.json— one searchable chunk per PDF page and per block of each.ps/.txtsource.
Re-run it whenever your library changes. Useful flags: --skip-corpus,
--skip-pslib, --pslib <files…>, --library, --corpus, --data.
You can also set defaults via environment variables (below) instead of flags.
Connect it to a client
Claude Desktop
Edit claude_desktop_config.json
(macOS: ~/Library/Application Support/Claude/,
Windows: %APPDATA%\Claude\):
{
"mcpServers": {
"postscript": {
"command": "python",
"args": ["-m", "postscript_mcp"],
"env": {
"PSMCP_LIBRARY_DIR": "/path/to/postscript reference",
"PSMCP_DATA_DIR": "/path/to/postscript-mcp/data",
"PSMCP_CORPUS_DIR": "/path/to/postscript-mcp/corpus"
}
}
}
}If you installed with pip install -e ., you can use the console script
instead: "command": "postscript-mcp", "args": []. Point command at the
Python inside your virtualenv if you used one.
Claude Code
claude mcp add postscript -- python -m postscript_mcp(run from the project directory, or give the absolute interpreter path).
Any MCP client
The server speaks MCP over stdio: launch python -m postscript_mcp.
Remote / cloud deployment (public HTTPS endpoint)
To expose this server on the network so any client can reach it over HTTP, see
the deployment guides. It serves MCP over Streamable HTTP at /mcp,
containerised with Docker (Ghostscript included):
DEPLOY_RENDER.md— recommended, free, no credit card: deploy to the Render free tier (GitHub sign-in) and point your own domain at it.DEPLOY.md— alternative: a free Oracle Cloud Always Free VM running Docker + Caddy (TLS).
{
"mcpServers": {
"postscript": {
"type": "http",
"url": "https://mcp.example.com/mcp"
}
}
}Tool reference
validate_postscript(source="", path="") → {ok, diagnostics[], bbox, hires_bbox, hint, …}
Interpret without rasterising (fast). Diagnostics carry error,
offending_command and whether it is a genuine interpreter error. hint
gives a plain-language nudge for common failures. Great for filling an EPS
%%BoundingBox from hires_bbox.
render_postscript(source="", path="", output_format="png", resolution=150, page=None, eps_crop=True, return_base64=False) → {ok, output_path, page_count, bbox, diagnostics[], …}
output_format ∈ png, png-alpha, pdf, svg. Returns the output file
path; set return_base64=True to also get PNG bytes inline.
lookup_operator(name) → the operator's signature, operands,
results, summary, category, level, errors. On a miss, returns
did_you_mean.
search_operators(query, category="", limit=20) → ranked operators, or a
whole category listing.
get_pslib_fragment(name) → {signature, source, category, attribution, line} for one PSlib procedure.
search_pslib(query="", category="", limit=20) → matching procedures
(names + one-line signatures); follow up with get_pslib_fragment.
search_reference(query, limit=8, doc="") → cited passages
{doc, page, snippet, score}. Restrict to a document with doc (e.g.
"PLRM", "Green", "DSC").
postscript_capabilities() → what is available right now (Ghostscript
present? indexes built?) and how to build what is missing.
Recommended agent workflow
Draft using
lookup_operator/search_pslib+get_pslib_fragment.Consult
search_referencewhen behaviour is subtle (imaging model,save/restore, DSC rules).Check with
validate_postscript— fix every diagnostic.Render with
render_postscriptand, for figures, verify the bounding box and that the image looks right.For embeddable output, emit a correct
%%BoundingBoxand DSC comments (seeexamples/square.eps).
Configuration (environment variables)
Variable | Default | Purpose |
|
| Where your reference PDFs / PSlib sources live (for ingest). |
|
| Location of |
|
| Location of the search corpus. |
| auto-detected | Path to the |
| temp dir | Where rendered files are written. |
|
| Ghostscript wall-clock limit (seconds). |
|
| Max program size accepted. |
Safety
Every Ghostscript invocation uses -dSAFER (no arbitrary file writes / device
control from the program) and a wall-clock timeout, and source size is capped.
The server never executes PostScript except through Ghostscript.
Development
pip install -e ".[dev]"
python scripts/gen_operators.py # regenerate data/operators.json
python -m pytest -q # run the test suiteLayout
postscript_mcp/ server + the four capability modules
server.py FastMCP wiring (the tools)
render.py Ghostscript validate/render
operators.py operator reference access
pslib.py PSlib tokeniser / parser / index
reference.py BM25 corpus search
config.py paths & limits from env
data/operators.json curated PLRM operator reference (shipped)
scripts/ingest.py build pslib_index.json + corpus from your library
scripts/gen_operators.py rebuild the operator dataset
skills/ agent skill suite (see below)
examples/ conformant EPS + PSlib usage
tests/ pytest suite (+ a real PSlib fixture)Skills
The skills/ folder holds a composable suite an agent loads alongside this
server:
postscript-authoring — stack discipline, structure, the render/verify loop.
postscript-pslib — reusing van der Laan's library correctly.
postscript-eps-dsc — conformant EPS / DSC output for embedding & print.
Credits & licences
PSlib © Kees van der Laan (kisa1@xs4all.nl) — parsed and indexed here for reference; its own terms apply to the code itself.
Operator reference curated from the PostScript Language Reference Manual, 3rd ed. (Adobe, 1999).
This server's code: MIT (see
LICENSE).
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Generate and read PDFs for AI agents: a generate_pdf and a read_pdf tool, priced per document.
Search, fetch (with provenance), scan, and convert AI instruction files for agents.
Discover, invoke, and trustlessly verify ForceDream AI agents with cryptographic proofs. 17 tools.
The documentation, as a tool your agent can call: 950+ AI-dev guides. Search + fetch tools.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to render 3D models by providing tools to execute OpenSCAD code and generate single or multi-perspective views. It returns high-quality PNG renderings directly to LLM applications for visual feedback and 3D model visualization.
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to diagnose, modify, and validate OTF/TTF fonts interactively through a set of read-only, write, and validation tools.
- AlicenseNot gradedqualityDmaintenanceEnables AI models to interact with the Typst typesetting system, including LaTeX-to-Typst conversion, syntax validation, and rendering Typst code to images.175MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI tools to create and edit Font Proof documents for type designers, supporting PDF font proofs and live-reload from Glyphs.app.49MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/stuart-e-anderson/postscript-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server