Skip to main content
Glama

Eraser MCP Server

An MCP (Model Context Protocol) server that provides tools for creating diagrams on Eraser.io.

Features

  • Create diagrams on Eraser.io using their API

  • Support for multiple diagram types (sequence-diagram, flowchart-diagram, cloud-architecture-diagram, entity-relationship-diagram)

  • Returns direct links to view and edit diagrams

  • Validate diagram syntax before creating

  • Automatically fix common syntax errors

  • Simple Docker-based integration with Claude Desktop

Related MCP server: Eraser Diagram Renderer

Quick Setup

1. Get an Eraser.io API Key

Sign up at Eraser.io and get your API key from your account settings.

2. Build the Docker Image

Clone this repository and build the Docker image:

git clone <repository-url>
cd eraser-mcp
./scripts/build-claude-docker.sh

3. Configure Claude Desktop

Add this configuration to your Claude Desktop settings file:

Configuration File Location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

Configuration:

{
  "mcpServers": {
    "eraser": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e", "ERASER_API_KEY=yourapikey",
        "eraser-mcp:claude"
      ]
    }
  }
}

4. Restart Claude Desktop

After saving the configuration file, completely quit and restart Claude Desktop.

5. Test the Integration

In Claude Desktop, try asking:

  • "Create a sequence diagram showing a login process"

  • "Can you validate this flowchart syntax?"

6. Create a Claude Desktop Project (Optional)

For better organization and persistent access to diagram syntax references, create a dedicated project:

  1. Create a new project in Claude Desktop by clicking the "+" icon in the sidebar

  2. Name your project (e.g., "Eraser Diagrams" or "System Architecture")

  3. Add the syntax guide by uploading or copying the diagram syntax documentation to your project knowledge base

Benefits of using a project:

  • Persistent access to diagram syntax documentation

  • Context-aware assistance for diagram creation

  • Organized workspace for all your architecture diagrams

  • Custom instructions ensure consistent diagram formatting

Now you can chat with Claude in this project and it will automatically use the Eraser MCP tools with full knowledge of the proper syntax for all diagram types.

Available Tools

create_diagram

Creates a new diagram on Eraser.io and returns links to view and edit it.

Parameters:

  • content (required): Diagram content in Eraser DSL format

  • diagramType (optional): Type of diagram (sequence-diagram, cloud-architecture-diagram, entity-relationship-diagram, flowchart-diagram). Default: sequence-diagram

  • theme (optional): Theme for the diagram (light, dark). Default: dark

  • background (optional): Whether to include background in the rendered image. Default: true

Returns:

  • Image URL: Direct link to view/download the rendered diagram image

  • Edit URL: Link to open and edit the diagram in Eraser

validate_diagram

Validates Eraser diagram syntax and returns any errors found.

Parameters:

  • content (required): Diagram content in Eraser DSL format to validate

  • diagramType (optional): Type of diagram to validate. Default: sequence-diagram

Returns:

  • Validation result indicating if the diagram syntax is valid

  • List of errors and warnings found (if any)

fix_diagram

Validates and attempts to fix common syntax errors in Eraser diagrams.

Parameters:

  • content (required): Diagram content in Eraser DSL format to fix

  • diagramType (optional): Type of diagram to fix. Default: sequence-diagram

Returns:

  • List of applied fixes

  • Fixed diagram content

  • Validation status after fixes

Examples

Creating a Sequence Diagram

Create a sequence diagram with this content:
Client > Server: Request
Server > Database: Query
Database --> Server: Results
Server --> Client: Response

Creating a Flowchart

Create a flowchart:
Start [shape: oval]
Start > Process
Process > Decision [shape: diamond]
Decision > End [shape: oval]

Validation Features

The server includes built-in validation for all supported diagram types:

  • Sequence Diagrams: Validates message formats, activation blocks, and control structures

  • Flowcharts: Validates node definitions, connections, shapes, and groups

  • Entity Relationship Diagrams: Validates entity definitions, attributes, and relationships

  • Cloud Architecture Diagrams: Validates service definitions, icons, and connections

Common fixes applied automatically:

  • Arrow syntax corrections (e.g., => to >)

  • Missing brackets and quotes

  • Trailing whitespace removal

  • Missing colons in sequence messages

  • Shape name corrections (e.g., circle to oval)

Troubleshooting

Docker Image Not Found

Error: Unable to find image 'eraser-mcp:claude'
Solution: Run the build script: ./scripts/build-claude-docker.sh

API Key Issues

Error: Server reports API key errors
Solution: Check that your API key is correct in the configuration

Permission Issues

Error: Docker permission denied
Solution: Ensure Docker is running and your user has Docker permissions

Development

For development, you can use the included Dev Container:

  1. Open in VS Code with Dev Containers extension

  2. Make changes to the code

  3. Rebuild the Docker image: ./scripts/build-claude-docker.sh

Development Commands

  • npm install - Install dependencies

  • npm run dev - Run with hot reload

  • npm run build - Build TypeScript to JavaScript

  • npm run lint - Run ESLint

  • npm run typecheck - Run TypeScript type checking

Testing

cd tests
./run-tests.sh

Diagram Syntax Documentation

For detailed syntax information for each diagram type, visit:

License

MIT

Available Tools

3 tools
create_diagramA
ParametersJSON Schema
NameRequiredDescriptionDefault
contentYesDiagram content in Eraser DSL format
diagramTypeNoType of diagram to createsequence-diagram
themeNoTheme for the diagramdark
backgroundNoWhether to include background in the rendered image

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure and does so comprehensively. It explains the tool's position in workflows ('Typically the final step after validate_diagram and/or fix_diagram'), describes the output format in detail ('Success message with diagram URLs', 'Image URL: Direct link to view/download', 'Edit URL: Link to open and edit'), and provides practical guidance about when content should be ready ('must be syntactically valid').

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description uses a well-structured XML format with clear sections (purpose, when-to-use, when-not-to-use, examples, parameters, output-format, workflow-position). Every section serves a distinct purpose with no redundant information. The examples are practical and illustrate different usage scenarios efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter tool with no annotations and no output schema, the description provides exceptional completeness. It covers purpose, usage guidelines with sibling differentiation, parameter semantics with practical advice, detailed output format description, workflow positioning, and concrete examples. This fully compensates for the lack of structured metadata.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds meaningful context beyond the schema: it explains that content must be 'complete diagram code in Eraser DSL format - must be syntactically valid' (emphasizing completeness and validity requirements), provides guidance on theme selection ('dark works well for most cases, light for print/documents'), and explains background parameter usage ('usually true unless user needs transparency'). However, it doesn't add significant value for diagramType beyond what the enum provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states 'Create and render diagrams on Eraser.io, returning URLs for viewing and editing' - a specific verb ('create and render'), resource ('diagrams on Eraser.io'), and output ('URLs for viewing and editing'). It clearly distinguishes this tool from its siblings (fix_diagram and validate_diagram) by emphasizing creation/rendering versus validation/fixing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit when-to-use and when-not-to-use sections with clear alternatives named (validate_diagram, fix_diagram). It gives specific scenarios for usage ('User asks to create, make, generate...', 'User provides complete diagram content') and exclusions ('User only wants to check if syntax is correct', 'Diagram content has known syntax errors').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

fix_diagramA
ParametersJSON Schema
NameRequiredDescriptionDefault
contentYesDiagram content in Eraser DSL format to fix
diagramTypeNoType of diagram to fixsequence-diagram

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and delivers substantial behavioral context. It details specific fixes applied (arrow syntax corrections, missing bracket/brace/quote fixes, shape name corrections), output format details (list of fixes, corrected code, validation status), and workflow positioning. It doesn't mention rate limits or authentication requirements, but provides rich operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is comprehensive but verbose with XML-style markup. While well-structured with clear sections (purpose, when-to-use, when-not-to-use, examples, fixes-applied, parameters, output-format, workflow-position), it could be more concise. Every section adds value, but the markup adds unnecessary length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a 2-parameter tool with mutation behavior, the description provides exceptional completeness. It covers purpose, usage guidelines, behavioral details, parameter context, output format, workflow positioning, and concrete examples. For a tool that modifies content, this level of disclosure is comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, establishing a baseline of 3. The description adds meaningful context: it explains that 'content' is 'the diagram code to fix - will be analyzed and corrected' and that 'diagramType' 'must match the diagram type for appropriate fixes'. This provides practical guidance beyond the schema's technical specifications.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the purpose as 'Automatically fix common syntax errors in Eraser diagrams and return corrected version' - a specific verb ('fix'), resource ('Eraser diagrams'), and outcome ('return corrected version'). It clearly distinguishes from sibling tools validate_diagram (diagnostic) and create_diagram (creation).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit when-to-use scenarios (user asks to fix/correct/repair, after validate_diagram finds auto-correctable errors) and when-not-to-use scenarios (user only wants diagnostics, diagram already valid, design/structural changes needed). It names specific alternatives (validate_diagram, create_diagram) and provides workflow context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

validate_diagramA
ParametersJSON Schema
NameRequiredDescriptionDefault
contentYesDiagram content in Eraser DSL format to validate
diagramTypeNoType of diagram to validatesequence-diagram

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does so effectively. It describes behavioral aspects like handling partial or complete diagram code, providing line-specific errors and warnings, and positioning in a validate→fix→create workflow. It doesn't mention rate limits or authentication needs, but covers core operational behavior thoroughly.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear XML-like sections (purpose, when-to-use, when-not-to-use, examples, parameters, output-types, workflow-position) that make it easy to parse. Every section adds value with no redundant information, and the content is appropriately sized for a tool with clear sibling relationships and behavioral complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (validation with detailed feedback), no annotations, no output schema, and clear sibling tools, the description is remarkably complete. It covers purpose, usage guidelines, examples, parameter semantics, output types, and workflow positioning. The only minor gap is lack of explicit error format details, but the output-types section provides sufficient high-level understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds meaningful context beyond the schema: it explains that content can be 'partial or complete' (not in schema) and that diagramType 'must match the actual diagram type for accurate validation' (emphasizing importance). This provides practical usage guidance that enhances parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the purpose as 'Check Eraser diagram syntax for errors and provide detailed feedback about validity' with a specific verb ('check'), resource ('Eraser diagram syntax'), and outcome ('errors and detailed feedback'). It clearly distinguishes from sibling tools create_diagram and fix_diagram by focusing on validation rather than creation or correction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance with dedicated <when-to-use> and <when-not-to-use> sections that list specific scenarios and alternatives. It names sibling tools (create_diagram, fix_diagram) for when not to use this tool, and includes example user queries to illustrate appropriate contexts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4.7/5.0
Disambiguation5/5

The three tools have clearly distinct purposes with no overlap: validate_diagram checks syntax, fix_diagram corrects errors, and create_diagram renders final diagrams. The detailed when-to-use/when-not-to-use sections explicitly differentiate them, and the workflow-position tags reinforce their sequential relationship (validate→fix→create).

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (validate_diagram, fix_diagram, create_diagram) with the same noun ('diagram') and clear action verbs. This uniformity makes the tool set predictable and easy to understand at a glance.

Tool Count5/5

Three tools is perfectly appropriate for this server's focused domain of diagram processing. Each tool serves a distinct, essential function in the workflow (validation, correction, creation), and there are no missing or extraneous tools—the count aligns well with the scope.

Completeness5/5

The tool set provides complete coverage for the diagram lifecycle: validation, fixing, and creation. There are no gaps; agents can handle any diagram-related request from syntax checking to final rendering, with clear guidance on tool selection through the detailed documentation.

Maintenance

ActivityInactive
ResponsivenessSyncing

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

Related MCP Servers

Appeared in Searches

Latest Blog Posts

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/whiteprompt/15000-whiteprompt-eraserio-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server