mcpcodepicaidiagramguidetutorial

Getting the Most Out of CodePic MCP: A Practical Guide

Master CodePic MCP with this in-depth guide covering prompting techniques, tool usage, and real-world scenarios for creating diagrams with AI.

CodePic TeamPublished on 2026-03-298 min read

Getting the Most Out of CodePic MCP: A Practical Guide

Introduction

You probably saw the announcement that CodePic now supports MCP. But knowing it works and knowing how to use it well are two different things.

Before MCP, even if you carefully described a system architecture in an AI conversation, the AI could only give you Mermaid code or a plain-text layout. You still had to copy, paste, and manually assemble the diagram. That's changed — the AI can now directly interact with CodePic, call its tools, and create or edit diagrams without ever leaving the conversation.

MCP (Model Context Protocol) lets the AI call CodePic's tools directly, rather than just outputting code.

But here's the key point: MCP doesn't change what the AI can do — it changes how you describe what you need.

A vague prompt gets you a vague diagram, even with MCP. Get the prompt right, and the whole process becomes surprisingly smooth. That's what this guide covers.

I. Quick Setup Recap

Assuming you've already connected CodePic MCP to Cursor or Claude Desktop (if not, see this guide), your AI now has access to CodePic's four core tools.

The rest is about using them well.

II. How to Describe What You Want

This is the part most people skip. When someone complains "the AI drew my diagram wrong," the problem is almost always an imprecise prompt.

Compare these two:

Vague:

"Draw me an e-commerce system architecture diagram"

Precise:

"Draw an e-commerce system architecture diagram with: a client layer (Web, App), a gateway and auth layer, a core services layer (User Service, Product Service, Order Service, Payment Service), and a data layer (MySQL, Redis, Elasticsearch). Use arrows to show service-to-service calls. Highlight the interaction between Payment Service and Order Service."

The difference:

  • Specific component list — the AI knows what to draw
  • Layer relationships — the AI knows how to organize it
  • What to emphasize — the AI knows where to focus

This isn't a CodePic-specific issue — it's how working with AI works in general. It just shows up more clearly with diagrams.

Recommended prompt structure:

1. Specify the diagram type: system architecture / flowchart / mind map / sequence diagram
2. List the main elements: use bullet points or numbered items
3. Describe relationships: what connects to what, and how (calls, inherits, contains)
4. Call out the focus: what's most important, what needs special emphasis
5. Add constraints: layout preferences, color scheme (optional)

A complete example:

I want to draw an architecture diagram for an e-commerce recommendation system.

Main components:
- Client: Web app, Mobile app
- Recommendation engine: real-time recommendations, offline recommendations
- Feature processing service: user features, product features, contextual features
- ML model service: collaborative filtering model, deep learning model
- Data storage: feature store (Redis), model store (S3), user behavior database (MySQL)
- Logging system: behavior logs, recommendation logs

User interaction flow:
User opens app → triggers recommendation engine → feature processing service extracts features → calls ML model service for inference → returns recommendations → user behavior logged

Emphasis: the interaction between feature processing and model inference is the system bottleneck — mark it with a thick arrow.

Color coding: client layer (blue), core services (green), storage layer (gray).

Notice how the first three framework steps are all accounted for, in a clear order the AI can follow. That's what a high-quality prompt looks like.

III. The Four Tools in Practice

1. list_templates

Lists available templates. If you're not sure where to start, check what's already there.

Example prompt:
"Use list_templates to see what flowchart templates are available, then recommend one for mapping out a user journey"

2. create_from_template

Start from a template and customize. This is the fastest way to get going.

Example:

"Use the e-commerce flowchart template and adapt it to this purchase flow:
Open app → Browse products → Select item → Add to cart → Go to checkout → Choose address → Choose payment method → Confirm payment → Order complete"

The AI starts from the template and adjusts it to your flow. Much faster than starting from scratch.

3. create_diagram

Create a diagram from nothing. Use this when no template fits.

Example:

"Create a microservices architecture diagram with:
- UI layer: Web, Mobile
- API gateway layer: Spring Cloud Gateway
- Microservices layer: User Service, Product Service, Order Service, Payment Service
- Data layer: PostgreSQL, Redis, Kafka
Use arrows to show data flow, dashed lines for async messaging"

4. update_diagram

Edit and extend an existing diagram. This is how iteration works.

Example:

The base diagram already exists. Now say:
"Add a Saga orchestrator between Order Service and Payment Service, use dashed arrows to show async call flow"

Or:
"Replace Redis in the data layer with Elasticsearch, and add a message queue component"

The power of update_diagram is that you don't have to re-describe the whole thing — just say what to change.

IV. Three Real Scenarios

Scenario 1: Describing a System Architecture in Plain Language

You're working on a technical design and need an architecture diagram ready for review.

Your prompt:

Create an architecture diagram for a data processing pipeline:

System flow:
1. Data source layer: databases, APIs, file uploads
2. Ingestion layer: Kafka topics (separated by data source)
3. Processing layer:
   - Real-time: Spark Streaming
   - Batch: Spark Batch
4. Storage layer:
   - Hot data: Elasticsearch
   - Cold data: S3
5. Application layer: BI Dashboard, reporting system, data science platform

Use colors to distinguish layers, arrows to show data flow

Result: The AI generates a visual architecture diagram directly in CodePic. No manual Mermaid tweaking — open the link and you'll see the diagram. Not happy with it? Tell the AI what to change.

Scenario 2: From Requirements Doc to Flowchart

A PM wrote up a user login flow spec. You need to turn it into a diagram.

The spec:

User login flow:
1. User enters email and password
2. System validates email format and password strength
3. If validation fails, return error message
4. If validation passes, check if user exists
5. If user doesn't exist, create new account
6. If user exists and has 2FA enabled, send verification code
7. User enters verification code
8. Verify code — success issues token, failure allows retry (max 3 attempts)
9. Login successful, redirect to homepage

Your prompt:

Based on this spec, create a standard flowchart in CodePic:
[paste spec here]

Use diamonds for decision points, rectangles for actions, make sure all branches are clearly visible

Result: The AI converts the spec into a visual flowchart, with all branching logic laid out clearly. Requirements changed? Update the prompt and regenerate.

Scenario 3: Iterating on an Existing Diagram

You have a preliminary system design diagram and now want to add error handling and monitoring.

Your prompt:

Update the current order processing diagram with the following:
1. Add a "retry queue" component on the payment failure path
2. Connect all services to a central Observability platform with a "monitoring" link
3. Add a "logging system" next to the orders database
4. Use dashed lines for monitoring and logging connections

Keep the main flow intact — these are additions only

Result: The AI preserves the original diagram's core structure and adds the new components exactly where specified. Iteration feels like a conversation.

V. Where AI Still Falls Short

CodePic MCP has a few real limitations right now:

Problem 1: Highly complex dependency graphs If your system has 20+ services with dense cross-calls, the AI may produce a cluttered diagram. Break it into layers or multiple separate diagrams instead.

Problem 2: Precise layout control If you need a specific component in a specific position ("this element must be on the left"), the AI likely can't guarantee that. CodePic's auto-layout has limits.

Problem 3: Non-standard diagram types If you want a fully custom diagram mixing unusual symbol types, the AI may struggle. Stick to standard architecture diagrams, flowcharts, and mind maps for reliable results.

When things go wrong:

The AI sometimes misses a component or draws a relationship incorrectly. The fix is simple — just point it out:

"You missed a caching layer — add it between the database and application services"

or

"Payment Service shouldn't connect directly to the user database — there needs to be an API in between"

The AI will correct it. You don't need to re-describe the whole diagram — just state the difference.

VI. Go Try It

Head to codepic.cc, connect your Cursor or Claude Desktop, and describe the diagram you want. See how the AI interprets it.

The first result might not be perfect. Iterate two or three times, and you'll find that diagramming can move this fast.

Key takeaways:

  • Precise descriptions produce precise diagrams
  • Starting from a template is faster than starting from scratch
  • update_diagram is how you iterate — one change at a time
  • When the AI gets something wrong, correct it directly and move on

Go try it.

Related Posts