diagrams-mcp-server
Provides tools for managing Mermaid diagrams in a project, including listing, reading, creating, updating, deleting, rendering to SVG/PNG, and checking diagram consistency against the codebase.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@diagrams-mcp-serverCheck whether my architecture diagrams still match the actual codebase"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
diagrams-mcp-server
Technical Preview (V1 Preview, v0.1.0) — local-first MCP server for PlantUML and Mermaid diagrams with architecture drift detection.
An MCP (Model Context Protocol) server that gives AI coding agents direct, structured access to your project's PlantUML and Mermaid architecture diagrams — list them, read them, create or update them, render them to images, and (uniquely) check whether they still match your actual code.
Works with any MCP-compatible client over stdio: Claude Desktop, Claude Code, Codex (Desktop & CLI), Antigravity (IDE, 2.0 & CLI), OpenCode (Desktop & CLI), Cursor, and VS Code. See Client setup below.
Why this exists
I built this after running into the same problem while using AI to work on software design. The diagram was in one place, the code was in another, and I kept having to paste context into the conversation. After a few rounds, it became hard to tell whether the diagram still described the project. I wanted a small local MCP server that could keep the diagram in the project, let the agent read it, and check it against the code when needed.
diagrams-mcp-server closes that gap: it treats your diagrams folder as a first-class, agent-readable part of the project, right next to the code. Because it is built on plain stdio MCP with no client-specific code, it works across the clients listed below.
Related MCP server: diagrams-mcp
Features
Tool | What it does |
| List all PlantUML/Mermaid diagrams in the project, with extracted titles and explicit |
| Read the raw source of a diagram, in full or as an explicit |
| Create a new diagram file (refuses to overwrite) |
| Replace an existing diagram's content |
| Delete a diagram (explicit, marked |
| Render a diagram to SVG/PNG |
| Compare class/interface/component names in a diagram against your actual codebase and flag anything that looks outdated |
diagrams_check_consistency is a fast, dependency-free heuristic (not a full semantic/AST analysis): it extracts entity names from class/interface/enum/component declarations in the diagram and searches your source files for a matching identifier. It won't catch everything a real static analyzer would, but it catches the most common and costly form of drift: a class that was renamed or deleted, or a component that was designed but never built — for free, with no per-language parser required. Structured output includes the extracted/matched/unmatched entity names, per-entity evidence with matched files, the analyzer tiers involved (reliable vs experimental/generic heuristic), and an explicit heuristic confidence warning. Codebase scans are capped at 5,000 source files; the result reports truncated, scan_limit, files_scanned, and scan_warning so a capped scan is never mistaken for a complete one — when truncated is true, unmatched results may be incomplete.
Pagination and source windows
Pagination is explicit and opt-in — the server never pages or truncates on its own.
diagrams_list accepts optional offset (non-negative integer, default 0) and limit (integer 1–500). Omitting both returns every match. The response always includes count (items in this page), total (matches before paging), the effective offset/limit, and has_more (whether items after this page remain). An offset past the end returns an empty page with has_more: false, not an error. Example: first diagrams_list({ "type_filter": "all", "limit": 10 }), then diagrams_list({ "type_filter": "all", "offset": 10, "limit": 10 }) while has_more is true.
diagrams_get accepts optional offset (zero-based character offset, default 0) and max_chars (integer 1–100000). Omitting both returns the full source. The response always includes is_partial, the effective offset, total_chars, returned_chars, and has_more; the text block always equals the returned content, so a window is never silently truncated. An offset past the end of the source returns an isError result instead of an empty string. Example: diagrams_get({ "relative_path": "models/big.puml", "offset": 0, "max_chars": 2000 }), then repeat with offset: 2000.
Requirements
Node.js 18+ for running the server (runtime
engines: >=18— the compileddist/output,npm test, andnpm startwork on Node 18)Node.js >=20.19 for the development toolchain (
npm ci,npm run lint,npm run format:check,npm run build) — the ESLint 10 toolchain does not run on older Node versions(Optional, for
diagrams_render)@mermaid-js/mermaid-clifor Mermaid rendering:npm install -g @mermaid-js/mermaid-cli(Optional, for
diagrams_render) A localplantumlCLI for offline PlantUML rendering. Without it, rendering fails with an actionable error unless remote rendering is explicitly enabled withALLOW_REMOTE_PLANTUML=true, in which case it falls back to the publicplantuml.comserver over HTTPS.DISABLE_REMOTE_PLANTUML=truealways disables the fallback, even when the allow flag is set.
Installation
git clone https://github.com/mohammad-emad-dev/diagrams-mcp-server.git
cd diagrams-mcp-server
npm install
npm run buildLint and formatting
npm run lint # ESLint over src/ (TypeScript recommended rules, zero warnings allowed)
npm run format:check # Prettier check over src/ (100-col, double quotes, semicolons, trailing commas)Both run in CI (.github/workflows/ci.yml, Node 20.x/22.x matrix) before the build. They cover
source and test files under src/ only — dist/, node_modules/,
graphify-out/, and packed tarballs are excluded via eslint.config.mjs
and .prettierignore. These two commands require the development toolchain
(Node >=20.19); the server runtime itself still supports Node >=18.
Local tarball install (npm/npx, no registry)
The package has not been published to the npm registry. To install and
run this Technical Preview (v0.1.0) locally via npm/npx, pack and install
from a local tarball instead. package.json sets "private": true, so an
accidental npm publish is refused while npm pack and tarball installs
keep working:
npm pack # runs the prepack build and writes diagrams-mcp-server-0.1.0.tgz
cd /path/to/your/project
npm init -y # if the consumer project has no package.json yet
npm install /path/to/diagrams-mcp-server-0.1.0.tgz
npx diagrams-mcp-server --help # resolves the local install, exits 0This installs only the published payload (dist/ runtime files, README.md,
RELEASE_NOTES.md, LICENSE) — no tests, fixtures, or local configs — and
changes nothing outside the consumer project (no global packages, no
registry publish). Point any stdio MCP client at the installed binary
(node_modules/.bin/diagrams-mcp-server) the same way as dist/index.js
in Client setup.
Client setup
diagrams-mcp-server speaks plain stdio MCP, so it works with any MCP-compatible client. Setup instructions for each below.
All examples assume you built the server at /absolute/path/to/diagrams-mcp-server and want it attached to a project at /absolute/path/to/your/project. Replace both paths with your own.
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"diagrams": {
"command": "node",
"args": ["/absolute/path/to/diagrams-mcp-server/dist/index.js"],
"env": {
"PROJECT_ROOT": "/absolute/path/to/your/project"
}
}
}
}Claude Code
claude mcp add diagrams -- node /absolute/path/to/diagrams-mcp-server/dist/index.jsSet PROJECT_ROOT in your shell environment, or run Claude Code from within your project directory (it defaults to the current working directory).
Codex (Desktop & CLI)
codex mcp add diagrams -- node /absolute/path/to/diagrams-mcp-server/dist/index.jsOr add directly to ~/.codex/config.toml:
[mcp_servers.diagrams]
command = "node"
args = ["/absolute/path/to/diagrams-mcp-server/dist/index.js"]
env = { PROJECT_ROOT = "/absolute/path/to/your/project" }Antigravity (IDE, 2.0 & CLI)
Antigravity IDE, Antigravity 2.0, and Antigravity CLI share one config file: ~/.gemini/config/mcp_config.json (or .agents/mcp_config.json for project scope). Add:
{
"mcpServers": {
"diagrams": {
"command": "node",
"args": ["/absolute/path/to/diagrams-mcp-server/dist/index.js"],
"env": {
"PROJECT_ROOT": "/absolute/path/to/your/project"
}
}
}
}You can also add it from the IDE: Agent panel → ⋯ menu → MCP Servers → Manage MCP Servers → View raw config, then paste the same block.
OpenCode (Desktop & CLI)
opencode mcp addWhen prompted, choose Local as the server type and enter:
node /absolute/path/to/diagrams-mcp-server/dist/index.jsOr edit opencode.jsonc directly:
{
"mcp": {
"diagrams": {
"type": "local",
"command": ["node", "/absolute/path/to/diagrams-mcp-server/dist/index.js"],
"environment": {
"PROJECT_ROOT": "/absolute/path/to/your/project"
}
}
}
}Cursor (Desktop & CLI)
Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project-scoped):
{
"mcpServers": {
"diagrams": {
"command": "node",
"args": ["/absolute/path/to/diagrams-mcp-server/dist/index.js"],
"env": {
"PROJECT_ROOT": "/absolute/path/to/your/project"
}
}
}
}VS Code (with GitHub Copilot)
Add to .vscode/mcp.json in your workspace:
{
"servers": {
"diagrams": {
"command": "node",
"args": ["/absolute/path/to/diagrams-mcp-server/dist/index.js"],
"env": {
"PROJECT_ROOT": "${workspaceFolder}"
}
}
}
}Or via the command palette: MCP: Add Server → Command (stdio), then enter the same command and args.
Configuration
Environment variable | Default | Description |
| current working directory | Root of the codebase this server is attached to (used by |
|
| Where diagram files live, relative to |
|
| Override the public PlantUML rendering fallback (e.g. to point at a self-hosted instance) |
| unset (remote fallback disabled) | Set to exactly |
| unset | Set to exactly |
Example
diagrams/
└── models/
└── user-class.pumlAsk your agent:
"Is the user-class diagram still accurate compared to the code?"
The agent calls diagrams_check_consistency, which reports:
1 of 2 entities in 'models/user-class.puml' were NOT found in the codebase:
- Order: 'Order' appears in the diagram but no matching identifier was
found in the scanned codebase. It may be renamed, removed, or not yet
implemented.Project layout
src/
├── index.ts # Server entry point (stdio transport)
├── context.ts # Resolves PROJECT_ROOT / DIAGRAMS_DIR once at startup
├── constants.ts # Shared constants
├── types.ts # Shared TypeScript types
├── services/
│ ├── diagramStore.ts # Safe filesystem CRUD (path-traversal protected)
│ ├── renderer.ts # Mermaid/PlantUML -> SVG/PNG rendering
│ └── consistencyChecker.ts # Diagram <-> code drift detection
└── tools/
├── diagramsList.ts
├── diagramsGet.ts
├── diagramsCreate.ts
├── diagramsUpdate.ts
├── diagramsDelete.ts
├── diagramsRender.ts
└── diagramsCheckConsistency.tsSecurity notes
All file operations are restricted to the configured diagrams directory; attempts to read/write outside it (e.g. via
../..) are rejected.diagrams_check_consistencyonly reads your codebase — it never modifies code or diagrams.No credentials or external accounts are required for any tool.
diagrams_renderfor PlantUML never leaves the machine unless remote rendering is explicitly enabled withALLOW_REMOTE_PLANTUML=true— and never whenDISABLE_REMOTE_PLANTUML=trueis set, which takes precedence. Mermaid rendering never leaves the machine.Local renderer processes run with a timeout and bounded stdout/stderr capture (1,000,000 characters per stream, enforced while collecting). A renderer that exceeds the cap or its timeout budget is stopped: its output pipes are closed and the process is killed, and rendering fails with an actionable error that never includes captured output, paths, or environment values. On timeout, the error is delivered immediately rather than waiting for a descendant process that inherited the renderer's output pipes (for example through the Windows
cmd.exeshim chain) to release them.
Roadmap ideas
AST-based consistency checking per language (starting with TypeScript) for higher precision than the current text-heuristic approach
Two-way diagram-to-code generation (scaffold a class from a diagram, or a diagram from a class)
Sequence diagram consistency checks against actual function call graphs
Contributions and issues welcome.
License
MIT — see LICENSE.
Available Tools
7 toolsdiagrams_check_consistencyCheck Diagram-to-Code ConsistencyARead-onlyIdempotent
Compare class/interface/component names mentioned in a PlantUML or Mermaid diagram against identifiers that actually exist in the codebase, to catch documentation drift.
This is a heuristic, text-based check (not a full semantic/AST analysis): it extracts entity names from class/interface/enum/component declarations in the diagram, then searches source files under the project root for a matching identifier as a whole word. It flags names that appear in the diagram but were not found anywhere in the scanned code — a signal the diagram may be outdated, or the code was renamed/removed/not yet built.
This tool does NOT modify the diagram or the code. It only reports findings; the caller (agent or human) decides what to do about them.
Args:
relative_path (string): Path to the diagram to check, relative to the diagrams root
Returns: JSON with schema: { "diagram_path": string, "entities_found": number, // total entity names extracted from the diagram "entities_matched": number, // how many were found somewhere in the code "entities_unmatched": number, // how many were NOT found (potential drift) "files_scanned": number, // how many source files were searched "searched_directory": string, // absolute path of the code root that was scanned "truncated": boolean, // true when the 5,000-file scan cap was reached; unmatched results may be incomplete "scan_limit": number, // maximum source files collected during the scan "scan_warning": string | null, // human-readable warning when truncated, otherwise null "entities": string[], // extracted entity names, in extraction order "matched_entities": string[], // extracted entities found in the code "unmatched_entities": string[],// extracted entities NOT found (potential drift) "analyzers": { // scanned file extensions per analyzer tier "reliable": string[], // per-language declaration patterns (JS/TS, Python, PHP, Java) "experimental": string[], // generic heuristic path (C#, Go, Ruby, Kotlin, Rust) "generic": string[] // other scanned extensions, heuristic path only }, "confidence": "heuristic", // results are evidence, never a definitive verdict "heuristic_warning": string, // human-readable limits of the heuristic "evidence": [ // per-entity evidence, same order as "entities" { "name": string, "matched": boolean, "analyzers": ("reliable" | "experimental" | "generic")[], "matched_files": string[], // POSIX paths relative to searched_directory (capped) "matched_file_count": number } ], "issues": [ { "name": string, // the unmatched entity name "issue": string, // human-readable explanation "severity": "warning" | "info" } ] }
Examples:
Use when: "Is this class diagram still accurate compared to the code?" -> relative_path="models/user-class.puml"
Use when: Reviewing a PR that touches architecture, to check the UML docs weren't left behind
Don't use when: The diagram has no class/interface/component declarations (e.g. a pure sequence diagram) — entities_found will be 0, which is expected, not an error
Error Handling:
Returns "Error: No diagram found at ''" if the diagram file doesn't exist
An empty "issues" array with entities_found=0 means no checkable entities were found in the diagram, not that everything matched
Unexpected internal failures return a generic "Error: Unexpected internal error ..." with isError:true and are logged to stderr without source, paths, or secrets
| Name | Required | Description | Default |
|---|---|---|---|
| relative_path | Yes | Path to the diagram to check, relative to the diagrams root. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false; the description reinforces this by stating 'This tool does NOT modify the diagram or the code.' Beyond that, it discloses the heuristic, text-based nature, the 5,000-file scan cap, truncation behavior, confidence level, and the distinction between reliable/experimental/generic analyzers. This exceeds what annotations alone convey.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is lengthy, but it is well-structured with clear sections (overview, args, returns, examples, error handling) and front-loads the purpose and key non-modifying constraint. Every section adds value, though the inline return schema is verbose. Slightly overlong but organized enough to earn a 4.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is exceptionally complete for a heuristic check tool: it covers the return schema in detail, error handling, edge cases (entities_found=0, truncation), and the confidence level. Despite having no output schema annotation, the description fully specifies the expected JSON structure and all relevant failure modes, leaving no ambiguity for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the only parameter (relative_path) is already described as 'Path to the diagram to check, relative to the diagrams root.' The description adds example paths and clarifies the root relative interpretation, but these are marginal additions beyond the schema. The baseline of 3 applies since the schema carries the semantic load.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool compares entity names in diagrams against code identifiers to catch documentation drift. It names the specific resource (PlantUML/Mermaid diagrams vs codebase) and distinguishes itself from sibling tools like diagrams_get or diagrams_render by focusing on consistency checking, not creation, retrieval, or rendering.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit when-to-use scenarios ('Is this class diagram still accurate?', PR review) and a concrete don't-use condition (pure sequence diagram with no declarations, where entities_found=0 is expected). Also clarifies that an empty issues array with entities_found=0 means no checkable entities, not a pass, preventing misinterpretation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
diagrams_createCreate New DiagramA
Create a new PlantUML or Mermaid diagram file under the diagrams root.
The diagram type is inferred from the file extension in relative_path:
.puml or .plantuml -> PlantUML
.mmd or .mermaid -> Mermaid
This tool refuses to overwrite an existing file — use diagrams_update for that. Intermediate directories in relative_path are created automatically.
Performs a basic, dependency-free syntax check before writing (not full validation): PlantUML must include @startuml/@enduml boundaries; Mermaid must start with a known diagram declaration. Clearly invalid or empty sources are rejected without creating a file.
Args:
relative_path (string): Path for the new file, relative to the diagrams root, with a recognized extension
content (string): Full diagram source text
Returns: JSON with schema: { "relative_path": string, "created": true }
Examples:
Use when: "Create a class diagram for the User model" -> relative_path="models/user-class.puml", content="@startuml\nclass User {\n +id: int\n}\n@enduml"
Don't use when: The file already exists and you want to change it (use diagrams_update instead)
Error Handling:
Returns "Error: ... already exists" if a file already exists at relative_path
Returns "Error: ... does not have a recognized diagram extension" if the extension isn't one of .puml/.plantuml/.mmd/.mermaid
Returns "Error: Invalid PlantUML diagram (basic check): ..." if PlantUML source is empty or missing @startuml/@enduml boundaries
Returns "Error: Invalid Mermaid diagram (basic check): ..." if Mermaid source is empty or has no recognized diagram declaration
Returns "Error: Refused to access path outside the diagrams root" if relative_path attempts to escape the diagrams directory
Unexpected internal failures return a generic "Error: Unexpected internal error ..." with isError:true and are logged to stderr without source, paths, or secrets
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Full PlantUML or Mermaid source text for the diagram. | |
| relative_path | Yes | Path for the new diagram, relative to the diagrams root, including extension (.puml, .plantuml, .mmd, or .mermaid). E.g. 'system/order-flow.puml'. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations only indicate non-readOnly, non-idempotent, non-destructive behavior. The description goes far beyond this by disclosing that it refuses to overwrite, creates intermediate directories automatically, performs a basic non-validating syntax check, rejects invalid/empty sources without creating files, prevents path escape, and logs unexpected errors safely without leaking secrets.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well structured: purpose first, then extension rules, overwrite policy, validation behavior, arg definitions, return shape, examples, and error handling. It is long but every section earns its place and the most decision-relevant information is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a creation tool with no output schema, the description fully compensates by specifying the exact return JSON structure, listing all expected error messages, and providing concrete usage examples. An agent has everything needed to invoke it correctly and anticipate failure modes.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already describes both parameters fully (100% coverage). The description adds value by clarifying the extension-to-type mapping, the meaning of a recognized extension, automatic creation of intermediate directories, and the syntax-check behavior, which give the agent practical context for constructing valid parameter values.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Create'), a specific resource ('PlantUML or Mermaid diagram file under the diagrams root'), and the inference rule from the file extension. It clearly distinguishes this tool from diagrams_update by explicitly saying it refuses to overwrite existing files.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit usage context: use for creating new diagrams, and explicitly says not to use it when the file exists and needs changing, naming diagrams_update as the alternative. The included examples of when and when not to use it make the decision easy for an agent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
diagrams_deleteDelete DiagramADestructive
Delete a single PlantUML or Mermaid diagram file from the diagrams root.
This is destructive and cannot be undone — the file is removed from disk. To replace content instead, use diagrams_update. To remove then recreate with different content, delete first, then use diagrams_create.
Args:
relative_path (string): Path to the diagram relative to the diagrams root, as returned by diagrams_list
Returns: JSON with schema: { "relative_path": string, "deleted": true }
Examples:
Use when: "Remove the outdated order-flow diagram" -> relative_path="system/order-flow.puml"
Don't use when: You want to change the diagram content but keep the file (use diagrams_update)
Error Handling:
Returns "Error: No diagram found at ''" if the file doesn't exist
Returns "Error: Refused to access path outside the diagrams root" if relative_path attempts to escape the diagrams directory (e.g. via '../..')
Unexpected internal failures return a generic "Error: Unexpected internal error ..." with isError:true and are logged to stderr without source, paths, or secrets
| Name | Required | Description | Default |
|---|---|---|---|
| relative_path | Yes | Path to the diagram to delete, relative to the diagrams root (e.g. 'system/order-flow.puml'). Get this from diagrams_list. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the destructiveHint=true annotation, the description discloses that deletion is physical and irreversible ('file is removed from disk'), details error responses for missing files and path traversal attempts ('Refused to access path outside the diagrams root'), and clarifies how internal failures are logged without leaking sensitive data. This is rich behavioral context that annotations alone do not provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is longer than average, but every section earns its place: purpose, destructiveness warning, alternatives, args, return shape, examples, and error handling. The most critical facts (destructive, irreversible) are front-loaded, and the structured sections make the content easy for an agent to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a destructive one-parameter tool with no structured output schema, the description is fully complete. It includes the return JSON shape, all relevant error cases, path safety constraints, and sibling-tool alternatives, so an agent has everything needed to invoke it correctly and predict consequences.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3; the description's Args section largely repeats the schema. However, the error-handling section and examples add meaning beyond the schema by clarifying that paths must come from diagrams_list and that escaping the diagrams root is refused, giving the agent a better model of valid and invalid inputs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Delete a single PlantUML or Mermaid diagram file from the diagrams root.' It clearly distinguishes the tool from siblings by explicitly naming diagrams_update and diagrams_create as alternatives for different goals, so an agent can select it correctly without opening schemas.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit when-to-use and when-not-to-use guidance: replace content -> use diagrams_update; remove and recreate -> delete then create. It also provides concrete examples ('Remove the outdated order-flow diagram') and a 'Don't use when' clause, making the decision boundary unambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
diagrams_getGet Diagram SourceARead-onlyIdempotent
Retrieve the raw source text of a single PlantUML or Mermaid diagram, in full or as an explicit character window.
Args:
relative_path (string): Path to the diagram relative to the diagrams root, as returned by diagrams_list
offset (number, optional): Zero-based character offset where the returned window starts (default: 0)
max_chars (number, optional): Maximum characters to return from offset (1-100000). Omit to return the full source
Returns: JSON with schema: { "relative_path": string, "type": "plantuml" | "mermaid", "content": string, // full source, or the requested [offset, offset+max_chars) window "is_partial": boolean, // true when content is a window rather than the full source "offset": number, // effective character offset of this window "total_chars": number, // full source length in characters "returned_chars": number,// length of the returned content "has_more": boolean // true when source after this window remains }
The text block always equals structuredContent.content. Content is never silently truncated: omitting offset/max_chars returns everything, and requesting a window is always reported via is_partial/has_more.
Examples:
Use when: "Show me the order-flow diagram" -> relative_path="system/order-flow.puml"
Use when: "Read the first 2000 characters of the big diagram" -> relative_path="...", offset=0, max_chars=2000, then offset=2000 for the next window
Don't use when: You need to list what diagrams exist first (use diagrams_list)
Error Handling:
Returns "Error: No diagram found at ''" if the file doesn't exist
Returns "Error: Refused to access path outside the diagrams root" if relative_path attempts to escape the diagrams directory (e.g. via '../..')
Returns "Error: Invalid source window: ..." if offset/max_chars are negative, non-integer, or max_chars is outside 1-100000
Returns "Error: offset is out of range ..." if offset points past the end of the source
Unexpected internal failures return a generic "Error: Unexpected internal error ..." with isError:true and are logged to stderr without source, paths, or secrets
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | Zero-based character offset into the diagram source where the returned window starts (default: 0). | |
| max_chars | No | Maximum characters to return starting at offset (1-100000). Omit to return the full source. | |
| relative_path | Yes | Path to the diagram, relative to the diagrams root (e.g. 'system/order-flow.puml'). Get this from diagrams_list. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds substantial behavioral detail beyond this: it explains the windowing behavior with is_partial/has_more flags, guarantees no silent truncation, and provides a comprehensive error-handling list (file not found, path escape, invalid window, out-of-range offset). This far exceeds annotation coverage and fully discloses behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
While long, the description is modularly structured with clear sections (Args, Returns, Examples, Error Handling) and front-loads the core purpose. Every sentence serves a purpose—there is no fluff or repetition. The length is justified by the tool's windowing and error complexity, and the structure makes it easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite lacking an output schema, the description provides a full inline JSON return schema with all fields explained. It covers error cases, examples, and parameter usage. For a tool with this complexity (character windows, partial returns), the description leaves nothing an agent needs to call it correctly; it is complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 reinforces each parameter and adds usage nuance: it explains that omitting offset/max_chars returns the full source, demonstrates a windowing example (offset=0, max_chars=2000, then offset=2000), and clarifies the zero-based offset. This goes beyond the schema's basic type/range descriptions, though it does not introduce entirely new semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a precise verb+resource statement: 'Retrieve the raw source text of a single PlantUML or Mermaid diagram, in full or as an explicit character window.' It clearly distinguishes itself from siblings, explicitly noting the alternative diagrams_list for listing diagrams. No ambiguity about what this tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The Examples section explicitly states 'Use when' scenarios (e.g., 'Show me the order-flow diagram') and 'Don't use when' (e.g., when needing to list diagrams first, use diagrams_list). It also instructs that relative_path should come from diagrams_list, giving clear routing to the correct sibling.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
diagrams_listList Architecture DiagramsARead-onlyIdempotent
List all PlantUML and Mermaid diagram files stored under the project's diagrams directory.
This tool scans the configured diagrams root recursively and returns every file with a recognized diagram extension (.puml, .plantuml, .mmd, .mermaid). It does NOT create, modify, or render diagrams — read-only.
Args:
type_filter ('plantuml' | 'mermaid' | 'all'): Restrict results to one diagram type (default: 'all')
offset (number, optional): Zero-based number of matching diagrams to skip (default: 0)
limit (number, optional): Maximum diagrams to return (1-500). Omit to return every remaining match
Returns: JSON with schema: { "diagrams_root": string, // absolute path being scanned "count": number, // number of diagrams in this page "total": number, // number of diagrams matching type_filter, before paging "offset": number, // effective offset of this page "limit": number, // effective limit of this page (requested limit, or remaining count when omitted) "has_more": boolean, // true when diagrams after this page remain "diagrams": [ { "relative_path": string, // path to use with diagrams_get / diagrams_update "type": "plantuml" | "mermaid", "title": string | null, // best-effort extracted title "size_bytes": number, "modified_at": string // ISO 8601 timestamp } ] }
Pagination is explicit: omitting offset/limit returns every match with has_more=false. Nothing is ever silently dropped — has_more tells the caller when to request the next page with offset=<offset+count>.
Examples:
Use when: "What diagrams exist for this project?" -> type_filter="all"
Use when: "Show me all the Mermaid diagrams" -> type_filter="mermaid"
Use when: "List diagrams ten at a time" -> limit=10, then offset=10 for the next page
Don't use when: You already know the exact path and just need its content (use diagrams_get instead)
Error Handling:
Returns an empty "diagrams" array if the diagrams directory doesn't exist yet or is empty (this is not an error)
Returns an empty page (count 0, has_more=false) when offset is past the end of the matches
Returns "Error: Invalid pagination: ..." if offset is negative/non-integer or limit is outside 1-500
Unexpected internal failures return a generic "Error: Unexpected internal error ..." with isError:true and are logged to stderr without source, paths, or secrets
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of diagrams to return (1-500). Omit to return every remaining match. | |
| offset | No | Zero-based number of matching diagrams to skip before the returned page (default: 0). | |
| type_filter | No | Restrict results to a single diagram type, or 'all' for both. | all |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The annotations already indicate readOnly, idempotent, and non-destructive behavior, and the description adds substantial context: recursive scanning, no create/modify/render side effects, explicit pagination semantics, empty-directory behavior, out-of-range offset behavior, and error message shapes. There is no contradiction with the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but well-structured and front-loaded with the core purpose. Every section (args, return schema, pagination, examples, error handling) earns its place since there is no output schema or separate documentation to carry that information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description fully specifies the return JSON structure, pagination flags, field meanings, and error behavior. It also covers the main sibling-tool distinction and edge cases like empty directories and invalid offsets, making it complete for an agent to invoke correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, so the baseline is 3. The description adds value beyond the schema by explaining the pagination contract (has_more, offset=offset+count, nothing silently dropped) and giving concrete examples for using limit and offset together. It somewhat restates the schema defaults, which prevents a higher score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb and resource: it scans the diagrams directory and lists PlantUML/Mermaid files. It also explicitly differentiates itself from siblings by stating it does NOT create, modify, or render diagrams, and by referring to diagrams_get when the exact path is already known.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives concrete 'Use when' examples for all filters and pagination scenarios, and a 'Don't use when' case naming diagrams_get as the alternative. This is explicit routing guidance that leaves no ambiguity about when to select this tool over siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
diagrams_renderRender Diagram to ImageARead-onlyIdempotent
Render a PlantUML or Mermaid diagram to an image (SVG or PNG) and return it as base64-encoded image content.
Rendering requirements:
Mermaid: requires the 'mmdc' CLI (install with: npm install -g @mermaid-js/mermaid-cli). No fallback exists.
PlantUML: uses a local 'plantuml' CLI if installed. Without one, rendering fails unless remote rendering is explicitly enabled with ALLOW_REMOTE_PLANTUML=true, in which case it falls back to the configured PlantUML rendering server over HTTPS (requires internet access; sends diagram source to that server). DISABLE_REMOTE_PLANTUML=true always disables the fallback, even when the allow flag is set.
Args:
relative_path (string): Path to the diagram, relative to the diagrams root
format ('svg' | 'png'): Output image format (default: 'svg')
Returns: An image content block (base64-encoded), plus a JSON summary: { "relative_path": string, "format": "svg" | "png", "rendered": true }
Examples:
Use when: "Show me what the order-flow diagram looks like" -> relative_path="system/order-flow.puml", format="svg"
Don't use when: You just need the raw source text (use diagrams_get instead, it's much cheaper)
Error Handling:
Returns "Error: No diagram found at ''" if the file doesn't exist
Returns "Error: Mermaid rendering requires the 'mmdc' CLI..." if rendering a Mermaid diagram without mmdc installed
Returns "Error: PlantUML rendering requires a local 'plantuml' CLI..." when no local CLI is installed and remote rendering is not explicitly enabled (set ALLOW_REMOTE_PLANTUML=true to opt in)
Returns "Error: PlantUML rendering server responded with ..." if both local and remote PlantUML rendering fail
Unexpected internal failures return a generic "Error: Unexpected internal error ..." with isError:true and are logged to stderr without source, paths, or secrets
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output image format (default: 'svg'). | svg |
| relative_path | Yes | Path to the diagram to render, relative to the diagrams root. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds extensive behavioral context beyond these: exact rendering dependencies, remote fallback conditions with environment flags (ALLOW_REMOTE_PLANTUML, DISABLE_REMOTE_PLANTUML), detailed error messages, and a security note about logging without source/paths/secrets. This is rich, non-redundant transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is longer than average, but every section (rendering requirements, args, returns, examples, error handling) carries necessary information for a tool with complex dependencies and failure modes. It is well-structured with headings and front-loaded purpose. A small amount of redundancy exists (error messages are verbose), but overall it is efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a rendering tool with two distinct renderers, fallback behaviors, and CLI dependencies, this description leaves nothing unstated. It covers prerequisites, flags, error cases, output format (base64 + JSON summary), and security/privacy concerns. Without an output schema, the description fully compensates by explaining the return structure. Complete for an agent to use correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and both parameters already have clear descriptions. The description reinforces relative_path's meaning (relative to diagrams root) and format's default, but more importantly adds example parameter values ('system/order-flow.puml', 'svg') that disambiguate real usage. It slightly exceeds the baseline by providing usage examples.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb-resource pair: 'Render a PlantUML or Mermaid diagram to an image (SVG or PNG)' and clarifies the output is base64 content. It clearly distinguishes from siblings by stating when not to use it (use diagrams_get for raw source), which is explicit sibling differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides concrete when-to-use ('Show me what the order-flow diagram looks like') and when-not-to-use conditions (raw source -> use diagrams_get). Additionally details prerequisites (mmdc CLI, plantuml CLI), fallback flags, and even names the preferred alternative (diagrams_get) – no ambiguity left.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
diagrams_updateUpdate Existing DiagramADestructiveIdempotent
Replace the full content of an existing PlantUML or Mermaid diagram file.
This performs a full-content replace, not a partial edit — pass the complete new diagram source. To create a new diagram, use diagrams_create (or set create_if_missing=true here).
Performs a basic, dependency-free syntax check before writing (not full validation): PlantUML must include @startuml/@enduml boundaries; Mermaid must start with a known diagram declaration. Clearly invalid or empty sources are rejected without overwriting the existing file.
Args:
relative_path (string): Path to the diagram, relative to the diagrams root
content (string): Full new diagram source text
create_if_missing (boolean): Create the file instead of erroring if it doesn't exist (default: false)
Returns: JSON with schema: { "relative_path": string, "updated": true }
Examples:
Use when: "Add a new field to the User class diagram" -> read current content with diagrams_get first, then call diagrams_update with the modified full content
Don't use when: The file doesn't exist yet and you don't want auto-creation (use diagrams_create)
Error Handling:
Returns "Error: No diagram found at ''" if the file doesn't exist and create_if_missing is false
Returns "Error: ... does not have a recognized diagram extension" if the extension isn't recognized
Returns "Error: Invalid PlantUML diagram (basic check): ..." if PlantUML source is empty or missing @startuml/@enduml boundaries (original file left unchanged)
Returns "Error: Invalid Mermaid diagram (basic check): ..." if Mermaid source is empty or has no recognized diagram declaration (original file left unchanged)
Returns "Error: Refused to access path outside the diagrams root" if relative_path attempts to escape the diagrams directory
Unexpected internal failures return a generic "Error: Unexpected internal error ..." with isError:true and are logged to stderr without source, paths, or secrets
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | New full PlantUML or Mermaid source text that replaces the existing content. | |
| relative_path | Yes | Path to the existing diagram, relative to the diagrams root. | |
| create_if_missing | No | If true and no diagram exists at relative_path, create it instead of failing (default: false). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds substantial behavior beyond the annotations: it discloses the pre-write syntax check, clarifies it is not full validation, states rejection conditions, and assures the original file is left unchanged on invalid input. This complements destructiveHint=true and idempotentHint=true without contradicting them.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but well-structured with labeled sections, and the core behavior is front-loaded in the first paragraph. Every sentence serves a purpose, including the detailed error-handling list, which is practically useful for agents.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with no output schema, the description is complete: it specifies the return shape, error cases, validation behavior, file-overwrite semantics, and sibling alternatives. An agent has enough information to invoke the tool correctly and anticipate failures.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 even though the description mostly restates the parameter meanings. It does add mild context (e.g., 'pass the complete new diagram source' and create_if_missing behavior), but it does not uncover anything fundamentally beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Replace') and resource ('existing PlantUML or Mermaid diagram file'), and explicitly clarifies it is a full-content replace rather than a partial edit. It differentiates itself from diagrams_create by naming the sibling tool and the create_if_missing alternative.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage guidance is explicit: it says when to use this tool, when not to, and names alternatives. The 'Use when' and 'Don't use when' examples directly instruct agents to read current content with diagrams_get first and to prefer diagrams_create for new files unless auto-creation is desired.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
7 tool updates
v0.1.0- First observed
diagrams_check_consistency - First observed
diagrams_create - First observed
diagrams_delete - First observed
diagrams_get - First observed
diagrams_list - First observed
diagrams_render - First observed
diagrams_update
TDQS
Scored across 7 tools
Each tool has a distinct action: list, create, get, update, delete, check consistency, and render. There is no overlap or ambiguity in their purposes; agents can easily select the correct tool.
All tools follow a consistent diagrams_<verb> pattern (diagrams_list, diagrams_create, diagrams_get, etc.). The naming is uniform and predictable, making it easy to infer functionality from the name.
With 7 tools, the set is well-scoped for a diagram management server: CRUD operations plus a consistency check and rendering. Each tool serves a necessary function without redundancy.
The toolset provides complete lifecycle coverage: list, create, read, update, delete, plus useful extras like consistency checking and rendering. There are no obvious gaps for the stated domain of managing PlantUML/Mermaid diagrams.
Maintenance
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
Create and edit architecture diagrams from your AI agent; get an SVG and a live editable canvas.
Create, read and live-edit visual boards, Kanban plans, Gantt timelines and diagrams with AI agents.
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
Let Claude, Cursor, or ChatGPT author Mermaid diagrams your team can read and share.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables agents to analyze codebases (local or GitHub) and automatically generate Mermaid diagrams rendered as PNG images via Kroki, providing visual understanding of project structure and flow through file discovery, reading, and diagram generation.315MIT
- AlicenseNot gradedqualityFmaintenanceEnables generating cloud architecture diagrams, flowcharts, sequence diagrams, and more using three rendering engines: mingrammer/diagrams, Mermaid, and PlantUML.3MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to read, modify, and build from architecture models, keeping the model as the source of truth for intent and synchronized with code.19114BSD 3-Clause
- AlicenseNot gradedqualityBmaintenanceEnables LLMs to draw interactive diagrams (architecture, sequence, class) inside the editor, with clickable nodes that jump to source code.6MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/mohammad-emad-dev/diagrams-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server