CodePic

io.github.abelcePublished by GitHub account abelcev1.0.0Updated Nov 2, 2026

AI agent draws editable hand-drawn diagrams (flowchart, ER, architecture) via MCP, not static images

VerifiedStreamable HTTPWeb executableProductivity & WorkflowMedia & Design

Overview

AI-generated overview

CodePic lets an AI assistant create and edit hand-drawn style diagrams (flowcharts, ER, architecture) in a hosted editor, returning shareable view and edit…

What you can do
  • Create diagrams from a described set of nodes and edges, or from a predefined template
  • Inspect an existing diagram's elements, IDs, positions and parent-child relationships
  • Update a diagram by renaming it, replacing all nodes and edges, or adding and removing individual ones
  • Look up shape metadata and full shape documentation to plan layouts and containers
  • List available templates when the user asks to browse or pick one
When to use it
Useful when you want an assistant to turn a described system, data model, sequence flow or pipeline into an editable diagram you can keep adjusting, rather than a static image or Mermaid snippet. Also fits iterating on diagrams already stored in CodePic.
Requirements
Remote Streamable HTTP endpoint; no local install. Requires a CodePic account and an API key (cpk_... token) sent as a Bearer token in the Authorization header. Works with any MCP client that supports remote Streamable HTTP.
Before you install
The API key is a secret placed in client config files; keep it out of shared repositories. Creating and updating diagrams writes data to your CodePic account, and created diagrams get public view URLs, so check what content becomes shareable.

Installation

In SourceWeft

  1. Open CodePic in the dashboard and add it to a workspace.
  2. Connect Authorization token credentials. They are stored privately and never shown on public pages.
  3. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.abelce%2Fcodepic/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "codepic": {
      "type": "http",
      "url": "https://codepic.cc/api/mcp/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

CodePic MCP

Let your AI coding agent draw editable diagrams — not another Mermaid snippet you have to paste.

[Server] [Website] [License]

Generate editable hand-drawn diagrams from Cursor, Claude Desktop, and other MCP clients.

CodePic MCP lets an AI coding agent create diagrams directly in CodePic instead of returning static images, Mermaid snippets, or JSON that you have to paste manually. The result opens in the CodePic editor, where you can still move shapes, edit labels, adjust connectors, share a read-only link, and export PNG or JSON.

Quick Start

It's a remote Streamable HTTP server — no local install. First create a free API key (the cpk_... token) at https://codepic.cc/settings/api-keys (sign in → New API key → copy), then add the config for your client and replace cpk_your_api_key_here.

Cursor

Create .cursor/mcp.json in your project:

json
{  "mcpServers": {    "codepic": {      "url": "https://codepic.cc/api/mcp/mcp",      "headers": {        "Authorization": "Bearer cpk_your_api_key_here"      }    }  }}

Claude Code

Add it with one command:

bash
claude mcp add --transport http codepic https://codepic.cc/api/mcp/mcp \  --header "Authorization: Bearer cpk_your_api_key_here"

Claude Desktop

Add CodePic to your claude_desktop_config.json:

json
{  "mcpServers": {    "codepic": {      "type": "streamableHttp",      "url": "https://codepic.cc/api/mcp/mcp",      "headers": {        "Authorization": "Bearer cpk_your_api_key_here"      }    }  }}

VS Code (GitHub Copilot)

Add CodePic to .vscode/mcp.json:

json
{  "servers": {    "codepic": {      "type": "http",      "url": "https://codepic.cc/api/mcp/mcp",      "headers": {        "Authorization": "Bearer cpk_your_api_key_here"      }    }  }}

Codex CLI

Add CodePic to ~/.codex/config.toml:

toml
[mcp_servers.codepic]url = "https://codepic.cc/api/mcp/mcp"
[mcp_servers.codepic.headers]Authorization = "Bearer cpk_your_api_key_here"

Windsurf

Add CodePic to ~/.codeium/windsurf/mcp_config.json:

json
{  "mcpServers": {    "codepic": {      "serverUrl": "https://codepic.cc/api/mcp/mcp",      "headers": {        "Authorization": "Bearer cpk_your_api_key_here"      }    }  }}

Cline

Open Cline's MCP settings (cline_mcp_settings.json) and add:

json
{  "mcpServers": {    "codepic": {      "type": "streamableHttp",      "url": "https://codepic.cc/api/mcp/mcp",      "headers": {        "Authorization": "Bearer cpk_your_api_key_here"      }    }  }}

Other clients

Any MCP client that supports remote Streamable HTTP works — point it at the endpoint https://codepic.cc/api/mcp/mcp with header Authorization: Bearer cpk_....

Available MCP Tools

  • list_templates - list available diagram templates.
  • create_from_template - create a new diagram from a template.
  • create_diagram - create a custom diagram with nodes and edges.
  • get_diagram - fetch the current diagram structure by documentId before making targeted follow-up edits.
  • update_diagram - update an existing diagram by replacing, adding, or removing nodes and edges.

Iterate on an Existing Diagram

Use get_diagram when you already have a CodePic document and want the AI agent to inspect it before changing it. This keeps the workflow grounded in the current diagram instead of guessing from memory.

Example prompt:

text
Use get_diagram to inspect document <documentId>, then update the diagram by adding a Redis cache between the API server and Postgres database.

Examples

ExampleWhat It GeneratesPrompt
System architectureNext.js SaaS architecture diagramNext.js + Supabase + Postgres + R2 + Stripe + Vercel
Database ER diagramSaaS billing data modelUsers, teams, subscriptions, invoices, payments
OAuth sequence flowPKCE login sequence diagramBrowser, app server, identity provider, database
CI/CD pipelineGitHub Actions deployment pipelineType-check, lint, build, preview, production
Data pipelineAnalytics pipeline diagramSegment, Snowflake, dbt, Metabase
Iterate existing diagramRead an existing document, then update itget_diagram + update_diagram

Useful Links

Community Post Angle

If you share this project, lead with the workflow:

I connected Cursor to a diagram editor through MCP, so it can generate editable architecture diagrams instead of Mermaid text.

Avoid generic product claims like "best diagram tool". Developer communities respond better to a concrete workflow and real examples.

License

MIT — see LICENSE.

Source: README.md at commit 31b01b9

Tools

7

get_shape_docs

Get Shape Docs

Return the full CodePic shape reference — all element types, their fields, data payloads, and JSON examples. Call get_shape_catalog first for concise shape selection and container capabilities; use this tool when you need complete fields or type-specific data (e.g. select options, triangle direction, callout tail). No authentication required.

Takes no parameters.

get_shape_catalog

Get Shape Catalog

Return compact machine-readable shape metadata for planning a diagram: semantic tags, geometry family, container support, recommended padding, default size, and MCP availability. Use this before create_diagram when choosing shapes or containers. Unlike get_shape_docs, this tool is concise and filterable.

ParameterstagcategorycontainerMode

list_templates

List Templates

List all available CodePic diagram templates. Use this ONLY when the user has explicitly asked to browse, list, or pick from templates (e.g. "show me templates", "列出模板"). Do NOT call this as a preparatory step when the user just described a diagram they want — in that case go straight to `create_diagram`. Discovering slugs here is only meaningful before a user-confirmed `create_from_template` call.

Parameterscategory

create_from_template

Create from Template

Create a new CodePic diagram from a predefined template. Requires API Key authentication. Returns a public view URL and edit URL. **STRICT USAGE RULE — READ BEFORE CALLING:** Only call this tool when the user has **explicitly** asked to use a template. Explicit signals include phrases like: "use a template", "from template", "用模板", "从模板创建", "list templates and pick one", or the user directly naming/selecting a template slug. If the user merely describes a diagram they want (e.g. "draw an A/B test flowchart", "帮我画一个登录流程", "给我做一个系统架构图"), **DO NOT** call this tool. Call `create_diagram` instead and build the diagram from the user's description. Never silently substitute a template for a described diagram — the user will get a generic result that does not match what they asked for. When responding to the user, present the returned URL as a clickable markdown link (e.g. `[Open in CodePic →](URL)`) so the user can click it directly in their AI client (Cursor / Claude / etc.).

Parametersnameslugrequiredlocale

create_diagram

Create Diagram

Create a custom CodePic hand-drawn style diagram by specifying nodes and edges. Requires API Key authentication. Returns a public view URL. **THIS IS THE DEFAULT TOOL FOR ANY USER-DESCRIBED DIAGRAM.** Whenever the user describes a diagram they want ("draw an A/B test flowchart", "帮我画一个登录流程", "a system architecture with a load balancer and 3 servers", etc.), build it here from their description. Do NOT fall back to `create_from_template` / `list_templates` unless the user explicitly asked for a template. When responding to the user, present the returned URL as a clickable markdown link (e.g. `[Open in CodePic →](URL)`) so the user can click it directly in their AI client (Cursor / Claude / etc.). **Container nesting (IMPORTANT — use whenever possible):** - Set `parentId` on a node to nest it inside another node. ANY node type can be a container. - The parent automatically becomes draggable-as-a-group and users can keep dropping elements into it. - Call `get_shape_catalog` with tag `container-capable` to choose among native structural containers and adaptive semantic shapes such as rectangles, circles, ellipses, diamonds, cylinders, and hexagons. - Parent bounds are expanded automatically using the selected shape's title and outline safe area. - Use absolute canvas coordinates for all nodes — child coordinates are auto-converted to parent-relative. - Set node `name`, `description`, and `tags` when later MCP/Agent reads need stable business semantics beyond visible text. - **Rule**: whenever 2+ nodes logically belong to the same module / component / region, create a container node first and set `parentId` on each child. **Design tips for beautiful diagrams:** - Use semantic types: `button-primary` for CTA buttons (auto blue), `diamond` for decisions - Pick a color palette and apply it consistently — light fill + darker stroke of the same hue: • Blue: fillColor #e3f2fd / #bbdefb, strokeColor #1565c0, fontColor #1565c0 (or #ffffff on dark fill) • Green: fillCo

ParametersnamerequirededgesnodesrequiredbackgroundColor

get_diagram

Get Diagram

Fetch the current state of an existing CodePic diagram. Returns a compact summary of all elements with their IDs, types, positions, and parent-child relationships. Use this before update_diagram when you need to: add nested children to existing containers, make targeted edits to specific elements, or understand the current structure. Requires API Key authentication.

ParametersdocumentIdrequired

update_diagram

Update Diagram

Update an existing CodePic diagram. You can rename it, replace all nodes/edges, or add/remove individual nodes and edges. Requires API Key authentication. When responding to the user, present the returned URL as a clickable markdown link (e.g. `[Open in CodePic →](URL)`) so the user can click it directly in their AI client (Cursor / Claude / etc.).

ParametersnameedgesnodesaddEdgesaddNodesdocumentIdrequiredremoveEdgeIdsremoveNodeIdsbackgroundColor

Version history

1
  1. v1.0.0LatestSep 16, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts