liz-whiteboard-mcp
Enables AI agents to read and edit entity-relationship diagrams and SQL database schemas on the liz-whiteboard collaborative whiteboard through natural language, supporting table, column, and relationship management.
README
liz-whiteboard-mcp — MCP Server for ER Diagrams & Database Schema Editing (Go, OAuth 2.1)
A Model Context Protocol (MCP) server that lets AI agents — Claude, Cursor, VS Code, Claude Code — read and edit entity-relationship (ER) diagrams and SQL database schemas in liz-whiteboard. Written in Go, it serves the Streamable HTTP transport and authenticates clients with OAuth 2.1 (PKCE + JWKS).
This is the AI integration layer for liz-whiteboard, the open-source collaborative ER diagram and database schema designer. Connect any MCP-compatible AI client and design databases conversationally — "add a users table with a one-to-many relationship to orders" — and watch the changes appear live on the whiteboard. Compiles to a single self-contained binary (pure Go, no cgo, no Node/Bun runtime).
Table of contents
- What it does
- The 17 MCP tools
- How it works
- Quick start (local, dev token)
- Deploy with Docker (single domain)
- Connect an MCP client (OAuth)
- Configuration
- Project layout
- Testing
- License
What it does
Exposes the liz-whiteboard ER diagram as MCP tools so an LLM agent can:
- Discover — list the user's projects and whiteboards.
- Read — load a whiteboard's full diagram (tables, columns, relationships, positions) or a compact text schema summary.
- Write — create / update / delete tables, columns, and relationships; reorder columns; bulk-move tables.
Reads go straight to the app's SQLite database; writes are sent to the live collaboration server over Socket.IO and broadcast to every connected user in real time. Every request is scoped to the authenticated user (project-membership checks).
The 17 MCP tools
| Group | Tools |
|---|---|
| Discovery | list_projects, list_whiteboards |
| Read | get_board, get_schema_summary |
| Tables | create_table, update_table, delete_table |
| Columns | create_column, update_column, delete_column, reorder_columns |
| Relationships | create_relationship, update_relationship, delete_relationship |
| Positions | bulk_update_positions |
| Static | list_data_types (25), list_cardinalities (17) |
How it works
AI client (Claude / Cursor)
│ OAuth 2.1 (PKCE) → access token (RS256 JWT)
▼
liz-whiteboard-mcp ── OAuth 2.0 Resource Server (RFC 9728 + RFC 8707) ──
│ • validates the JWT via the AS's JWKS (iss / aud / exp / signature)
│ • resolves identity per request (sub = User.id), checks project access
├── reads → SQLite (data/app.db)
└── writes → Socket.IO collaboration server
(authenticated with a separate collab-audience JWT —
the client's token is never passed through)
- Transport: MCP Streamable HTTP (
POST /mcp). - AuthN/Z: OAuth 2.1 Resource Server. Serves Protected Resource Metadata at
/.well-known/oauth-protected-resource, returns401+WWW-Authenticatefor unauthenticated requests, and validates audience-bound RS256 tokens issued by the liz-whiteboard Authorization Server. - No token passthrough: writes use a distinct collaboration token (avoids the OAuth "confused deputy" problem).
Quick start (local, dev token)
Requirements: Go 1.25+.
make build # → ./liz-whiteboard-mcp (or: go build ./cmd/mcp/)
# Run with the DEV-ONLY stub verifier (skips the full OAuth flow for local testing).
# NEVER set MCP_DEV_AUTH in production.
DATABASE_URL="file:/absolute/path/to/liz-whiteboard/data/app.db" \
MCP_DEV_AUTH=stub \
MCP_DEV_STUB_TOKEN="dev-token" \
MCP_DEV_USER_ID="<a-real-user-uuid>" \
LIZ_SOCKET_URL="ws://localhost:3010" \
./liz-whiteboard-mcp
# → serves http://127.0.0.1:3011/mcp
Then call it with Authorization: Bearer dev-token. Without MCP_DEV_AUTH=stub, the server runs in production mode and requires real OAuth (see below).
Deploy with Docker (single domain)
The repo ships a Docker Compose stack that runs the app + Authorization Server + this MCP server behind one reverse proxy (Caddy) — so clients use a single origin, no separate ports:
http://localhost:8080/ → liz-whiteboard app + OAuth (/authorize, /token, JWKS)
http://localhost:8080/mcp → this MCP server
bash deploy/run.sh # provisions a persistent signing key + secret, then docker compose up
See docker-compose.yml and deploy/Caddyfile. The Go server itself builds to a tiny distroless image via the Dockerfile.
Connect an MCP client (OAuth)
Point an MCP client (Claude Desktop, Claude Code, Cursor, VS Code) at the server URL (e.g. https://your-domain/mcp). The client performs the standard MCP OAuth flow automatically:
- Calls
/mcp, gets401+ the Protected Resource Metadata URL. - Discovers the Authorization Server, runs the browser authorize → consent → token flow (PKCE).
- Retries
/mcpwith the bearer token.
No API keys or copied cookies required.
Configuration
| Variable | Description |
|---|---|
DATABASE_URL |
SQLite file — the same data/app.db the app uses (e.g. file:/abs/path/data/app.db). |
MCP_LISTEN_ADDR |
Listen address (default 127.0.0.1:3011). |
OAUTH_ISSUER |
Public issuer URL of the Authorization Server; validated in the token iss claim. |
MCP_RESOURCE_URI |
Canonical public URI of this server (e.g. https://your-domain/mcp); the expected token aud. |
OAUTH_JWKS_URL |
Optional — fetch JWKS from an internal address while OAUTH_ISSUER stays public (reverse-proxy / split-horizon). Defaults to {issuer}/.well-known/jwks.json. |
LIZ_SOCKET_URL |
Collaboration Socket.IO server URL (write path), e.g. ws://localhost:3010. |
MCP_CLIENT_SECRET |
Confidential-client secret used to mint collaboration tokens from the AS. |
COLLAB_TOKEN_URL / COLLAB_RESOURCE_URI |
AS collab-token endpoint and the collaboration token audience. |
MCP_DEV_AUTH, MCP_DEV_STUB_TOKEN, MCP_DEV_USER_ID |
Dev only — enable the stub verifier. Never set in production. |
Project layout
cmd/mcp/main.go # entrypoint: HTTP transport, OAuth wiring, tool registration
internal/auth # OAuth Resource Server: JWKS verifier, per-request identity, project scoping
internal/db # SQLite connection (database/sql + modernc.org/sqlite, no cgo)
internal/data # raw-SQL read layer
internal/socket # Socket.IO write path + collab-token client
internal/tools # the 17 MCP tool handlers
internal/errors # error taxonomy + token redaction
internal/{positioning,schema,summary} # helpers
Testing
make test # unit tests (no database required)
# Integration tests against a real SQLite database:
make test-integration DATABASE_URL=file:/abs/path/to/liz-whiteboard/data/app.db
License
MIT © LizardLiang
Keywords: Model Context Protocol server, MCP server Go, MCP server example, OAuth 2.1 resource server, JWKS, PKCE, RFC 9728, RFC 8707, AI database design, ER diagram MCP, SQL schema MCP tools, Claude MCP server, Cursor MCP, Claude Code, Socket.IO, SQLite, modernc, self-hosted MCP, streamable HTTP MCP.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。