MCP Server
Introduction
The Eraser MCP server connects AI coding agents to Eraser, letting them generate, create, read, search, and update files, diagrams, folders, and presets in your Eraser workspace — all through the Model Context Protocol.
The remote server is hosted at https://app.eraser.io/api/mcp and uses OAuth for authentication. When you first connect, your MCP client will open a browser window to authorize access to your Eraser account.
Capabilities
- AI diagram generation — Describe a system, flow, or architecture in natural language and have your agent generate a complete Eraser diagram with full control over styling, color, typeface, and layout direction
- AI diagram editing — Iteratively edit existing diagrams with natural language instructions
- Diagram export — Render diagrams to PNG or JPEG with configurable theme, quality, and background
- File management — Create, list, read, update, search, and archive Eraser files with document and diagram content
- Diagram management — Create, read, update, and delete individual diagrams within files
- Folder management — Organize files into folders with full CRUD support
- Preset management — Create and manage AI presets with custom rules to control diagram generation style and behavior
- Full-text search — Search across files and diagrams in your workspace
Installation and setup
The remote MCP server URL for all clients is:
https://app.eraser.io/api/mcp
After adding the server, your client will prompt you to authenticate via OAuth in the browser.
Claude Code
claude mcp add --transport http eraser https://app.eraser.io/api/mcpClaude
- Open claude.ai and navigate to Settings > Integrations
- Under MCP servers, click Add integration
- Enter the server URL:
https://app.eraser.io/api/mcp - Click Allow access to authenticate
Cursor
Add to your Cursor MCP config (.cursor/mcp.json):
{
"mcpServers": {
"eraser": {
"url": "https://app.eraser.io/api/mcp"
}
}
}Codex
codex mcp add eraser --url https://app.eraser.io/api/mcpVS Code
Add to your VS Code MCP config (.vscode/mcp.json):
{
"inputs": [],
"servers": {
"eraser": {
"url": "https://app.eraser.io/api/mcp",
"type": "http"
}
}
}GitHub Copilot
Add to your VS Code settings.json:
{
"mcp": {
"servers": {
"eraser": {
"url": "https://app.eraser.io/api/mcp",
"type": "http"
}
}
}
}Tools
The Eraser MCP uses a resource-based tool pattern. Each tool accepts a resource parameter to specify what type of object to operate on.
selectTeam
selectTeamSet the active team for subsequent operations. Required when you belong to multiple teams (OAuth only).
generate
generateUse Eraser's AI to generate a diagram from a text prompt.
| Resource | Required params | Description |
|---|---|---|
file | text | Generate a diagram and save it as a new file |
diagram | text, targetFileId | Generate a diagram and add it to an existing file |
Optional params:
| Param | Values / Description |
|---|---|
diagramType | freeform-diagram, sequence-diagram, entity-relationship-diagram, cloud-architecture-diagram, flowchart-diagram, bpmn-diagram, custom-diagram |
colorMode | pastel, bold, outline |
styleMode | plain, shadow, watercolor |
typeface | rough, clean, mono |
direction | up, down, left, right |
theme | light, dark |
format | png, jpeg — returns a rendered image alongside the diagram |
imageQuality | 1, 2, 3 |
background | Include background in rendered image |
title | Title for the generated file |
folderId | Save the new file into a specific folder |
templateId | Use a template as the basis for generation |
presetId | Apply an AI preset's rules to the generation |
priorRequestId | Reference a previous generation for iterative refinement |
attachments | Attach files for context |
gitContexts | Attach git repository context |
generateEdit
generateEditUse Eraser's AI to edit an existing diagram from a text prompt.
Required params: resource, fileId, text.
Optional: diagramId (to target a specific diagram in the file), plus all the same styling and rendering options as generate (colorMode, styleMode, typeface, direction, theme, format, imageQuality, background, presetId, templateId, priorRequestId, attachments, gitContexts).
get
getFetch a single resource by ID, or fetch your user profile.
| Resource | Required params | Description |
|---|---|---|
me | — | Returns the current user's profile and active team |
file | fileId | Get a file's metadata, document content, and diagram elements |
diagram | diagramId | Get a specific diagram's type and code |
folder | folderId | Get a folder's metadata |
preset | presetId | Get an AI preset's rules and settings |
list
listList resources with pagination and filtering.
| Resource | Key params | Description |
|---|---|---|
team | — | List all teams the user is a member of |
file | folderId, author, sort, limit, cursor | List files with pagination, sorting, and filtering |
diagram | fileId | List all diagrams in a file with their type and code |
folder | parentFolderId | List folders, optionally filtered by parent |
preset | — | List AI presets |
Sorting options for files: createdAt, updatedAt, -createdAt, -updatedAt.
search
searchFull-text search across your workspace.
| Resource | Required params | Description |
|---|---|---|
file | query | Search across file titles and content |
diagram | query | Search across diagram code |
Optional params: limit, offset.
create
createCreate a new resource. For diagrams, only use this when the user explicitly provides DSL code — use generate for AI-powered diagram creation.
| Resource | Key params | Description |
|---|---|---|
file | name, document, folderId | Create a new file with optional document content |
diagram | fileId, code, diagramType | Add a diagram with DSL code to an existing file |
folder | name, parentFolderId | Create a folder, optionally nested under a parent |
preset | name, description, rules, isDefault | Create an AI preset with custom generation rules |
Supported diagramType values: freeform-diagram, sequence-diagram, entity-relationship-diagram, cloud-architecture-diagram, flowchart-diagram, bpmn-diagram, custom-diagram.
update
updateUpdate an existing resource.
| Resource | Key params | Description |
|---|---|---|
file | fileId, title, document, folderId, linkAccess | Update a file's title, content, folder, or sharing |
diagram | diagramId, code, targetFileId | Replace a diagram's code or move it to another file |
folder | folderId, name, parentFolderId | Rename or move a folder |
preset | presetId, name, description, rules, isDefault | Update an AI preset's rules or settings |
linkAccess options: no-link-access, anyone-with-link-can-edit, publicly-viewable, publicly-editable, sso-readable, sso-editable.
delete
deleteDelete or archive a resource.
| Resource | Required params | Description |
|---|---|---|
file | fileId | Archive (soft-delete) a file. Can be restored from the trash |
diagram | diagramId | Permanently delete a diagram from a file |
folder | folderId | Delete a folder. Use recursive: true to include contents |
export
exportRender a diagram to an image and return a temporary download URL.
Required params: resource (diagram), diagramId, fileId.
Optional params:
| Param | Values / Description |
|---|---|
format | png, jpeg |
theme | light, dark |
imageQuality | 1, 2, 3 |
background | Include background in the image |
FAQ
Is it free?
Yes. The Eraser MCP server is free to use and subject to the same free tier limits as in-app usage.
What can the Eraser MCP do?
With the Eraser MCP, agents can generate diagrams and documents from natural language, create and manage files in your Eraser workspace, and read or update existing diagrams and documents. See Capabilities and Tools above for the full list.
Which server and auth method should I use?
The remote server with OAuth is recommended for most users. It requires no installation and authenticates securely via your Eraser account. API key auth and the local server are better suited for agentic pipelines where users may not have their own Eraser accounts, or for environments that don't support OAuth.
Does it support API key authentication?
Yes. Obtain an API key from your Eraser account settings and pass it as the ERASER_API_KEY environment variable.
Does it support a local MCP server?
Yes. The local server is available as @eraserlabs/eraser-mcp on npm and uses API key authentication. Replace your_api_key with your key from Eraser account settings.
Claude Code:
claude mcp add eraser -- npx -y @eraserlabs/eraser-mcpThen set ERASER_API_KEY in your environment or Claude Code's MCP env config.
Cursor / VS Code / GitHub Copilot — add to your MCP config:
{
"mcpServers": {
"eraser": {
"command": "npx",
"args": ["-y", "@eraserlabs/eraser-mcp"],
"env": {
"ERASER_API_KEY": "your_api_key"
}
}
}
}Where are files and diagrams saved?
All files and diagrams are saved to your Eraser account and accessible from the Eraser app.
Who can access files I've generated?
Only you. Files are created under your identity and are private by default. You can change the access level and link sharing settings at any time, either in the Eraser app or via the update tool.
Does it use AI credits?
Yes. Calls that involve AI generation will use AI credits from your Eraser account.
Something missing?
Reach out to the Eraser team at [email protected].
Updated 17 days ago