Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mcpServers": {
"openflowkit": {
"command": "node",
"args": ["./mcp-server/dist/index.js"]
}
}
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,22 +271,22 @@ On modern browsers (Chrome / Edge / Safari 16.4+ / Firefox 130+) OpenFlowKit enc

## 🪄 MCP Server — drive OpenFlowKit from Claude Desktop, Cursor, Windsurf

Point any MCP client at the [`@openflowkit/mcp-server`](mcp-server/) package and your AI assistant gains provider-free diagramming tools. The client already has an LLM, so OpenFlowKit MCP supplies local validation, codebase analysis, templates, icon lookup, and viewer links instead of asking for another provider key.
Point any MCP client at the [`@vrun-design/openflowkit-mcp`](mcp-server/) package and your AI assistant gains local-first diagramming tools — no API key, no cloud round-trip. Your client already has an LLM, so OpenFlowKit MCP supplies deterministic local validation, codebase analysis, templates, icon lookup, and viewer links.

```json
{
"mcpServers": {
"openflowkit": {
"command": "npx",
"args": ["-y", "@openflowkit/mcp-server"]
"args": ["-y", "@vrun-design/openflowkit-mcp"]
}
}
}
```

Then ask Claude: *"Read the OpenFlowKit DSL cheatsheet, create a checkout flow with a promo-code branch and a Stripe webhook step, validate it, and create a viewer URL."* The DSL comes back in seconds and stays editable in OpenFlowKit.

- **8 provider-free tools** — validate DSL, create viewer URLs, analyze codebases, find icon slugs, fetch starter templates, and inspect capabilities
- **8 local-first tools** — validate DSL, create viewer URLs, analyze codebases, find icon slugs, fetch starter templates, and inspect capabilities (no API key, runs on your machine)
- **5 resources** — DSL cheatsheet, template catalog, template bodies, full icon catalog, and per-provider icon catalogs
- **3 prompts** — flowchart creation, Mermaid conversion, and codebase architecture, all using the client model
- **Pure Node, zero infra cost** — runs on the user's machine, ships via npm
Expand Down Expand Up @@ -338,7 +338,7 @@ Plus: smart alignment guides, snap-to-grid, multi-select, pages, layers, section
Recently shipped (latest milestone):

- ✅ **WebCodecs H.264 MP4 export** — faster-than-realtime, hardware-accelerated, deterministic
- ✅ **MCP server** — `@openflowkit/mcp-server` for Claude Desktop, Cursor, Windsurf, any MCP client
- ✅ **MCP server** — `@vrun-design/openflowkit-mcp` for Claude Desktop, Cursor, Windsurf, any MCP client
- ✅ **Anchored layout** — pin nodes so auto-layout arranges around them
- ✅ **Ollama provider** — fully offline diagramming, no API key, no cost
- ✅ **AI self-correction loop** — bad DSL → AI sees its own output + parser error → returns corrected DSL
Expand Down Expand Up @@ -408,7 +408,7 @@ No database. No secrets. No infrastructure. One folder, or one container.
| State | Zustand |
| Storage | IndexedDB — local-first, no backend |
| Styling | Tailwind CSS |
| Agent surface | `@openflowkit/mcp-server` — Model Context Protocol stdio |
| Agent surface | `@vrun-design/openflowkit-mcp` — Model Context Protocol stdio |
| Collaboration | WebRTC P2P (opt-in, off by default) |
| i18n | react-i18next — 7 languages |
| Testing | Vitest + Playwright |
Expand Down
28 changes: 8 additions & 20 deletions docs-site/src/content/docs/github-embed.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ OpenFlowKit diagrams can be embedded in any GitHub README or Markdown file as in
The `/view` route renders any OpenFlow DSL passed as a URL parameter. You encode your diagram as a URL-safe string and link to it from your README.

```
https://openflowkit.dev/#/view?flow=BASE64_ENCODED_DSL
https://app.openflowkit.com/#/view?flow=~COMPRESSED_DSL
```

When someone clicks the link, they see the fully rendered, interactive diagram and can pan, zoom, and click **Open in Editor** to load it into the canvas for editing.
Expand Down Expand Up @@ -40,38 +40,26 @@ client -> api |HTTP|
api -> db |SQL|
```

### 2. Encode it
### 2. Create a viewer URL

In the browser console, or any JavaScript environment:
The easiest path is to use the OpenFlowKit MCP server's `create_viewer_url` tool or the editor's **Share / Embed** action. Both create a compressed, URL-safe viewer link that opens on the app domain:

```js
const dsl = `flow: "My Architecture"
direction: LR

[browser] client: Web App
[system] api: API Server
[system] db: PostgreSQL

client -> api |HTTP|
api -> db |SQL|`;

const encoded = btoa(encodeURIComponent(dsl));
console.log(encoded);
// → paste this into the URL below
```text
https://app.openflowkit.com/#/view?flow=~...
```

### 3. Embed in your README

```markdown
[![Architecture Diagram](https://openflowkit.dev/og-diagram.png)](https://openflowkit.dev/#/view?flow=PASTE_ENCODED_VALUE_HERE)
[![Architecture Diagram](https://openflowkit.com/og-diagram.png)](https://app.openflowkit.com/#/view?flow=PASTE_ENCODED_VALUE_HERE)
```

The outer image link makes GitHub show a clickable preview image. Replace `og-diagram.png` with a screenshot of your diagram for the best preview.

Or link directly without an image:

```markdown
[View Architecture Diagram →](https://openflowkit.dev/#/view?flow=PASTE_ENCODED_VALUE_HERE)
[View Architecture Diagram →](https://app.openflowkit.com/#/view?flow=PASTE_ENCODED_VALUE_HERE)
```

## Updating diagrams
Expand All @@ -82,7 +70,7 @@ For diagrams you want to iterate on frequently, store the raw DSL in a `.flow` f

```markdown
<!-- Source: ./docs/architecture.flow -->
[View Architecture →](https://openflowkit.dev/#/view?flow=...)
[View Architecture →](https://app.openflowkit.com/#/view?flow=...)
```

## Encoding helper
Expand Down
12 changes: 6 additions & 6 deletions docs-site/src/content/docs/mcp-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ title: MCP Server
description: Use the OpenFlowKit MCP server with Claude Desktop, Cursor, Windsurf, and other MCP clients.
---

The OpenFlowKit MCP server gives AI clients diagramming skills without adding another AI provider. Claude Desktop, Cursor, Windsurf, and other MCP clients already have an LLM; OpenFlowKit supplies the local tools that make that model good at diagrams.
The OpenFlowKit MCP server gives AI clients diagramming skills that run local-first — on your machine, no API key, no cloud round-trip, deterministic output. Claude Desktop, Cursor, Windsurf, and other MCP clients already have an LLM; OpenFlowKit supplies the local tools that make that model good at diagrams.

The package is `@openflowkit/mcp-server`. It runs locally over the standard MCP stdio transport.
The package is `@vrun-design/openflowkit-mcp`. It runs locally over the standard MCP stdio transport.

## Install and run

Use it directly with `npx`:

```bash
npx -y @openflowkit/mcp-server
npx -y @vrun-design/openflowkit-mcp
```

Or install it globally:

```bash
npm install -g @openflowkit/mcp-server
npm install -g @vrun-design/openflowkit-mcp
openflowkit-mcp
```

Expand All @@ -34,7 +34,7 @@ Add the server to your Claude Desktop config:
"mcpServers": {
"openflowkit": {
"command": "npx",
"args": ["-y", "@openflowkit/mcp-server"]
"args": ["-y", "@vrun-design/openflowkit-mcp"]
}
}
}
Expand All @@ -58,7 +58,7 @@ No API keys are required for MCP diagram generation.

## Tools

The current server exposes 8 provider-free tools:
The current server exposes 8 local-first tools (no API key, deterministic, run on your machine):

| Tool | What it does |
| --- | --- |
Expand Down
12 changes: 6 additions & 6 deletions mcp-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

**Give Claude Desktop, Cursor, Windsurf, or any MCP client first-class diagramming tools.**

[![npm](https://img.shields.io/npm/v/@openflowkit/mcp-server?style=flat-square&color=f97316)](https://www.npmjs.com/package/@openflowkit/mcp-server)
[![npm](https://img.shields.io/npm/v/@vrun-design/openflowkit-mcp?style=flat-square&color=f97316)](https://www.npmjs.com/package/@vrun-design/openflowkit-mcp)
[![MIT License](https://img.shields.io/badge/License-MIT-f97316.svg?style=flat-square)](https://github.com/Vrun-design/openflowkit/blob/main/LICENSE)
[![Node 18+](https://img.shields.io/badge/Node-18%2B-339933.svg?style=flat-square)](https://nodejs.org/)

</div>

---

OpenFlowKit MCP is **provider-free by design**. Your MCP client already has an LLM; the server does not rent or proxy another one.
OpenFlowKit MCP is **local-first by design** — it runs on your machine over stdio with no API key and no cloud round-trip, and its tools return deterministic output. Your MCP client already has an LLM; this server just gives it diagram-specific tools.

Instead, it gives the agent diagram-specific powers:

Expand Down Expand Up @@ -41,10 +41,10 @@ Claude: reads openflowkit://docs/dsl-cheatsheet

```bash
# No install required; npx fetches the latest published version
npx -y @openflowkit/mcp-server
npx -y @vrun-design/openflowkit-mcp

# Or install globally
npm install -g @openflowkit/mcp-server
npm install -g @vrun-design/openflowkit-mcp
openflowkit-mcp
```

Expand All @@ -64,7 +64,7 @@ Edit your Claude Desktop config:
"mcpServers": {
"openflowkit": {
"command": "npx",
"args": ["-y", "@openflowkit/mcp-server"]
"args": ["-y", "@vrun-design/openflowkit-mcp"]
}
}
}
Expand All @@ -77,7 +77,7 @@ Restart Claude Desktop. You should see **openflowkit** in the tool picker.
Point the client at the same command:

- command: `npx`
- args: `["-y", "@openflowkit/mcp-server"]`
- args: `["-y", "@vrun-design/openflowkit-mcp"]`

The server speaks the standard MCP stdio protocol. Client UIs differ, but the command shape is the same.

Expand Down
7 changes: 4 additions & 3 deletions mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "@openflowkit/mcp-server",
"version": "0.1.0",
"description": "Provider-free Model Context Protocol server for OpenFlowKit — give Claude Desktop, Cursor, Windsurf, and other MCP clients first-class diagramming tools.",
"name": "@vrun-design/openflowkit-mcp",
"version": "0.1.2",
"mcpName": "io.github.Vrun-design/openflowkit-mcp",
"description": "Local-first Model Context Protocol server for OpenFlowKit — deterministic diagramming tools (validate DSL, templates, icons, viewer links) for Claude Desktop, Cursor, Windsurf, and other MCP clients. No API key, no cloud round-trip.",
"keywords": [
"mcp",
"model-context-protocol",
Expand Down
20 changes: 20 additions & 0 deletions mcp-server/server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "io.github.Vrun-design/openflowkit-mcp",
"description": "Local-first OpenFlowKit diagramming tools for Claude, Cursor, Windsurf & other MCP clients.",
"repository": {
"url": "https://github.com/Vrun-design/openflowkit",
"source": "github"
},
"version": "0.1.2",
"packages": [
{
"registryType": "npm",
"identifier": "@vrun-design/openflowkit-mcp",
"version": "0.1.2",
"transport": {
"type": "stdio"
}
}
]
}
2 changes: 1 addition & 1 deletion mcp-server/src/lib/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Single source of truth for the version reported during MCP initialization.
// Bump together with package.json.
export const MCP_SERVER_VERSION = '0.1.0';
export const MCP_SERVER_VERSION = '0.1.2';
export const MCP_SERVER_NAME = 'openflowkit';
7 changes: 4 additions & 3 deletions mcp-server/src/lib/viewerUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
* when the prefix is absent, so old links keep working.
*
* Override the base origin with OPENFLOWKIT_APP_URL (e.g. http://localhost:5173
* for local dev). Defaults to https://openflowkit.com.
* for local dev). Defaults to https://app.openflowkit.com. The app currently
* uses hash routing, so the viewer path must live after `#/`.
*/
import { deflate } from 'pako';

const DEFAULT_APP_URL = 'https://openflowkit.com';
const DEFAULT_APP_URL = 'https://app.openflowkit.com';
const PAKO_PREFIX = '~';

function getAppBaseUrl(): string {
Expand All @@ -37,5 +38,5 @@ export function encodeDslForViewer(dsl: string): string {

/** URL that opens the DSL in OpenFlowKit's read-only viewer. */
export function buildViewerUrl(dsl: string): string {
return `${getAppBaseUrl()}/view?flow=${encodeDslForViewer(dsl)}`;
return `${getAppBaseUrl()}/#/view?flow=${encodeDslForViewer(dsl)}`;
}
2 changes: 1 addition & 1 deletion mcp-server/src/tools/discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function registerDiscoveryTools(server: McpServer): void {
{
name: MCP_SERVER_NAME,
version: MCP_SERVER_VERSION,
providerFree: true,
localFirst: true,
tools: [
'validate_openflow_dsl',
'analyze_codebase',
Expand Down
2 changes: 1 addition & 1 deletion mcp-server/tests/viewerUrl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('buildViewerUrl', () => {
it('encodes DSL into the OpenFlowKit viewer URL with pako compression', () => {
const dsl = 'flow: Hello\n[start] s\n[end] e\ns -> e';
const url = buildViewerUrl(dsl);
expect(url).toMatch(/^https:\/\/openflowkit\.com\/view\?flow=~/);
expect(url).toMatch(/^https:\/\/app\.openflowkit\.com\/#\/view\?flow=~/);

const encoded = url.split('flow=')[1]!;
expect(encoded.startsWith('~')).toBe(true);
Expand Down
72 changes: 66 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading