Skip to main content
Glama

Mefagram

Diagrams your AI agent can edit. You explore them, and talk back.

A local MCP workspace for Claude Code, Codex and any MCP client: your agent maps workflows, plans and codebases; you read them in the browser, comment on any step, and the agent updates the map.

npm version npm downloads CI License: MIT Node.js 24+

Quick start · How it works · Features · Agent guide · npm

Why Mefagram

Long chats produce great plans, architecture sketches and checklists, and then they scroll away. Diagram tools are built for people drawing by hand, not for agents. Mermaid in a chat is a snapshot nobody can iterate on.

Mefagram is the missing piece in between: a persistent, structured diagram store that agents write through MCP and people read in the browser, with a feedback loop in both directions. It runs entirely on your machine, with no account, API key or cloud service.

Related MCP server: omni-flow

Quick start

You need Node.js 24+.

Claude Code: install the plugin. It adds the MCP server and skills to map a process, map your codebase and handle your comments.

/plugin marketplace add berkinduz/mefagram
/plugin install mefagram@mefagram

Codex: the CLI, the IDE extension and the ChatGPT app share this setting.

codex mcp add mefagram -- npx -y mefagram mcp

Any other MCP client: run npx -y mefagram mcp as a stdio server, or connect over HTTP to http://127.0.0.1:4747/api/mcp.

The agent starts the workspace when it needs it. Open it yourself with npx mefagram open, then try:

Map how a request flows through this repo, with links to the code.

How it works

This diagram was exported by Mefagram itself (export_diagram with format: "svg").

Features

Feature

What it does

Ask, don't draw

Agents create maps from Mermaid, which they already write fluently, then add descriptions, notes, sources and code links with atomic edits.

Talk back

Comment on any node or diagram. The agent reads it with get_feedback, changes the map and replies in the thread. It can ask you questions too.

Shared context

get_current_view tells the agent what you have open, so "expand this step" just works.

Live

Changes stream into the browser as they are saved, and the nodes the agent touched light up.

Jump to the code

Codebase maps link each step to its file and line, opening in VS Code, Cursor, Windsurf or Zed.

Readable at any size

Phases collapse into an overview; open one for its steps. Map or list view, search, revision history and restore.

Safe for agents

Optimistic revisions, retry-safe mutation IDs and validation mean concurrent agents never overwrite each other.

Portable

Export Mermaid for pull requests, standalone SVG for docs, or lossless JSON you can commit and re-import.

Local and private

One workspace on your machine, shared by all your agents. Only requests from this computer are accepted.

Tools for agents

Tool

Purpose

create_diagram_from_mermaid

Create a map from a Mermaid flowchart (subgraphs become phases)

get_diagram · list_diagrams

Read a map; search maps, optionally within a project

update_diagram

Add, change or remove nodes and connections atomically

get_current_view

The diagram, phase and node the developer has open

get_feedback · resolve_feedback · ask_developer

The comment loop between developer and agent

export_diagram

JSON, Mermaid or SVG

get_diagram_history · restore_diagram

Revision history and restore

Every result includes a viewUrl the agent can hand you. Details, examples and conventions are in the agent guide.

Command line

Command

What it does

npx mefagram mcp

MCP over stdio; starts the workspace if needed

npx mefagram open [id]

Open the workspace in your browser

npx mefagram start · stop · status

Run it yourself (--background to detach, --port to move it)

npx mefagram export docs/diagrams --project my-repo

Write a project's maps as .mefagram.json, .mmd and .svg

npx mefagram import <file>

Import a JSON export or a Mermaid file

Data lives in ~/.mefagram. Stop the workspace and copy that folder to back it up.

Privacy and security

Mefagram has no accounts, so the loopback interface is its boundary. It listens on 127.0.0.1:4747 and refuses requests addressed to any other host (blocking DNS rebinding) or sent by another website. Don't expose the port through a tunnel or proxy. Diagram content is treated as data, never as instructions to the agent. See SECURITY.md.

Run from source

git clone https://github.com/berkinduz/mefagram.git
cd mefagram
npm ci
npm run setup -- --example newsletter
npm run build
npm start

Connect agents with node /path/to/mefagram/bin/mefagram.mjs mcp. Inside the repository, Claude Code and Codex pick up the bundled .mcp.json and .codex/config.toml. See installation and backup and contributing.

License

MIT. Third-party notices are in NOTICE.md.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to create, edit, and export flowcharts through a local web-based editor with visual drag-and-drop, real-time sync, and 14 MCP tools for full node/edge CRUD.
      2
      Apache 2.0
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables agents to create, customize, analyze and export relationship diagrams — theorem dependencies, paper maps, task RACI, org charts, conversation graphs — through 25 MCP tools, with cycle detection, centrality bottleneck reports, dependency closure and Mermaid/DOT/Markdown/JSON interop. Graphs stay local-first in a diff-friendly JSON source of truth and can be refined on a visual canvas.
      1
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to explore and extend a local-first, SQLite-backed visual knowledge graph through 12 tools for listing maps, searching and reading nodes, and creating, updating, or linking nodes and edges. Every AI-written node carries provenance and is checked against near-duplicate titles, so agent-added ideas appear in a shared graph that people also edit by hand.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables MCP-capable agents to read, create, modify, align, distribute, organize and export local-first infinite whiteboard content, including sticky notes, text, shapes, arrows, ink, mind maps, images, files and links across multiple pages. Provides 16 tools over stdio or Streamable HTTP, plus resources and prompts, with version-conflict protection and audit trails so canvas edits never silently overwrite newer content.
      16
      27
      MIT