What is the Eraser MCP server?
Eraser Diagram Renderer is a small Python MCP server and command line tool. Your AI client writes diagram code in Eraser syntax, calls the render_diagram tool, and gets back an image URL plus a link to edit the diagram in Eraser. It needs your own Eraser API token.
Eraser Diagram Renderer is a Python MCP server that wraps the Eraser diagram API. An AI client writes diagram-as-code in Eraser syntax, and the server renders it into an image you can open or embed.
The same code also ships as a command line tool, so you can test a diagram in a terminal before an agent ever calls it. It needs Python 3.10 or higher and an Eraser API token.
Each render returns an image URL and a link to create an Eraser file, so you can keep editing the result inside Eraser. A warning appears when a diagram uses icons outside the standard Eraser list.
What it changes in your workflow
- Diagrams from prompts. Ask for a sequence, flowchart, entity relationship or cloud architecture diagram and receive an image.
- Editable output. The response includes a link to open the diagram in Eraser.
- Theme control. Choose light or dark, toggle the background and scale the image by 1, 2 or 3.
- Base64 option. Return the image data itself instead of a URL.
- Icon checks. Undefined icons are flagged before you ship the diagram.
Who it is for
- Developers who document systems and want diagrams drafted inside their editor.
- Teams that already use Eraser and want agents to produce files in the same syntax.
- Anyone who can host a Python process or a Docker container.
Who it is not for
- Users without an Eraser API token, since every render calls the Eraser API.
- People who need pixel-exact brand artwork. These are diagrams, not illustrations.
- Anyone who changes only the theme or background and expects a fresh image. The README documents a caching bug.
Related diagram routes
If your diagrams come from infrastructure code, TerraVision MCP reads Terraform instead. For vendor icons on a canvas, try Excalidraw Icons MCP, and codex-tldraw MCP scans a repo for workflow diagrams.
Diagrams belong in docs and posts. To publish the page around them on WordPress, the builder comparison shows which route fits.
Connect Eraser MCP Server: Render Eraser Diagrams from an AI Agent to your AI client
pip install -e .Clone the repository
Run git clone https://github.com/buck-0x/eraser-io-mcp-server and change into the folder.
Install dependencies
Run pip install -e . or use uv pip install -e . if you prefer uv. Python 3.10 or higher is required.
Get an Eraser API token
Create a token in Eraser and set it as ERASER_API_TOKEN in the host config env block, or in a local .env file. The host config value takes precedence.
Add the server to your client
Paste the config above into your client's MCP configuration and fix the path to main.py. The README links setup guides for Claude Desktop, Roo Code, VS Code, Windsurf and Cursor.
Optional HTTP mode
Run python main.py --transport http --port 8000 for Streamable HTTP at the /mcp path. Set MCP_AUTH_TOKEN to require a bearer token.
Try a prompt
Ask the agent to create a sequence diagram of a user login flow with the Eraser tool.
Client configuration
{
"mcpServers": {
"eraser": {
"command": "python",
"args": ["/path/to/eraser-io-mcp-server/main.py"],
"env": {
"ERASER_API_TOKEN": "your_token_here"
}
}
}
}Endpoints and ports
http://localhost:8000/mcpAvailable when you start the server with --transport http.(required)Your Eraser.io API token.stdioChoose stdio or http.(empty)Optional bearer token for the HTTP transport.docker-compose up -dCopy .env.example to .env first and set the token.What you can do with it
- Several diagram typesSequence, cloud architecture, flowchart and entity relationship diagrams, plus more listed in Eraser's diagram-as-code docs.
- Edit link includedEvery render returns a link to create an Eraser file for further edits.
- URL or file contentGet an image URL, or base64 image data with return_file.
- Theme, background and scalePick light or dark, remove the background and scale 1, 2 or 3.
- Icon validationChecks icon names against the standard Eraser list and warns on unknown ones.
- Two transportsRun over stdio, or Streamable HTTP with optional bearer token auth.
- Docker readyCompose and plain Docker instructions are in the README.
Tools it exposes
render_diagram
Renders diagram code through the Eraser API. Parameters: diagram_type, code, return_file, background, theme and scale.
Frequently asked questions
What is the Eraser MCP server?
It is a Python MCP server and CLI called Eraser Diagram Renderer. An AI client sends diagram code in Eraser syntax to its render_diagram tool, the server calls the Eraser API, and you get an image URL and a link to edit the diagram in Eraser.
How do I install the Eraser MCP server?
Clone the repository, run pip install -e . (or uv pip install -e .) with Python 3.10 or higher, then add a server entry to your MCP client that runs main.py. Set ERASER_API_TOKEN in the entry's env block. Restart the client and ask for a diagram.
Do I need an Eraser account?
You need an Eraser API token, because the server renders through the Eraser API. Set it as ERASER_API_TOKEN, either in your client config or in a .env file. Check Eraser's own pages for how tokens and plans work.
Which diagram types can it render?
The README lists sequence, cloud architecture, flowchart and entity relationship diagrams, and says more are available. The accepted names are sequence-diagram, cloud-architecture-diagram, flowchart-diagram and entity-relationship-diagram. Eraser's diagram-as-code documentation covers the syntax for each.
Why does changing the theme not change my image?
The README documents a bug in the Eraser API. The image cache is invalidated only when the diagram code changes, so changing theme or background alone returns the earlier cached image. Change the diagram code itself to get a new render.
Can I run it over HTTP instead of stdio?
Yes. Start it with python main.py --transport http --port 8000 and connect your client to the /mcp path on that port. Set MCP_AUTH_TOKEN to require a bearer token in the Authorization header. A Docker Compose setup is also described.
What does the output look like?
A successful render returns JSON with success, a message, an image URL and a create_eraser_file_url. With return_file set, you get base64 image data instead. If a diagram uses unknown icons, a warning field lists them, and SKIP_ICON_CHECK turns the check off.
Is the Eraser MCP server maintained?
The repository's last push was in December 2025, so look at the open issues before you pick it for a new project. It has MIT licensing, a small codebase and a command line mode you can use to test diagram code yourself.


