Uses python-dotenv for configuration management, allowing users to customize database connections, AI providers, and server settings through environment variables.
Provides a REST API interface for database operations, allowing HTTP-based access to all database querying capabilities through dedicated endpoints.
Enables querying MySQL databases using both direct SQL execution and natural language queries, with support for retrieving database information, table schemas, and executing complex SQL operations.
Integrates with Ollama for local AI model execution to convert natural language queries into SQL, offering offline database query capabilities through local LLM inference.
Utilizes Rich for enhanced terminal UI with improved formatting and visual presentation of database query results in the command-line interface.
Leverages SQLAlchemy for database connection pooling, query execution, and ORM capabilities to interact with MySQL databases safely and efficiently.
Offers a web-based user interface for interacting with the database, visualizing query results, and providing a graphical alternative to command-line operations.
Database Hub MCP (Model Context Protocol)
이 프로젝트는 자연어 쿼리를 사용하여 MySQL, PostgreSQL, Oracle 등 다양한 데이터베이스와 상호작용할 수 있는 지능형 데이터베이스 허브입니다. MCP(Model Context Protocol)를 기반으로 구축되었으며, 여러 AI Provider(Groq, Ollama, LM Studio, Google Gemini)를 통해 자연어를 SQL로 변환하는 기능을 제공합니다.
🚀 주요 기능
- 다중 데이터베이스 지원: MySQL, PostgreSQL, Oracle 데이터베이스에 연결하고 쿼리를 실행합니다.
- 자연어 쿼리: 사용자의 자연어 질문을 AI가 이해하고 SQL로 변환하여 데이터베이스에 질의합니다.
- 다중 AI Provider 지원: Groq, Ollama, LM Studio, Google Gemini 등 다양한 LLM Provider를 선택하여 사용할 수 있습니다.
- MCP 및 HTTP 서버: MCP 프로토콜을 지원하는 서버와 테스트 및 연동을 위한 HTTP API 서버를 모두 제공합니다.
- 에이전트 기반 아키텍처: Google ADK 기반의 AI 에이전트를 통해 확장 가능한 기능을 제공합니다.
📂 프로젝트 구조
🛠️ 설치 및 설정
1. 사전 요구사항
- Python 3.9 이상
- Git
2. 프로젝트 클론 및 가상환경 설정
3. 의존성 설치
참고: 특정 데이터베이스 사용 시 추가 드라이버 설치가 필요할 수 있습니다. (psycopg2-binary
for PostgreSQL, cx_Oracle
for Oracle)
4. 환경변수 설정
프로젝트 루트 디렉토리에 .env
파일을 생성하고, 각 컴포넌트의 .env.example
파일을 참고하여 아래와 같이 환경 변수를 설정합니다.
주요 설정 파일:
app_mcp_server/env.example
: 메인 서버(DB, AI Provider) 설정mcp_agents_adk/db_hub_agent/env.example
: AI 에이전트 설정
.env
파일 예시:
▶️ 실행 방법
run_cmd
디렉토리의 배치 스크립트를 사용하여 각 컴포넌트를 실행할 수 있습니다.
- HTTP 서버 실행 (REST API 테스트용)
- MCP 서버 실행 (MCP 클라이언트 연결용)
- MCP 에이전트 실행 (콘솔)
⚙️ 주요 컴포넌트 설명
1. app_mcp_server
- 프로젝트의 핵심 백엔드 서버입니다.
- HTTP Server: RESTful API를 제공하여 외부 애플리케이션과의 연동을 지원합니다. (자연어 쿼리, DB 스키마 조회 등)
- MCP Server: MCP 표준을 준수하는 클라이언트(예: Cursor)와 통신합니다.
2. mcp_agents_adk
- Google Agent Development Kit (ADK)를 사용하여 구현된 AI 에이전트입니다.
- MCP 서버와 통신하며, 설정된 AI Provider(Gemini, Groq 등)를 통해 복잡한 추론 및 작업을 수행합니다.
3. app_client
- 서버의 기능을 테스트하기 위한 샘플 클라이언트입니다.
client_app.py
: 콘솔 기반 클라이언트client_web.py
: 웹 기반 클라이언트 (Streamlit 사용)
📄 라이선스
이 프로젝트는 MIT 라이선스를 따릅니다.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Model Context Protocol server that enables natural language querying of MySQL databases, supporting both HTTP-based communication and MCP stdio protocol.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that enables natural language queries to MySQL databases, powered by XiYanSQL text-to-SQL technology.Last updated -197Apache 2.0
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI models to interact with MySQL databases through a standardized interface, providing tools for querying, executing commands, and managing database schemas.Last updated -7
- -securityFlicense-qualityA Model Context Protocol server that enables AI models to interact with MySQL databases through natural language, supporting SQL queries, table creation, and schema exploration.Last updated -3