AI Integration (MCP)
Updated
sqemo-mcp is a local MCP
(Model Context Protocol) server that lets AI agents work with your ERDs:
read and edit entities, attributes, and relationships; import and export
SQL and DBML; generate and check physical names against your team
standard; lint, auto-layout, and diff; and, on Pro, read a live database
to import it or check it for drift. It runs via npx — no separate
install.
Requirements
Node.js 22 or later.
Client setup
Claude Code — add to .mcp.json at your project root:
{
"mcpServers": {
"sqemo": { "command": "npx", "args": ["-y", "sqemo-mcp"] }
}
}
Claude Desktop — add the same mcpServers entry to the config file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Codex CLI — register with one command:
codex mcp add sqemo -- npx -y sqemo-mcp
Or add the equivalent TOML to ~/.codex/config.toml:
[mcp_servers.sqemo]
command = "npx"
args = ["-y", "sqemo-mcp"]
Most other MCP clients (Cursor, etc.) use the same mcpServers JSON.
Using an AI agent already? Just paste this page’s URL into Claude Code, Codex, or Cursor and ask it to connect the sqemo MCP server — the steps above are everything it needs.
Sign in for server ERDs
No login is needed for local .erd.json files — every file tool works
offline. To read or edit ERDs saved on the Sqemo server, sign in once
from a terminal:
npx sqemo-mcp login # pick Google, GitHub, or email + password
npx sqemo-mcp logout # remove stored credentials
login asks how you want to sign in. Google and GitHub open a browser tab and
hand the result back to the terminal; the third option takes an email and
password without leaving it. Whichever you pick, only a refresh token is
stored, in ~/.erdmaker/credentials.json — never your password.
No browser on that machine? Use npx sqemo-mcp login --password, or set
SQEMO_EMAIL / SQEMO_PASSWORD for unattended runs.
CI without an agent
The package doubles as an offline CLI for pipelines:
# fail the build on naming-standard violations (exit code 1)
npx sqemo-mcp lint schema.erd.json
# export to SQL or DBML on stdout
npx sqemo-mcp export schema.erd.json --format sql --dialect postgres > schema.sql
GitHub Actions:
- run: npx sqemo-mcp lint schema.erd.json
CI drift check (Pro)
On Pro, lint can also compare your ERD against a real database and fail
CI when they’ve drifted apart. For a full step-by-step walkthrough — including
setting a password if you signed up with Google/GitHub, and trying it with
Docker if you don’t have a database handy — see
Connect to a Live Database.
# .github/workflows/schema-drift.yml
- run: npx sqemo-mcp lint erd/app.erd.json --db "$DATABASE_URL" --ignore "flyway_*"
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }} # read-only account recommended
SQEMO_EMAIL: ${{ secrets.SQEMO_EMAIL }} # Sqemo Pro account (password sign-in;
SQEMO_PASSWORD: ${{ secrets.SQEMO_PASSWORD }} # OAuth-only accounts: set a password first)
SQEMO_EMAIL/SQEMO_PASSWORD sign in for the duration of the CI job —
no login step or stored token needed. Interactive sign-in can use your
browser, but a CI job has no browser, so it needs a password. If your Sqemo
account was created via Google/GitHub OAuth it has none yet —
set one once,
then use it here. Introspection itself runs inside your CI job and only
queries information_schema — no database credentials are ever sent to Sqemo.
Prefer zero database credentials in CI? Compare against a schema dump instead, with no login required either:
npx sqemo-mcp lint erd/app.erd.json --schema schema.sql --dialect postgres
What agents can do
39 tools in total. A few of them: get_erd_overview, upsert_entity,
upsert_attribute, upsert_relationship, upsert_attributes,
upsert_dictionary_words and upsert_domains (bulk edits in one save), import_sql, import_dbml,
export_sql, export_dbml, generate_physical_name, check_naming,
lint_erd, auto_layout, diff_erds, proposal tools for suggesting
new words to your team standard (a person still approves or rejects them —
that side is a two-minute video), and two Pro tools
for working against a real database: introspect_db (import a live
PostgreSQL/MySQL schema into an ERD, read-only) and check_db_drift
(check whether a live database or schema dump has drifted from the ERD).
Frequently asked questions
- Do I need a Sqemo account to use the MCP server?
- No. Every file tool works offline on local .erd.json files without signing in. An account is only needed to read or edit ERDs saved on the Sqemo server (npx sqemo-mcp login), and Pro for the three paid tools: export_alter_sql, introspect_db, and check_db_drift.
- Which Node.js version does sqemo-mcp need?
- Node.js 22 or later. It runs via npx -y sqemo-mcp, so there is nothing to install globally.
- Can I enforce the naming standard in CI without an AI agent?
- Yes. npx sqemo-mcp lint schema.erd.json exits with code 1 on naming-standard violations, so a GitHub Actions step fails the build. On Pro, --db compares the ERD against a live database and fails on drift; --schema does the same against a SQL dump with no login.
- Are my database credentials sent to Sqemo?
- No. Introspection runs inside your own machine or CI job and only queries information_schema. Database credentials never leave that environment; only your Sqemo sign-in is used to check the plan.