Mermaid ER Server
БесплатноНе проверенParses Mermaid ER diagrams to create PostgreSQL tables and automatically generates REST and GraphQL CRUD APIs.
Описание
Parses Mermaid ER diagrams to create PostgreSQL tables and automatically generates REST and GraphQL CRUD APIs.
README
An open-source Model Context Protocol (MCP) server that parses Mermaid ER diagrams, creates PostgreSQL database tables, and exposes automatic REST/GraphQL CRUD APIs.
Features
- 🔍 Parse Mermaid ER Diagrams - Extract entities, attributes, and relationships
- 🗄️ Auto-Create PostgreSQL Tables - Generate DDL and execute against your database
- 🚀 REST API Generation - Automatic CRUD endpoints for all entities
- 📊 GraphQL API Generation - Type-safe queries and mutations
- 🔑 Key Detection - Identifies PK, FK, and UK constraints
- ⚙️ Configurable - Environment variables for database and API settings
Installation
git clone https://github.com/yourusername/mcp-mermaid-er-server.git
cd mcp-mermaid-er-server
npm install
npm run build
Configuration
Create a .env file (copy from .env.example):
# Mermaid Source
MERMAID_DIAGRAM_PATH=./examples/sample-er.mmd
# Database (PostgreSQL)
DB_HOST=localhost
DB_PORT=5432
DB_NAME=mydb
DB_USER=postgres
DB_PASSWORD=password
# API Server
API_TYPE=rest # rest, graphql, or both
API_PORT=3000
API_HOST=0.0.0.0
Claude Desktop Integration
Add to claude_desktop_config.json:
{
"mcpServers": {
"mermaid-er": {
"command": "node",
"args": ["/path/to/mcp-tools/dist/index.js"],
"env": {
"MERMAID_DIAGRAM_PATH": "/path/to/your/diagram.mmd",
"DB_HOST": "localhost",
"DB_NAME": "mydb",
"DB_USER": "postgres",
"DB_PASSWORD": "password"
}
}
}
}
Available MCP Tools (12 Total)
Parsing Tools
| Tool | Description |
|---|---|
parse_er_diagram |
Parse ER diagram, return full schema |
list_entities |
List all entity names |
get_entity_details |
Get attributes for an entity |
get_relationships |
Get all relationships |
validate_diagram |
Validate diagram syntax |
Database Tools
| Tool | Description |
|---|---|
test_connection |
Test PostgreSQL connection |
generate_sql |
Generate DDL without executing |
create_schema |
Create tables in database |
drop_schema |
Drop all tables (requires confirmation) |
API Tools
| Tool | Description |
|---|---|
start_api_server |
Start REST/GraphQL server |
stop_api_server |
Stop the API server |
get_api_endpoints |
List all endpoints |
Workflow Example
- Parse your ER diagram →
parse_er_diagram - Review the SQL →
generate_sql - Create database tables →
create_schema - Start the API server →
start_api_server - Use the auto-generated endpoints!
API Endpoints
REST (when API_TYPE=rest or both)
GET /api/{entity} - List all records
GET /api/{entity}/:id - Get by ID
POST /api/{entity} - Create record
PUT /api/{entity}/:id - Update record
DELETE /api/{entity}/:id - Delete record
GraphQL (when API_TYPE=graphql or both)
# Queries
query { customers { customer_id email } }
query { customer(id: "1") { email } }
# Mutations
mutation { createCustomer(input: { email: "[email protected]" }) { customer_id } }
mutation { updateCustomer(id: "1", input: { email: "[email protected]" }) { email } }
mutation { deleteCustomer(id: "1") { customer_id } }
Supported ER Syntax
erDiagram
CUSTOMER {
int customer_id PK "Primary key"
string email UK "Unique email"
string name
}
ORDER {
int order_id PK
int customer_id FK
datetime order_date
}
CUSTOMER ||--o{ ORDER : "places"
Development
npm run dev # Run with ts-node
npm run build # Compile TypeScript
npm test # Run tests
License
MIT License - see LICENSE
Установка Mermaid ER Server
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/dixitayush/mcp-apiFAQ
Mermaid ER Server MCP бесплатный?
Да, Mermaid ER Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Mermaid ER Server?
Нет, Mermaid ER Server работает без API-ключей и переменных окружения.
Mermaid ER Server — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Mermaid ER Server в Claude Desktop, Claude Code или Cursor?
Открой Mermaid ER Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Mermaid ER Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
