D2 MCP Server
Create, edit, validate, render, and export D2 diagrams with confined workspace access.
Connector by RecursiveFunctions · GitHub account verified by the MCP Registry
Install
Works with Claude Code, Codex, VS Code, Cursor, Windsurf, Claude Desktop. Read the repository before you give any tool access to your data.
npx agentmarket install connector/recursivefunctions-d2mcp
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this server can do and what it asks for, from its tool list and install config. Checked Oct 25, 2026.
- Tools
- 6 read · 7 write · 1 delete · 2 not yet classified
- Secrets
- None asked for
- Install scripts
- Not scanned yet
- Runs as
- Docker image
Tools by what they do 16
Read from the source code; the running server may list different tools.
Read 6 · Look things up without changing anything.
d2_capabilitiesd2_formatd2_get_sourced2_helpd2_oracle_get_infod2_validate
Write 7 · Create, change, send or run things.
d2_created2_oracle_created2_oracle_moved2_oracle_renamed2_oracle_setd2_saved2_update_source
Delete 1 · Delete, drop, revoke or wipe things.
d2_oracle_delete
Not yet classified 2 · We could not tell from the name and description.
d2_exportd2_oracle_serialize
Tools (16)
Read from the source code; the running server may differ. Descriptions are the server’s own words; hidden characters are shown as [U+…].
d2_capabilitiesList the embedded D2 v0.9.0 capability catalog, grouped by category. Use the returned IDs with d2_help or the returned URIs as MCP resources.
d2_createCreate a new diagram that can be edited with Oracle API tools. This is the unified way to create diagrams: 1. Empty diagram (no content): For building incrementally with Oracle API 2. From D2 text (with content): For rendering complete D2 diagrams Both types are fully editable using d2_oracle_* tools. Examples: - d2_create(id="arch") → Empty diagram for incremental building - d2_create(id="arch", content="a -> b") → Diagram from D2 text Use cases: - Building diagrams from data sources (use empty) - Rendering complete D2 text (use with content) - Converting existing D2 to editable form (use…
d2_exportd2_formatFormat valid D2 source without storing or rendering it.
d2_get_sourceReturn the complete canonical D2 source for a stored diagram, including Oracle edits.
d2_helpLook up an exact D2 v0.9.0 catalog topic by ID or search the embedded reference. Exact IDs return the full reference document; other queries return ranked topic summaries.
d2_oracle_createAdd new shapes or connections to an existing D2 diagram incrementally. Use this when you need to build diagrams piece-by-piece or add elements to a diagram after initial creation. Perfect for: iteratively building complex diagrams, adding elements based on parsed data, or modifying existing diagrams without regenerating everything. Creates basic elements only - use d2_oracle_set afterward to add special shapes (sql_table, class), styles, or properties. Example: Create 'User' shape, then set 'User.shape: person' with d2_oracle_set.
d2_oracle_deleteRemove shapes or connections from a D2 diagram. Use this when you need to: clean up unwanted elements, refactor diagram structure, or remove outdated components. Important: deleting a container shape will also delete ALL its child elements. Connections to/from deleted shapes are automatically removed. Use this carefully - consider using d2_oracle_move to relocate elements instead if you want to preserve them. Perfect for iterative diagram refinement and cleanup operations.
d2_oracle_get_infoInspect and analyze diagram elements to understand structure and properties. Use this when you need to: verify element exists before modifying, check current properties/attributes, explore container contents, debug connection issues, or understand diagram hierarchy. Info types: 'object' returns shape details (labels, styles, attributes), 'edge' returns connection properties (labels, arrows, styles), 'children' lists all elements inside a container. Essential for safe modifications - always check before changing. Returns JSON with complete element information.
d2_oracle_moveReorganize diagram structure by moving shapes between containers. Use this when you need to: group related components together, refactor diagram hierarchy, move elements into or out of systems/packages, or restructure without losing connections. Containers are shapes that hold other shapes (like 'System', 'Network', or any shape with children). Moving preserves all connections - they're automatically rerouted. Set include_descendants=false to move only the parent shape, leaving children in original location. Essential for maintaining clean, logical diagram organization.
d2_oracle_renameChange the identifier of shapes or connections while preserving all relationships. Use this when you need to: improve clarity with better names, fix typos or naming inconsistencies, refactor diagram elements, or align with updated terminology. The rename is intelligent - ALL connections referencing the old name are automatically updated to use the new name. This includes connections where the element is source, target, or part of a longer path. Child elements keep their relative names. Safe operation that maintains diagram integrity.
d2_oracle_serializeExport the current state of an Oracle-edited diagram as D2 text. Use this when you need to: see the complete D2 syntax after incremental changes, save diagram source for version control, share diagram definition with others, debug complex diagrams, or transition from Oracle API to direct D2 text editing. Returns the exact D2 code that would produce the current diagram, including all shapes, connections, special elements (sql_table, class), styles, and content. This is THE way to get the textual representation after using Oracle API tools.
d2_oracle_setModify properties of existing diagram elements. Use this when you need to: transform basic shapes into special types (sql_table, class, sequence_diagram), add visual styling (colors, fonts, borders), set labels and tooltips, or add content like markdown or code blocks. Common attributes: shape (rectangle, cylinder, person, cloud), style.fill (colors), style.stroke, label, tooltip, icon. For special shapes: 'User.shape: sql_table' then 'User.id: int |pk|' for columns, 'Animal.shape: class' then 'Animal.+name: string' for fields. For SQL table constraints: 'User.id.constraint' with value 'primar…
d2_saved2_update_sourceValidate complete D2 source and atomically replace a stored diagram. Invalid source returns diagnostics and leaves the diagram unchanged.
Show 1 more tools
d2_validateValidate D2 source and report structured syntax or semantic diagnostics. Provide exactly one of content or diagram_id. Invalid D2 returns valid=false instead of a tool error. For simple, unambiguous errors, the result may include repaired_content that has been revalidated without changing the stored diagram.
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit
- Sep 27, 2026 (1 month ago)
- Last release
- Sep 27, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- Registry name
io.github.RecursiveFunctions/d2mcp- Version
- 0.5.0
- Auth
- No auth
- Packages
- oci
ghcr.io/recursivefunctions/d2mcp:0.5.0 - License
- MIT
- Repository
- github.com/recursivefunctions/d2mcp
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
Cite this page
D2 MCP Server. Agent Mart. https://agentmart.dev/connectors/recursivefunctions-d2mcp (last updated 2026-10-24)