Sqemo

io.github.sqemo由 GitHub 账号 sqemo 发布v2.8.3更新于 Oct 25, 2026

Design ERDs with your team's naming standards: query/edit entities and relationships, SQL/DBML

已验证STDIO仅桌面数据库开发者工具

概览

AI 生成的概览

Sqemo 是一个本地 MCP 服务器,让 AI 助手按团队命名词表设计 ERD 并生成数据库物理名称。

可以做什么
读取与查看 ERD:列出实体、关系、域和词表词条,获取 ERD 概览或搜索团队词典。检查与生成名称:按命名规范校验逻辑名称,并依据词表推导物理名称。导出与比较:生成七种方言的 CREATE TABLE SQL 或 DBML,比较两个 ERD,并生成 ALTER 迁移脚本。编辑模型:创建 ERD,新增或删除实体、属性、关系、域、词表词条和命名规则。检查在线数据库:导入 PostgreSQL 或 MySQL 结构并检查与模型的偏差,仅读取 information schema。在 CI 中运行 CLI 的 lint 与导出命令。
适用场景
适合团队希望助手在保持数据库命名一致的前提下设计或编辑 ERD,或在编写 DDL 前检查命名偏差和数据库结构偏差。也适合拥有共享词表、并在 CI 中以命名规则作为门禁的团队。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js 22 或更高版本。本地 .erd.json 文件无需账号;云端 ERD 和 Pro 工具需通过 CLI 登录,可用交互式 OAuth 或邮箱加密码,也可使用 SQEMO_EMAIL 和 SQEMO_PASSWORD 环境变量。在线数据库工具需要连接 URL。
安装前请注意
云端和 Pro 功能需要登录,凭据文件中会保存刷新令牌,SQEMO_PASSWORD 可通过环境变量提供。写入类工具会创建、替换和删除 ERD、实体、属性、关系、域和词表词条,云端写入需要所有者或编辑者权限。按 README 说明,数据库连接 URL 仅由本地进程使用。请求上限用于限制助手陷入循环。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Sqemo,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

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.

json
{ "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:

jsonc
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.

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)

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)

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

Login (cloud ERDs and Pro tools)

bash
npx sqemo-mcp login    # pick Google, GitHub, or email + passwordnpx 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)

ToolDescription
list_erds / list_workspacesCloud ERDs and workspaces you belong to (login required)
get_erd_overviewName, dialect, entity/relationship/domain/glossary stats
list_entities / get_entityEntity list and full detail (attributes, keys, logical/physical mapping)
list_relationshipsRelationships with endpoints and cardinality
list_domainsDomain definitions (also from workspace standard glossaries)
search_dictionarySearch the team glossary (logical/physical words, abbreviations, synonyms)
check_namingCheck a logical name against the team naming standard
generate_physical_nameLogical name → physical name via glossary + naming rules
export_sqlCREATE TABLE SQL — mysql, postgres, cubrid, oracle, sqlserver, sqlite, h2
export_dbmlDBML text
validate_erd / lint_erdStructural validation and full lint (naming drift, referential integrity, duplicates)
diff_erdsDiff two sources (files, cloud ERDs, or raw SQL/DBML text) — dry-run before imports
export_alter_sqlMigration (ALTER) script from the physical diff against a baseline — renames stay renames via stable IDs, destructive changes come commented out (Pro)
list_proposalsGlossary 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.

ToolDescription
introspect_dbImport a live PostgreSQL/MySQL schema into an existing ERD (Pro)
check_db_driftCheck 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)

ToolDescription
create_erdNew ERD from scratch or from SQL/DBML text — to a file or the cloud
upsert_entity / delete_entityEntity editing with automatic physical-name derivation
upsert_attribute / delete_attributeAttribute editing — PK rules and FK propagation handled automatically
upsert_relationship / delete_relationshipRelationship editing with automatic FK derivation
upsert_domain / delete_domainDomain definition editing
upsert_dictionary_word / delete_dictionary_wordGlossary editing (standard-linked glossaries are protected)
update_naming_rulesNaming rule editing (delimiter, case, unknown-word handling)
import_sql / import_dbmlReplace an ERD from parsed SQL/DBML (IDs preserved)
auto_layoutAutomatic entity/table layout (dagre)
propose_dictionary_word / withdraw_proposalPropose 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):

bash
# Naming-standard check — exits 1 on violations, great as a CI gatenpx sqemo-mcp lint schema.erd.json
# Schema export to stdoutnpx sqemo-mcp export schema.erd.json --format sql --dialect postgres > schema.sqlnpx 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):

bash
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 postgresnpx sqemo-mcp lint --erd <cloud-erd-id> --db "$DATABASE_URL" --ignore 'tmp_*'

GitHub Actions example:

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

Environment variables

VariablePurpose
SQEMO_EMAIL / SQEMO_PASSWORDNon-interactive login for CI and SSH sessions (no browser needed)
ERDMAKER_HOMEOverride the credentials directory (default ~/.erdmaker)
ERDMAKER_SUPABASE_URLOverride the API URL (defaults to the Sqemo cloud)
ERDMAKER_SUPABASE_ANON_KEYOverride the API publishable key
ERDMAKER_MAX_REQUESTS_PER_MINUTEPer-minute request cap (default 120, 0 disables)
ERDMAKER_MAX_REQUESTS_PER_DAYDaily 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.

Links

License

MIT

来源:README.md,提交 b08b386

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v2.8.3最新Oct 16, 2026
  2. v2.8.2Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分