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/mcp

Claude

  1. Open claude.ai and navigate to Settings > Integrations
  2. Under MCP servers, click Add integration
  3. Enter the server URL: https://app.eraser.io/api/mcp
  4. 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/mcp

VS 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

Set the active team for subsequent operations. Required when you belong to multiple teams (OAuth only).

generate

Use Eraser's AI to generate a diagram from a text prompt.

ResourceRequired paramsDescription
filetextGenerate a diagram and save it as a new file
diagramtext, targetFileIdGenerate a diagram and add it to an existing file

Optional params:

ParamValues / Description
diagramTypefreeform-diagram, sequence-diagram, entity-relationship-diagram, cloud-architecture-diagram, flowchart-diagram, bpmn-diagram, custom-diagram
colorModepastel, bold, outline
styleModeplain, shadow, watercolor
typefacerough, clean, mono
directionup, down, left, right
themelight, dark
formatpng, jpeg — returns a rendered image alongside the diagram
imageQuality1, 2, 3
backgroundInclude background in rendered image
titleTitle for the generated file
folderIdSave the new file into a specific folder
templateIdUse a template as the basis for generation
presetIdApply an AI preset's rules to the generation
priorRequestIdReference a previous generation for iterative refinement
attachmentsAttach files for context
gitContextsAttach git repository context

generateEdit

Use 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

Fetch a single resource by ID, or fetch your user profile.

ResourceRequired paramsDescription
meReturns the current user's profile and active team
filefileIdGet a file's metadata, document content, and diagram elements
diagramdiagramIdGet a specific diagram's type and code
folderfolderIdGet a folder's metadata
presetpresetIdGet an AI preset's rules and settings

list

List resources with pagination and filtering.

ResourceKey paramsDescription
teamList all teams the user is a member of
filefolderId, author, sort, limit, cursorList files with pagination, sorting, and filtering
diagramfileIdList all diagrams in a file with their type and code
folderparentFolderIdList folders, optionally filtered by parent
presetList AI presets

Sorting options for files: createdAt, updatedAt, -createdAt, -updatedAt.

search

Full-text search across your workspace.

ResourceRequired paramsDescription
filequerySearch across file titles and content
diagramquerySearch across diagram code

Optional params: limit, offset.

create

Create a new resource. For diagrams, only use this when the user explicitly provides DSL code — use generate for AI-powered diagram creation.

ResourceKey paramsDescription
filename, document, folderIdCreate a new file with optional document content
diagramfileId, code, diagramTypeAdd a diagram with DSL code to an existing file
foldername, parentFolderIdCreate a folder, optionally nested under a parent
presetname, description, rules, isDefaultCreate 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

Update an existing resource.

ResourceKey paramsDescription
filefileId, title, document, folderId, linkAccessUpdate a file's title, content, folder, or sharing
diagramdiagramId, code, targetFileIdReplace a diagram's code or move it to another file
folderfolderId, name, parentFolderIdRename or move a folder
presetpresetId, name, description, rules, isDefaultUpdate 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

Delete or archive a resource.

ResourceRequired paramsDescription
filefileIdArchive (soft-delete) a file. Can be restored from the trash
diagramdiagramIdPermanently delete a diagram from a file
folderfolderIdDelete a folder. Use recursive: true to include contents

export

Render a diagram to an image and return a temporary download URL.

Required params: resource (diagram), diagramId, fileId.

Optional params:

ParamValues / Description
formatpng, jpeg
themelight, dark
imageQuality1, 2, 3
backgroundInclude 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-mcp

Then 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].