mcp-database-universal
MCP Database Server
MCP 지원 AI 에이전트를 위한 데이터베이스 추론 인터페이스 — 단순한 SQL 래퍼가 아닙니다.
mcp-database-universal은 AI 에이전트에게 7가지 추론 도구를 제공하여 데이터베이스를 안전하게 탐색하고 쿼리하며, 스키마와 데이터 구조를 이해하고, 자연어 질문을 실행하고, 관계를 시각화할 수 있게 합니다 — 원시 연결 내부를 노출하지 않으면서 말이죠.
기능
AI 에이전트용 7가지 추론 도구: 연결 테스트, 테이블 목록, 테이블 검사, 매개변수화된 SQL 실행, 자연어 질문, 데이터 프로파일링, ER 다이어그램 렌더링.
멀티 엔진: SQLite(내장) 및 선택적 PostgreSQL, MySQL, MSSQL 지원.
안전 우선: 기본 읽기 전용, 매개변수화된 쿼리, 문 검증, 행/시간/출력 제한.
LLM 친화적 출력: 타입 변환,
NULL처리, 컨텍스트가 포함된 Markdown 테이블로 결과 포맷.스키마 인트로스펙션: 테이블, 컬럼, 인덱스, 외래 키, 관계 자동 탐지.
자연어 쿼리: 일반 텍스트 질문을 SQL로 변환하고 결과 반환.
Related MCP server: Universal Database MCP Server
지원 엔진
엔진 | 요구 사항 | 추가 설치 |
SQLite | 내장 | — |
PostgreSQL | psycopg |
|
MySQL | PyMySQL |
|
MSSQL | pyodbc + ODBC 드라이버 |
|
전체 | — |
|
설치
pip install mcp-database-universal
# With optional engines:
pip install "mcp-database-universal[postgres]"
pip install "mcp-database-universal[mysql]"
pip install "mcp-database-universal[mssql]"
# or everything:
pip install "mcp-database-universal[all]"빠른 시작
STDIO를 통해 서버 실행(MCP 클라이언트의 기본 전송 방식):
DATABASE_URL=sqlite:///app.db python -m mcp_database_universal연결 URL:
sqlite:///path/to/db.db SQLite (file)
sqlite:///:memory: SQLite (in-memory)
postgresql://user:pass@host:5432/db PostgreSQL
mysql://user:pass@host:3306/db MySQL
mssql://user:pass@host:1433/db MSSQL (uses ODBC Driver 18)Docker
docker build -t mcp-db .
# Mount a SQLite database read-only:
docker run --rm -i \
-v /host/path/app.db:/data/app.db:ro \
-e DATABASE_URL=sqlite:////data/app.db \
mcp-db
# Or in-memory:
docker run --rm -i -e DATABASE_URL=sqlite:///:memory: mcp-db구성
모든 구성은 환경 변수를 통해 이루어집니다.
변수 | 기본값 | 설명 |
| (필수) | 데이터베이스 연결 URL. |
|
| 읽기 전용 모드 강제( |
|
|
|
|
| 쿼리당 반환되는 최대 행 수. |
|
| 쿼리 제한 시간(초). |
|
| 결과 페이로드 크기 상한. |
|
| 테이블/컬럼 통계에 표시되는 샘플 행 수. |
|
| 프로파일링의 상위 N개 값 분포 항목. |
| — | LLM 기반 |
| — | LLM 기반 |
도구
도구 | 설명 |
| DB 연결 테스트; 엔진, 버전, 이름, 크기, 테이블 수 보고. |
| 행 수, 컬럼 수, 외래 키 관계를 포함한 모든 테이블 개요. |
| 단일 테이블의 전체 구조: 컬럼, 타입, 인덱스, 외래 키, 샘플 데이터. |
| 안전한 매개변수화된 SQL 쿼리를 실행하고 Markdown 결과를 얻습니다. |
| 일반 텍스트로 질문; 생성된 SQL + 결과를 얻습니다. |
| 데이터 프로파일: 분포, NULL 비율, 관계, 크기. |
| 테이블 관계의 Mermaid ER 다이어그램. |
예시: 매개변수가 있는 query
{
"sql": "SELECT * FROM users WHERE id = :id AND active = :active",
"params": "{\"id\": 42, \"active\": true}"
}매개변수는 :name 자리 표시자를 사용합니다. params에 JSON 문자열로 값을 전달하세요.
예시: natural_query
question: "How many users are there?"
-> SELECT COUNT(*) FROM users
question: "Show me all orders"
-> SELECT * FROM orders LIMIT 100소규모 샘플 데이터베이스에 대한 작동 예시는 examples/에 있으며, 일반적인 MCP 클라이언트용 즉시 사용 가능한 구성 스니펫도 함께 제공됩니다.
MCP 클라이언트 구성
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"database": {
"command": "python",
"args": ["-m", "mcp_database_universal"],
"env": {"DATABASE_URL": "sqlite:///C:/data/app.db"}
}
}
}Cursor / 기타 CLI 기반 클라이언트
{
"mcpServers": {
"database": {
"command": "uvx",
"args": ["mcp-database-universal"],
"env": {"DATABASE_URL": "sqlite:///C:/data/app.db"}
}
}
}Windows 참고: 비동기 Postgres 드라이버는 Windows 셀렉터 이벤트 루프가 필요합니다. 이 패키지는
win32에서 이 정책을 자동으로 설정하므로 추가 구성이 필요 없습니다.
개발
pip install -e ".[dev]"
pytestPostgreSQL/MySQL 통합 테스트는 Docker Compose를 사용하며, 서버에 연결할 수 없으면 자동으로 건너뜁니다:
docker compose -f tests/integration/docker-compose.yml up -d
pytest안전 모델
서버는 기본적으로 읽기 전용입니다.
INSERT/UPDATE/DELETE/DROP/ALTER및 기타 쓰기 문은 차단됩니다.쓰기는 운영자가 명시적으로
DATABASE_READ_ONLY=false및DATABASE_WRITE_ENABLED=true를 설정한 경우에만 가능합니다.쿼리 결과는 행 수, 제한 시간, 출력 크기로 제한됩니다 — 무한 실행 쿼리를 방지합니다.
라이선스
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to query and explore databases including SQLite, PostgreSQL, MySQL, and SQL Server through a secure, read-only workflow. It provides tools for listing connections, inspecting table schemas, and executing SELECT statements directly within VS Code.1
- AlicenseNot gradedqualityAmaintenanceConnect AI agents to SQL databases (SQLite, PostgreSQL, MySQL) with a unified interface for querying data, exploring schemas, inserting rows, and exporting results to CSV. Includes safety features like dangerous query blocking and write guards.13MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to connect to and interact with PostgreSQL, MySQL, SQLite, and MongoDB databases through natural language, supporting schema exploration, query execution, data export, and more.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with PostgreSQL or MySQL databases using natural language. Supports SQL queries, schema discovery, and pre-built aggregations without writing SQL.289MIT
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Give your agent live data from Twitter, Reddit, the web and GitHub. No API keys, no scraping stack.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/kobramantra-debug/mcp-database-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server