Docs
Schedule demo Open app

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
  • AI document generation and editing – Generate a file’s document from a prompt, then edit it with natural language instructions
  • Diagram export – Render diagrams to PNG or JPEG with configurable theme, quality, and background, or export them as editable draw.io files
  • 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, their rules, and the templates and references that shape generation style and terminology
  • Full-text search – Search across files and diagrams in your workspace

See Tools for the full list.

Authentication

The Eraser MCP server supports two authentication methods:

  • OAuth (recommended). The default for the remote server, and what the setup instructions below use. No configuration needed – the first time your client connects, you’ll be prompted to sign in with your Eraser account.
  • API key. A token you pass explicitly. Use this for agentic pipelines, CI, and headless environments where no user is present to sign in, for clients that don’t support OAuth (such as Microsoft Copilot Studio), or when actions should be attributed to your team rather than an individual. See API key authentication below.

The two methods differ in billing and attribution: OAuth requests use the signed-in user’s AI credits and are attributed to that user. API key requests use team-level credits and are attributed to the team.

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. To authenticate with an API key instead, see API key authentication.

Claude Code

claude mcp add --transport http eraser https://app.eraser.io/api/mcp

Claude (claude.ai)

Open the Eraser connector page and click Connect.

ChatGPT

Open the Eraser listing in the ChatGPT plugin directory and click Install plugin.

Cursor

Add to your Cursor MCP config (.cursor/mcp.json):

{
  "mcpServers": {
    "eraser": {
      "url": "https://app.eraser.io/api/mcp"
    }
  }
}

Codex

Using CLI

codex mcp add eraser --url https://app.eraser.io/api/mcp

Using Desktop App

Open the Eraser listing in the ChatGPT plugin directory and click Install plugin.

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"
      }
    }
  }
}

Kiro

Add to your Kiro MCP config – .kiro/settings/mcp.json for a single workspace, or ~/.kiro/settings/mcp.json to make it available across all workspaces:

{
  "mcpServers": {
    "eraser": {
      "url": "https://app.eraser.io/api/mcp",
      "type": "http"
    }
  }
}

Microsoft Copilot Studio

We recommend API key auth for Copilot Studio – see API key authentication to generate a key.

  1. Create or open an agent.
  2. Go to Tools → Add tool → New tool → Model Context Protocol.
  3. Fill in:
    • Server name: Eraser MCP
    • Server description: Generate, edit, and manage Eraser diagrams and documents
    • Server URL: https://app.eraser.io/api/mcp
    • Authentication: API key, with Type Header and Header name Authorization
  4. Select Create, then open the Connection dropdown and select Create new connection.
  5. In the connection field, paste your key with the Bearer prefix:
   Bearer YOUR_API_KEY
  1. Select Create, then Add and configure. The Eraser tools are now available to your agent.
  2. Test the agent in the test panel to confirm the Eraser tools respond.
  3. Select Publish and confirm.

Make available in Microsoft 365 Copilot

  1. Go to the Channels tab and select Microsoft 365 Copilot and Teams.
  2. Confirm Make agent available in Microsoft 365 Copilot is checked, use Edit details to set the display name, icon, and description, then Save.
  3. Save again to submit for admin review.
  4. Set availability: share directly with yourself or specific people and groups, or have an admin approve it to the org catalog.

The agent then appears in the Microsoft 365 Copilot app and Teams, where you select or @mention it in a chat.

API key authentication

If OAuth doesn’t fit your setup – pipelines, CI, clients without OAuth support – you can authenticate with an API key instead.

Getting an API key

Obtain an API key from your Eraser account settings. Treat it like a password – store it in a secrets manager or environment variable, not in checked-in config files.

Remote server

Pass the key as a bearer token on the Authorization header.

Claude Code

claude mcp add --transport http eraser https://app.eraser.io/api/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Cursor, VS Code, and other JSON-configured clients

Add a headers block to the server entry. For example, in Cursor’s .cursor/mcp.json:

{
  "mcpServers": {
    "eraser": {
      "url": "https://app.eraser.io/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

The same headers block works in VS Code’s .vscode/mcp.json and GitHub Copilot’s settings.json alongside the existing url and type fields.

Using an API key in CI

API keys let agents use Eraser in pipelines with no user present. For example, a GitHub Actions step that gives Claude Code access to Eraser:

- name: Add Eraser MCP server
  run: |
    claude mcp add --transport http eraser https://app.eraser.io/api/mcp \
      --header "Authorization: Bearer ${{ secrets.ERASER_API_KEY }}"

Store the key as a repository or organization secret rather than hardcoding it in the workflow file.

Tools

These are the tools the remote server gives your agent. Tools that start with manually_ write the code or markdown you pass as-is, with no AI. Their counterparts without the prefix take a natural language instruction instead.

The local server (@eraserlabs/eraser-mcp) has its own, smaller set of tools.

Diagrams

ToolDescription
list_diagramsList the diagrams in a file
get_diagramGet a diagram’s code
create_diagramGenerate a diagram from a prompt
manually_create_diagramAdd a diagram from your own code
update_diagramEdit a diagram with an instruction
manually_update_diagramReplace a diagram’s code
delete_diagramDelete a diagram

Documents

ToolDescription
get_documentGet a file’s document as markdown
create_documentGenerate a document from a prompt
manually_create_documentFill an empty document with your own markdown
update_documentEdit a document with an instruction
manually_update_documentReplace a document’s markdown
delete_documentClear a document

Files

ToolDescription
list_filesList files, optionally in a folder
get_fileGet a file’s outline and diagram list
create_fileCreate an empty file or duplicate one
update_fileRename, move, or share a file, or fill it from a template
manually_update_fileReplace a file’s document and diagram code
delete_fileArchive a file

Folders

ToolDescription
list_foldersList folders or find one by name
get_folderGet a folder
create_folderCreate a folder
update_folderRename or move a folder, or share its files
delete_folderDelete an empty folder

Search and export

ToolDescription
searchSearch file contents, file names, or diagrams
export_diagramExport a diagram as PNG, JPEG, or draw.io
export_documentExport a document as markdown
export_fileGet a link to export a file as PDF in the app

Presets

ToolDescription
list_presetsList presets or find one by name
get_presetGet a preset’s rules, templates, and references
create_presetCreate an empty preset
update_presetRename a preset or make it the default
update_rulesAdd, edit, or remove a preset’s rules
delete_presetDelete an empty preset

Templates and references

ToolDescription
get_template_or_referenceGet a template or reference file
create_template_or_referenceCreate a template or reference and attach it to a preset
update_template_or_referenceRename a template or reference
add_or_remove_template_or_referenceAttach an existing file to a preset, or detach it
publish_template_or_referencePublish a new version of a template or reference

Account

ToolDescription
get_meGet the current user and team
list_teamsList your teams
select_teamSet the active team

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 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. See API key authentication for setup examples, and Authentication for how billing and attribution differ from OAuth.

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 --env ERASER_API_KEY=your_api_key -- npx -y @eraserlabs/eraser-mcp

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?

With OAuth, files are created under your identity and are private by default. With an API key, files are created under the team and attributed to the team rather than an individual user. In either case, you can change the access level and link sharing settings at any time, either in the Eraser app or via the update_file 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 hello@eraser.io.