Skip to main content
Glama

sqemo-mcp

npm version npm downloads MCP Registry Node License: MIT

MCP server for Sqemo — AI agents that follow your team's database naming standard.

Your agent models in business terms ("Customer Number"); the column comes out as cust_no because your word list says customer → cust, number → no (case and delimiter are rules too, so CUST_NO is one setting away). Same input, same name, every table, every agent. Overrides are allowed but flagged, and a CLI lint catches drift in CI.

{ "mcpServers": { "sqemo": { "command": "npx", "args": ["-y", "sqemo-mcp"] } } }

Works with Claude Code, Claude Desktop, Cursor, and any MCP client. Local .erd.json files need no account; cloud ERDs and Pro tools need npx sqemo-mcp login.

What it looks like

Model a discussion board where members post articles, a post can be a reply to another post, and members comment on posts.

The agent calls the tools with logical names and never types a column name:

upsert_entity    { logicalName: "Post" }
// → { physicalName: "POST" }

upsert_attribute { logicalName: "Post Content", domain: "Content" }
// → { physicalName: "POST_CNTS" }          // Content → CNTS: from the team word list

upsert_attribute { logicalName: "Delete Flag", domain: "Flag" }
// → { physicalName: "DELETE_YN" }          // Flag → YN: same rule in every table

lint_erd
// → naming drift, missing words, referential integrity — before any DDL is written

CNTS and YN are not the agent's taste. They are your word list's abbreviations, applied the same way they were applied in every other table your team has modelled. Domains carry the data type, so Content is varchar(1000) everywhere it appears.

Building a database schema with an AI agent — without naming a single column (3:25)

Full walkthrough with every tool call: Describe the work, get a governed schema.

Related MCP server: schema-viz

Overview

AI agents can query and edit entities, relationships, and domains; generate physical names from a shared team glossary; import/export SQL (7 dialects) and DBML; and compare the model against a live database. Works with both local .erd.json files and ERDs stored on the Sqemo cloud.

Requires Node.js >= 22. Local-file tools work without any account or configuration. Login is needed for cloud ERD tools, and for the tools marked (Pro) below.

Installation

Claude Code (.mcp.json)

{
  "mcpServers": {
    "sqemo": { "command": "npx", "args": ["-y", "sqemo-mcp"] }
  }
}

Claude Desktop

Add the same mcpServers entry to your config file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "sqemo": { "command": "npx", "args": ["-y", "sqemo-mcp"] }
  }
}

Login (cloud ERDs and Pro tools)

npx sqemo-mcp login    # pick Google, GitHub, or email + password
npx sqemo-mcp logout   # removes stored credentials

login asks how you want to sign in. Google and GitHub open a browser tab, complete a PKCE OAuth flow, and hand the session back through a one-shot loopback server on 127.0.0.1; the third option takes an email and password in the terminal. Only a refresh token is ever stored.

  • Credentials are stored in ~/.erdmaker/credentials.json (mode 0600 on POSIX); your password is never persisted.

  • Non-interactive shortcuts: --password forces the email + password path, --provider google|github forces a browser path.

  • Piped input skips the menu and goes straight to email + password, so existing automation keeps working: printf 'email\npassword\n' | npx sqemo-mcp login

  • The browser paths need a browser on the same machine (the callback returns to 127.0.0.1). Over SSH or in CI, use --password or the SQEMO_EMAIL / SQEMO_PASSWORD environment variables.

What you can do

36 tools in total.

Read (17 tools)

Tool

Description

list_erds / list_workspaces

Cloud ERDs and workspaces you belong to (login required)

get_erd_overview

Name, dialect, entity/relationship/domain/glossary stats

list_entities / get_entity

Entity list and full detail (attributes, keys, logical/physical mapping)

list_relationships

Relationships with endpoints and cardinality

list_domains

Domain definitions (also from workspace standard glossaries)

search_dictionary

Search the team glossary (logical/physical words, abbreviations, synonyms)

check_naming

Check a logical name against the team naming standard

generate_physical_name

Logical name → physical name via glossary + naming rules

export_sql

CREATE TABLE SQL — mysql, postgres, cubrid, oracle, sqlserver, sqlite, h2

export_dbml

DBML text

validate_erd / lint_erd

Structural validation and full lint (naming drift, referential integrity, duplicates)

diff_erds

Diff two sources (files, cloud ERDs, or raw SQL/DBML text) — dry-run before imports

export_alter_sql

Migration (ALTER) script from the physical diff against a baseline — renames stay renames via stable IDs, destructive changes come commented out (Pro)

list_proposals

Glossary proposal queue status (login required)

Live database (2 tools)

Read-only against your own database. Both query only the information schema — never table data — and the connection URL is used by this local process only, never sent to Sqemo servers.

Tool

Description

introspect_db

Import a live PostgreSQL/MySQL schema into an existing ERD (Pro)

check_db_drift

Check a live database or a schema dump against the ERD's physical model — missing/extra tables and columns, PK/FK/NOT NULL mismatches (Pro)

Write (17 tools)

Tool

Description

create_erd

New ERD from scratch or from SQL/DBML text — to a file or the cloud

upsert_entity / delete_entity

Entity editing with automatic physical-name derivation

upsert_attribute / delete_attribute

Attribute editing — PK rules and FK propagation handled automatically

upsert_relationship / delete_relationship

Relationship editing with automatic FK derivation

upsert_domain / delete_domain

Domain definition editing

upsert_dictionary_word / delete_dictionary_word

Glossary editing (standard-linked glossaries are protected)

update_naming_rules

Naming rule editing (delimiter, case, unknown-word handling)

import_sql / import_dbml

Replace an ERD from parsed SQL/DBML (IDs preserved)

auto_layout

Automatic entity/table layout (dagre)

propose_dictionary_word / withdraw_proposal

Propose new glossary words for owner approval

Cloud writes require owner or shared-editor permission and are protected by version CAS with 3-way auto-merge for concurrent edits.

CLI for CI pipelines

Offline, file-based subcommands (no login needed):

# Naming-standard check — exits 1 on violations, great as a CI gate
npx sqemo-mcp lint schema.erd.json

# Schema export to stdout
npx sqemo-mcp export schema.erd.json --format sql --dialect postgres > schema.sql
npx sqemo-mcp export schema.erd.json --format dbml > schema.dbml

Drift mode compares the model against a real database or a dump, and exits 1 when they disagree (Pro, requires login):

npx sqemo-mcp lint schema.erd.json --db "$DATABASE_URL" [--db-schema public] [--strict]
npx sqemo-mcp lint schema.erd.json --schema dump.sql --dialect postgres
npx sqemo-mcp lint --erd <cloud-erd-id> --db "$DATABASE_URL" --ignore 'tmp_*'

GitHub Actions example:

- run: npx sqemo-mcp lint schema.erd.json
- run: npx sqemo-mcp lint schema.erd.json --db "${{ secrets.DATABASE_URL }}"

Environment variables

Variable

Purpose

SQEMO_EMAIL / SQEMO_PASSWORD

Non-interactive login for CI and SSH sessions (no browser needed)

ERDMAKER_HOME

Override the credentials directory (default ~/.erdmaker)

ERDMAKER_SUPABASE_URL

Override the API URL (defaults to the Sqemo cloud)

ERDMAKER_SUPABASE_ANON_KEY

Override the API publishable key

ERDMAKER_MAX_REQUESTS_PER_MINUTE

Per-minute request cap (default 120, 0 disables)

ERDMAKER_MAX_REQUESTS_PER_DAY

Daily request cap (default 10000, 0 disables)

The request caps are a safety net against agents stuck in loops; exceeding them returns a rate_limited error that tells the agent to stop and notify the user.

Errors

All tool errors return { code, message } — e.g. not_authenticated, no_permission, save_conflict (retry after re-reading), validation_failed, rate_limited.

License

MIT

Available Tools

36 tools
auto_layoutA

Auto-arranges entities by relationships (dagre LR). v5 has a single shared layout (no separate logical/physical placement — the removed view parameter had no other effect). Reference copies, notes, and relationship waypoints are not moved.

Inputs: source (required).

check_db_driftA

Checks whether a live database (url) or a schema dump (schemaSql) has drifted from the ERD's physical model. Errors: missing/extra tables and columns, PK/FK/NOT NULL mismatches. Warnings (strict promotes to errors): type/unique/auto-increment representation differences. Read-only; the database URL never leaves this process. Pro plan required; requires login.

Inputs: source (required), url, ignore, strict, +3 more.

check_namingA

Checks a logical name against the team naming standard (word list + rules). With physicalName, compares it to the generated name (providedMatches). With a {workspaceId} source, reads the latest workspace-standard master.

Inputs: source (required), logicalName (required), physicalName.

create_erdA

Creates a new ERD — empty or from SQL/DBML text. With a {file} target it saves locally; with {server:true} it saves to the server (login required). Pass workspaceId to bind it to that workspace's naming standard from the start.

Inputs: target (required), sql, dbml, name, +2 more.

delete_attributeC

Deletes an attribute.

Inputs: source (required), entityId (required), attributeId (required).

delete_dictionary_wordA

Deletes a glossary entry. Standard-linked (glossaryLink) dictionaries are rejected with dictionary_is_linked.

Inputs: source (required), entryId (required).

delete_domainA

Deletes a domain (attributes referencing it are unlinked).

Inputs: source (required), domainId (required).

delete_entityB

Deletes an entity (including its relationships).

Inputs: source (required), entityId (required).

delete_relationshipB

Deletes a relationship (including derived FKs).

Inputs: source (required), relationshipId (required).

diff_erdsA

Compares two ERD sources (entities/attributes/domains/relationships — unchanged omitted). A dry run before full-replace import_sql/import_dbml. A side freshly parsed from text has different ids, so most items appear as added/removed — matching the actual import behavior (full replace). summary aggregates entities only; see the arrays for domain/relationship changes.

Inputs: after (required), before (required).

export_alter_sqlA

Generates a migration (ALTER) script from the physical diff between a baseline and the current model — renames stay renames (stable-id matching), destructive changes come commented out, unsupported changes are flagged as [WARNING] comments. Baselines from the same project lineage ({file}/{erdId}) preserve renames; freshly parsed SQL/DBML text falls back to name matching. Pro plan required; requires login.

Inputs: after (required), before (required), dialect.

export_dbmlB

Exports the project as DBML text.

Inputs: source (required).

export_sqlA

Exports the physical model as CREATE TABLE SQL. Without dialect, uses the project dialect.

Inputs: source (required), dialect.

generate_physical_nameA

Generates a physical name from a logical name via the word list and naming rules (unregistered words go to warnings). With a {workspaceId} source, reads the latest workspace-standard master.

Inputs: source (required), logicalName (required).

get_entityA

Entity detail (attributes and physical mapping). Prefers entityId; otherwise exact logicalName match (first hit on duplicates).

Inputs: source (required), entityId, logicalName.

get_erd_overviewA

Returns an ERD summary (entity/relationship/domain/word-list stats, standard link status).

Inputs: source (required).

import_dbmlA

Fully replaces an existing ERD with the DBML parse result (project id preserved, dialect fixed to mysql). Rejected as invalid_source when no tables are found.

Inputs: dbml (required), source (required).

import_sqlA

Fully replaces an existing ERD with the SQL parse result (project id preserved). Rejected as invalid_source when no tables are found.

Inputs: sql (required), source (required), dialect.

introspect_dbA

Imports the schema of a live PostgreSQL/MySQL database into an existing ERD (full replace, project id preserved). Read-only — queries only the information schema/catalog; never reads table data. The database URL is used by this local process only and is never sent to Sqemo servers. Pro plan required; requires login.

Inputs: url (required), source (required), dbSchema.

lint_erdA

Lints the whole project — structure (PKs, attributes, descriptions, domains), referential integrity, duplicate physical names (including names that differ only by case, which collide on case-insensitive databases), duplicate logical entity names, identifier length limits (dialect-aware, tables/columns/indexes/FK constraints), auto-increment on non-integer column types (dialect-aware), and the naming standard (unregistered words, physical-name drift) in one pass. Quality/standards oriented, unlike validate_erd (structural validity).

Inputs: source (required).

list_domainsA

Lists domain definitions (name, data type). With a {workspaceId} source, reads the latest workspace-standard master.

Inputs: source (required).

list_entitiesB

Lists entities (logical name, physical name, attribute count).

Inputs: source (required).

list_erdsA

Lists server ERDs (owned/shared). Owner and shared editors can both write. Requires login — npx sqemo-mcp login.

Inputs: no named parameters.

list_proposalsA

Lists the workspace-standard proposal queue (word/domain, newest first, mine = my proposals). Filterable by status. Requires login.

Inputs: source (required), status.

list_relationshipsA

Lists relationships (endpoint entity names, cardinality, identifying flag).

Inputs: source (required).

list_workspacesA

Lists my workspaces (owner first) and whether a standard (word list + naming rules) exists. Requires login.

Inputs: no named parameters.

propose_dictionary_wordA

Proposes a new word for the workspace standard's word list (the owner approves/rejects in the web app). source is {workspaceId} or a standard-linked ERD ({file}/{erdId}, resolved via glossaryLink). Registered words return already_exists; a pending duplicate returns already_proposed. Requires login.

Inputs: source (required), logicalWord (required), physicalWord (required), note, +3 more.

search_dictionaryA

Partial-match word-list search across logical/physical/abbreviation/English/synonyms (case-insensitive, max 50). With a {workspaceId} source, reads the latest workspace-standard master.

Inputs: query (required), source (required).

update_naming_rulesA

Partially updates the naming rules (delimiter, case, unknown-word handling, self-reference role prefix). Existing physical names are not regenerated retroactively (noted in warnings) — set the rules before modelling.

Inputs: source (required), casing, separator, unknownWordMode, +1 more.

upsert_attributeA

Creates an attribute (no attributeId, logicalName required) or updates one (attributeId given, only provided fields change). primaryKey=true forces nullable=false and propagates child FKs. With a domain, the domain decides the data type. autoIncrement marks the column as identity — exported as AUTO_INCREMENT (mysql/cubrid/h2), IDENTITY(1,1) (sqlserver), or GENERATED BY DEFAULT AS IDENTITY (postgres/oracle); it applies to primary keys only.

Inputs: source (required), entityId (required), domain, unique, +7 more.

upsert_dictionary_wordA

Adds a glossary entry (upsert by logicalWord) or updates one (entryId given). Physical words are normalized to uppercase. Standard-linked (glossaryLink) dictionaries are rejected with dictionary_is_linked.

Inputs: source (required), logicalWord (required), physicalWord (required), entryId, +3 more.

upsert_domainA

Creates a domain (upsert by name) or updates one (domainId given). Existing description preserved when omitted.

Inputs: name (required), source (required), dataType (required), domainId, +1 more.

upsert_entityA

Creates an entity (no entityId, logicalName required) or updates one (entityId given, only provided fields change). The physical name is derived automatically.

Inputs: source (required), entityId, description, logicalName.

upsert_relationshipA

Creates a relationship (no relationshipId, source/targetEntityId required — FKs derived automatically) or updates one (relationshipId given). On update, sourceEnd/targetEnd take precedence; otherwise ends are re-derived from cardinality. onDelete/onUpdate set the FK referential actions ('noAction' reverts to the DB default); constraintName sets the FK constraint name (empty string reverts to auto-generation).

Inputs: source (required), onDelete, onUpdate, sourceEnd, +7 more.

validate_erdB

Validates project structure and referential integrity ({ valid, errors }).

Inputs: source (required).

withdraw_proposalA

Withdraws your own pending proposal. Proposals by others or already processed return not_found. Requires login.

Inputs: proposalId (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 36 tools

    Disambiguation5/5

    All 36 tools target distinct resource-action pairs: list/get/upsert/delete for specific entity types, plus specialized operations like validate, lint, diff, import, and export. Related tools like validate_erd and lint_erd are clearly differentiated by structural vs quality focus, so there is no confusion.

    Naming Consistency5/5

    Every tool name follows a consistent lowercase_snake_case verb_noun pattern (e.g., list_entities, upsert_attribute, export_sql, check_naming). The only slight deviation is 'auto_layout', but it still fits the overall convention, so naming is highly predictable.

    Tool Count2/5

    With 36 tools, this server is well above the 25-tool threshold that typically indicates an excessive number for an MCP server. Although each tool has a clear role, the breadth makes the surface heavy and potentially overwhelming for agents.

    Completeness3/5

    The core lifecycle is well covered for entities, attributes, relationships, domains, and dictionary words, including create, read, update, and delete. However, there is no tool to delete an ERD itself, and ERD-level metadata updates are missing, which are notable gaps in a modeling tool.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      SQL Server MCP server with AST-based query validation, read-only safety, schema exploration, ER diagram generation, and DBA toolkit integration (First Responder Kit, DarlingData, sp_WhoIsActive).
      12
      8
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      MCP server that reads your database schema from SQL DDL, Prisma, Drizzle, TypeORM, or SQLAlchemy, generates a Mermaid ER diagram, and writes it into your documentation, with drift detection to keep diagrams up-to-date.
      5
      1
      MIT