mcp-db-schema-tools
Supports conversion of JSON schemas to MySQL SQL DDL.
Supports conversion of JSON schemas to PostgreSQL SQL DDL.
Allows comparison of database schema with SQLAlchemy models to check synchronization and generate migration plans.
Enables creation, extraction, and validation of SQLite databases from JSON schemas.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-db-schema-toolsConvert my project requirements into a database schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP DB Schema Tools ๐ ๏ธ
Claude Code์ฉ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์คํค๋ง ๊ด๋ฆฌ MCP ์๋ฒ
๋น์ฆ๋์ค ์๊ตฌ์ฌํญ๋ถํฐ ์์ฑ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค๊น์ง, ์์ฐ์ด๋ก ๊ฐ๋จํ๊ฒ ๊ด๋ฆฌํ์ธ์.
๐ ๋ชฉ์ฐจ
Related MCP server: Database Tools for Claude AI
๐ฏ ์ฃผ์ ๊ธฐ๋ฅ
โจ ์์ ํ AI ๊ธฐ๋ฐ ์ํฌํ๋ก์ฐ
๋น์ฆ๋์ค ๊ธฐํ์ โ JSON ์คํค๋ง โ SQL DDL โ SQLite ๋ฐ์ดํฐ๋ฒ ์ด์ค๐ ์๋ฐฉํฅ ๋ณํ ์ง์
JSON โ SQL ์๋ฒฝ ๋ณํ
๊ธฐ์กด DB โ JSON ์คํค๋ง ์ถ์ถ
์ฌ๋ฌ ์คํค๋ง ํ์ผ ๋ณํฉ
๐ค Claude Code์ ์๋ฒฝ ํตํฉ
์์ฐ์ด๋ก ์คํค๋ง ๊ด๋ฆฌ
์ค์๊ฐ ๊ฒ์ฆ ๋ฐ ํผ๋๋ฐฑ
์ํด๋ฆญ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์์ฑ
๐ก๏ธ ์์ ์ฑ ๋ณด์ฅ
๊ด๊ณ ๋ฌด๊ฒฐ์ฑ ์๋ ๊ฒ์ฆ
์์ ํ ์๋ ๋ฐ์ดํฐ ์ฝ์
๋ฐฑ์๋ ๋ชจ๋ธ๊ณผ ๋๊ธฐํ ํ์ธ
โก ๋น ๋ฅธ ์์
1๏ธโฃ ์ค์น
# uv๊ฐ ์๋ค๋ฉด ๋จผ์ ์ค์น
curl -LsSf https://astral.sh/uv/install.sh | sh
# ํ๋ก์ ํธ ์ค์น
cd mcp-db-schema-tools
uv sync
# ์ค์น ํ์ธ
uv run python -c "import mcp_db_schema_tools; print('โ
MCP server ready!')"2๏ธโฃ Claude Code ์ค์
.claude/settings.json์ ๋ค์์ ์ถ๊ฐ:
{
"mcpServers": {
"db-schema-tools": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/mcp-db-schema-tools",
"python",
"-m",
"mcp_db_schema_tools"
]
}
}
}3๏ธโฃ ์ฆ์ ์ฌ์ฉ ๊ฐ๋ฅ! ๐
Claude Code์์ ์์ฐ์ด๋ก ์์ฒญํ์ธ์:
"๋ด ๊ธฐํ์๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค ์คํค๋ง ๋ง๋ค์ด์ค"
"์ด ์คํค๋ง๋ก SQLite ํ์ผ ์์ฑํด์ค"
"๊ธฐ์กด DB์ ๋ฐฑ์๋ ๋ชจ๋ธ์ด ๋๊ธฐํ๋์๋์ง ํ์ธํด์ค"๐ง ์ค๋น์ฌํญ
โ ํ์ ์๊ตฌ์ฌํญ
Python 3.8+
uv (ํจํค์ง ๊ด๋ฆฌ์)
Claude Code
๐ฆ ๊ถ์ฅ ์ค๋น๋ฌผ
๋น์ฆ๋์ค ์๊ตฌ์ฌํญ ๋ฌธ์ (
.md,.txt๋ฑ)๊ธฐ์กด ๋ฐ์ดํฐ๋ฒ ์ด์ค ํ์ผ (์ ํ์ฌํญ)
๋ฐฑ์๋ ๋ชจ๋ธ ํ์ผ (๋๊ธฐํ ํ์ธ์ฉ, ์ ํ์ฌํญ)
๐ฏ ์ง์ ๋ฐ์ดํฐ๋ฒ ์ด์ค
โ SQLite (์์ ์ง์)
๐ง PostgreSQL (๊ธฐ๋ณธ ์ง์)
๐ง MySQL (๊ธฐ๋ณธ ์ง์)
๐ ๏ธ ์ฌ์ฉ ๊ฐ๋ฅํ ๋๊ตฌ๋ค
๐ค 1. AI ์คํค๋ง ์์ฑ
// ๋๊ตฌ๋ช
: generate_schema_json_from_text
"์ด ๊ธฐํ์๋ฅผ ๋ฐํ์ผ๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค ์คํค๋ง๋ฅผ ๋ง๋ค์ด์ค"์ ๋ ฅ: ๋น์ฆ๋์ค ์๊ตฌ์ฌํญ ํ ์คํธ/๋ฌธ์
์ถ๋ ฅ: ์์ฑ๋ JSON ์คํค๋ง
ํน์ง: AI๊ฐ ์๋์ผ๋ก ํ ์ด๋ธ๊ณผ ๊ด๊ณ ๋ถ์
๐ 2. JSON โ SQL ๋ณํ
// ๋๊ตฌ๋ช
: schema_json_to_sql
"JSON ์คํค๋ง๋ฅผ SQLite SQL๋ก ๋ณํํด์ค"์ ๋ ฅ: JSON ์คํค๋ง ํ์ผ ๋๋ ๋ด์ฉ
์ถ๋ ฅ: ์คํ ์ค๋น๋ SQL DDL
์ง์: SQLite, PostgreSQL, MySQL
๐๏ธ 3. ๋ฐ์ดํฐ๋ฒ ์ด์ค ์์ฑ
// ๋๊ตฌ๋ช
: create_database_from_schema
"์ด ์คํค๋ง๋ก SQLite ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ง๋ค์ด์ค"์ ๋ ฅ: JSON ์คํค๋ง
์ถ๋ ฅ: ์์ฑ๋ SQLite ํ์ผ
๊ธฐ๋ฅ: ์๋ ๋ฐ์ดํฐ ์๋ ์ฝ์
๐ค 4. ๊ธฐ์กด DB โ JSON ์ถ์ถ
// ๋๊ตฌ๋ช
: extract_schema_from_db
"๊ธฐ์กด SQLite ํ์ผ์์ ์คํค๋ง๋ฅผ JSON์ผ๋ก ์ถ์ถํด์ค"์ ๋ ฅ: ๊ธฐ์กด ๋ฐ์ดํฐ๋ฒ ์ด์ค ํ์ผ
์ถ๋ ฅ: JSON ์คํค๋ง + ๋ฌธ์ํ
ํ์ฉ: ๋ ๊ฑฐ์ DB ๋ฌธ์ํ
๐ 5. ์คํค๋ง ๊ฒ์ฆ
// ๋๊ตฌ๋ช
: validate_schema
"์ด ์คํค๋ง์ ๋ฌธ์ ์๋์ง ๊ฒ์ฆํด์ค"๊ฒ์ฆ ํญ๋ชฉ: Foreign Key, ์ธ๋ฑ์ค, ๋ฐ์ดํฐ ํ์
๊ฒฐ๊ณผ: ์ค๋ฅ/๊ฒฝ๊ณ ๋ฆฌ์คํธ + ๊ฐ์ ์ ์
๐งฉ 6. ์คํค๋ง ๋ณํฉ
// ๋๊ตฌ๋ช
: merge_schemas
"core์ admin ์คํค๋ง๋ฅผ ํฉ์ณ์ค"์ ๋ ฅ: ์ฌ๋ฌ JSON ์คํค๋ง ํ์ผ
์ถ๋ ฅ: ํตํฉ๋ ๋จ์ผ ์คํค๋ง
ํ์ฉ: ๋ชจ๋๋ณ ์คํค๋ง ๊ด๋ฆฌ
โ๏ธ 7. ๋ชจ๋ธ ๋๊ธฐํ ํ์ธ
// ๋๊ตฌ๋ช
: compare_with_models
"ํ์ฌ DB์ ๋ฐฑ์๋ ๋ชจ๋ธ์ด ๋๊ธฐํ๋์ด ์๋์ง ํ์ธํด์ค"์ ๋ ฅ: SQLite DB + Python ๋ชจ๋ธ ํ์ผ๋ค
์ถ๋ ฅ: ๋๋ฝ/์ถ๊ฐ ํ ์ด๋ธ, ์ปฌ๋ผ ์ฐจ์ด
ํ์ฉ: ๋ง์ด๊ทธ๋ ์ด์ ๊ณํ ์๋ฆฝ
๐ ์ํฌํ๋ก์ฐ ๊ฐ์ด๋
๐ ์๋๋ฆฌ์ค 1: ์ ๊ท ํ๋ก์ ํธ ์์
graph LR
A[๊ธฐํ์.md] --> B[AI ์คํค๋ง ์์ฑ]
B --> C[JSON ์คํค๋ง]
C --> D[์คํค๋ง ๊ฒ์ฆ]
D --> E[SQLite DB ์์ฑ]
E --> F[๋ฐฑ์๋ ๊ฐ๋ฐ ์์]Claude Code ๋ช ๋ น์ด ์์:
"ํ๋ก์ ํธ ๊ธฐํ์๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค ์คํค๋ง ๋ง๋ค์ด์ค""์์ฑ๋ ์คํค๋ง ๊ฒ์ฆํด์ค""๊ฒ์ฆ๋ ์คํค๋ง๋ก SQLite ๋ฐ์ดํฐ๋ฒ ์ด์ค ์์ฑํด์ค"
๐ ์๋๋ฆฌ์ค 2: ๊ธฐ์กด DB ๋ฌธ์ํ
graph LR
A[legacy.db] --> B[์คํค๋ง ์ถ์ถ]
B --> C[JSON ์คํค๋ง]
C --> D[๋ฌธ์ ์์ฑ]
D --> E[README.md]Claude Code ๋ช ๋ น์ด ์์:
"legacy.db์์ ์คํค๋ง๋ฅผ JSON์ผ๋ก ์ถ์ถํด์ค""์ถ์ถ๋ ์คํค๋ง๋ก README ๋ฌธ์ ๋ง๋ค์ด์ค"
๐ง ์๋๋ฆฌ์ค 3: ํ ํ์ (๋ชจ๋๋ณ ๊ฐ๋ฐ)
graph LR
A[core.json] --> C[merge_schemas]
B[admin.json] --> C
C --> D[unified.json]
D --> E[์ต์ข
DB]Claude Code ๋ช ๋ น์ด ์์:
"core.json๊ณผ admin.json ์คํค๋ง๋ฅผ ๋ณํฉํด์ค""๋ณํฉ๋ ์คํค๋ง ๊ฒ์ฆํด์ค""์ต์ข ์คํค๋ง๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค ์์ฑํด์ค"
๐ ์ค์ ์ฌ์ฉ ์์
๐ ์์ 1: ๋ธ๋ก๊ทธ ํ๋ซํผ ํ๋ก์ ํธ
์ฌ์ฉ์: "blog_platform.md ํ์ผ์ ๋น์ฆ๋์ค ์๊ตฌ์ฌํญ์ผ๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค ์คํค๋ง๋ฅผ ๋ง๋ค์ด์ค"
Claude: generate_schema_json_from_text ๋๊ตฌ๋ก ์คํค๋ง๋ฅผ ์์ฑํ๊ฒ ์ต๋๋ค.
โ
Schema generated and saved to: blog_schema.json
๐ Generated Schema Summary:
- Database: blog_platform
- Tables: 6
- Relationships: 8
๐ Tables Created:
- users: ์ฌ์ฉ์ ์ ๋ณด (์ด๋ฉ์ผ ์ธ์ฆ)
- categories: ๊ฒ์๊ธ ์นดํ
๊ณ ๋ฆฌ
- posts: ๋ธ๋ก๊ทธ ๊ฒ์๊ธ
- comments: ๋๊ธ ์์คํ
- tags: ํ๊ทธ ๊ด๋ฆฌ
- post_tags: ๊ฒ์๊ธ-ํ๊ทธ ๊ด๊ณ์ฌ์ฉ์: "์์ฑ๋ ์คํค๋ง๋ก SQLite ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ง๋ค์ด์ค"
Claude: create_database_from_schema ๋๊ตฌ๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์์ฑํ๊ฒ ์ต๋๋ค.
โ
SQLITE Database created successfully!
๐ Database: blog_platform.db
๐ Tables created: 6
๐ฑ Seed records inserted: 3
์ค๋น ์๋ฃ! ์ด์ FastAPI ๋ฐฑ์๋ ๊ฐ๋ฐ์ ์์ํ ์ ์์ต๋๋ค.๐ ์์ 2: ๋ ๊ฑฐ์ DB ๋ถ์
์ฌ์ฉ์: "old_system.db ํ์ผ์ ๋ถ์ํด์ ํ๋์ ์ธ JSON ์คํค๋ง๋ก ๋ณํํด์ค"
Claude: extract_schema_from_db ๋๊ตฌ๋ก ์คํค๋ง๋ฅผ ์ถ์ถํ๊ฒ ์ต๋๋ค.
โ
SQLITE Schema extracted and saved to: legacy_schema.json
๐ Schema Summary:
- Database: old_system
- Tables: 15
- Relationships: 8
โ ๏ธ ๋ฐ๊ฒฌ๋ ๋ฌธ์ ์ :
- Missing foreign key constraints (3๊ฐ)
- Inconsistent naming convention
- Missing indexes on frequently queried columns
๐ก ๊ฐ์ ์ ์:
- users.email์ UNIQUE ์ธ๋ฑ์ค ์ถ๊ฐ
- created_at ์ปฌ๋ผ๋ค์ ๊ธฐ๋ณธ๊ฐ ์ค์
- ์ธ๋ํค ์ ์ฝ์กฐ๊ฑด ์ถ๊ฐโ๏ธ ์์ 3: ๋ฐฑ์๋ ๋๊ธฐํ ํ์ธ
์ฌ์ฉ์: "ํ์ฌ ๋ฐ์ดํฐ๋ฒ ์ด์ค๊ฐ SQLAlchemy ๋ชจ๋ธ๊ณผ ๋๊ธฐํ๋์ด ์๋์ง ํ์ธํด์ค"
Claude: compare_with_models ๋๊ตฌ๋ก ํ์ธํ๊ฒ ์ต๋๋ค.
๐ Database vs Models Comparison
โ Missing Tables in Database (2):
- user_profiles
- activity_logs
โ ๏ธ Extra Tables in Database (1):
- temp_migration_backup
๐ Missing Columns:
- users: last_login_ip, preferences
- orders: tracking_number
๐ก Suggestions:
- Create migration script for missing tables
- Remove temporary backup table
- Consider adding missing columns to models๐ ๊ณ ๊ธ ์ฌ์ฉ๋ฒ
๐จ ์ปค์คํ ์คํค๋ง ํ ํ๋ฆฟ
{
"database": {
"name": "my_project",
"type": "sqlite",
"version": "1.0.0",
"description": "ํ๋ก์ ํธ ์ค๋ช
"
},
"tables": {
"users": {
"description": "์ฌ์ฉ์ ์ ๋ณด",
"columns": {
"id": {
"type": "INTEGER",
"primary_key": true,
"auto_increment": true
}
}
}
}
}๐ ๋ฐฐ์น ์ฒ๋ฆฌ
# ์ฌ๋ฌ ์คํค๋ง ํ์ผ ์ผ๊ด ๋ณํ
for schema in schemas/*.json; do
echo "Converting $schema..."
# Claude Code์์ ์๋ํ ๊ฐ๋ฅ
done๐งช ํ ์คํธ ๋ฐ์ดํฐ ์์ฑ
{
"seed_data": {
"users": [
{
"id": 1,
"email": "test@example.com",
"name": "ํ
์คํธ ์ฌ์ฉ์"
}
]
}
}๐ง ๊ฐ๋ฐ ๊ฐ์ด๋
๐ฆ ๊ฐ๋ฐ ํ๊ฒฝ ์ค์
# ๊ฐ๋ฐ ์์กด์ฑ ํฌํจ ์ค์น
uv sync --dev
# ์ฝ๋ ํ์ง ๊ฒ์ฌ
uv run black .
uv run ruff check .
# ํ
์คํธ ์คํ
uv run pytest -v
# MCP ์๋ฒ ๋๋ฒ๊ทธ ๋ชจ๋
uv run python -m mcp_db_schema_tools --debug๐งช ํ ์คํธ ์์ฑ
def test_schema_generation():
"""๋น์ฆ๋์ค ์๊ตฌ์ฌํญ์์ ์คํค๋ง ์์ฑ ํ
์คํธ"""
requirements = "์ฌ์ฉ์ ๊ด๋ฆฌ ์์คํ
..."
schema = generate_schema_from_text(requirements)
assert "users" in schema["tables"]๐ ๊ธฐ์ฌ ๋ฐฉ๋ฒ
Fork this repository
Branch ์์ฑ:
git checkout -b feature/amazing-featureCommit ๋ณ๊ฒฝ์ฌํญ:
git commit -m 'Add amazing feature'Push to branch:
git push origin feature/amazing-featurePull Request ์์ฑ
๐ ์ด์ ๋ฆฌํฌํธ
๋ฌธ์ ๋ฐ๊ฒฌ ์ ๋ค์ ์ ๋ณด์ ํจ๊ป GitHub Issues์ ๋ณด๊ณ ํด์ฃผ์ธ์:
MCP ์๋ฒ ๋ฒ์
Claude Code ๋ฒ์
์ค๋ฅ ๋ฉ์์ง
์ฌํ ๋จ๊ณ
๐ ๋ผ์ด์ ์ค
MIT License - ์์ธํ ๋ด์ฉ์ LICENSE ํ์ผ์ ์ฐธ์กฐํ์ธ์.
๐ ๊ฐ์ฌ์ ๋ง
์ด ํ๋ก์ ํธ๋ ๋ค์ ๊ธฐ์ ๋ค๋ก ๋ง๋ค์ด์ก์ต๋๋ค:
โก uv - ์ด๊ณ ์ Python ํจํค์ง ๊ด๋ฆฌ
๐ค Claude Code - AI ๊ธฐ๋ฐ ๊ฐ๋ฐ ํ๊ฒฝ
๐ MCP Protocol - ๋ชจ๋ธ-์ปดํจํฐ ๊ฐ ํต์
Made with โก uv and โค๏ธ for Claude Code integration
๐ก ํ: ์ด README๋ MCP DB Schema Tools๋ก ๊ด๋ฆฌ๋๋ ํ๋ก์ ํธ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ๋ฐํ์ผ๋ก ์์ฑ๋์์ต๋๋ค!
This server cannot be installed
Maintenance
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/southglory/mcp-db-schema-tools'
If you have feedback or need assistance with the MCP directory API, please join our Discord server