AI-Orchestrator-MCP
Enables AI agents to interact with heterogeneous databases (MySQL, MongoDB, BigQuery) through MCP tools, allowing natural language queries and database operations.
README
AI-Orchestrator-MCP
An AI Database Assistant built with OpenAI Agents SDK and the Model Context Protocol (MCP).
This project demonstrates how to build an AI Agent capable of autonomously interacting with heterogeneous databases through modular MCP tools.
Currently supported databases:
- MySQL
- MongoDB
- Google BigQuery
Features
- OpenAI Agents SDK
- FastMCP Server
- MCP Client
- AI Database Assistant
- Automatic Tool Discovery
- SQLiteSession conversation memory
- OpenAI Tracing
- MySQL integration
- MongoDB integration
- Google BigQuery integration
- Modular architecture
- Easily extensible
Architecture
High-level overview
User
│
▼
Database Assistant
(OpenAI Agents SDK)
│
▼
SQLiteSession
│
▼
MCP Client
│
▼
MCP Server
│
┌─────────────────┼─────────────────┐
▼ ▼ ▼
MySQL Tools MongoDB Tools BigQuery Tools
│ │ │
▼ ▼ ▼
MySQL MongoDB BigQuery
Architecture Diagram
Technologies
- Python 3.13
- OpenAI Agents SDK
- FastMCP
- MCP (Model Context Protocol)
- PyMySQL
- PyMongo
- Google Cloud BigQuery
- python-dotenv
- SQLiteSession
Project Structure
AI-Orchestrator-MCP/
│
├── config/
│ ├── config.py
│ └── .env.example
│
├── db/
│ ├── mysql.py
│ ├── mongodb.py
│ └── bigquery.py
│
├── tools/
│ ├── mysql_tools.py
│ ├── mongodb_tools.py
│ └── bigquery_tools.py
│
├── tests/
├── models/
├── logs/
│
├── mcp_client.py
├── mcp_server.py
├── requirements.txt
└── README.md
Supported Databases
MySQL
- Execute SQL queries
- List databases
- List tables
- Search tables
- Describe tables
- List columns
- Show CREATE TABLE
- Count rows
- List views
- Show indexes
- Show foreign keys
- Database statistics
- Explain query
MongoDB
- List databases
- List collections
- Count documents
- Find documents
- Sample documents
Google BigQuery
- List datasets
- List tables
- Read table schema
- Execute SQL queries
How It Works
The Agent never accesses databases directly.
Workflow:
- The user submits a request.
- The Agent reasons about the request.
- The Agent selects the appropriate MCP tool.
- The MCP Client invokes the MCP Server.
- The selected tool queries the database.
- Results are returned to the Agent.
- The Agent generates the final response.
Example Conversation
User
How many collections are available in the MongoDB database "dating"?
Assistant
The database contains 24 collections including:
- users
- chats
- events
- email_logs
...
User
Describe the MySQL table users.
Assistant
The table contains the following columns:
- id
- username
- email
- created_date
...
User
List the available BigQuery datasets.
Assistant
Available datasets:
- analytics
- marketing
- reporting
...
Installation
Clone the repository:
git clone https://github.com/yourusername/AI-Orchestrator-MCP.git
Create a virtual environment:
python -m venv .venv
Activate it:
Windows
.venv\Scripts\activate
Linux / macOS
source .venv/bin/activate
Install dependencies:
pip install -r requirements.txt
Configuration
Create a .env file starting from .env.example.
Example:
DB_HOST=
DB_PORT=3306
DB_NAME=
DB_USER=
DB_PASSWORD=
MONGO_URI_ATLAS=
MONGO_URI_LOCAL=
BIGQUERY_CREDENTIALS=C:\path\credentials.json
Running the Project
Run the application:
python mcp_client.py
The client automatically starts the MCP Server and initializes the Database Assistant.
To exit:
exit
or
quit
Adding a New Database
- Add credentials to
.env. - Create a new manager in
db/. - Implement the database methods.
- Create MCP tools in
tools/. - Register the tools in
mcp_server.py. - Update the Agent instructions if needed.
- Test the manager.
- Test the tools.
- Test the Agent.
Design Principles
- Modular architecture
- Separation of concerns
- Independent tools
- Reusable components
- Extensible design
- Clean code
Roadmap
- PostgreSQL support
- Redis integration
- Snowflake integration
- Vector databases
- Automatic schema exploration
- Query planning
- Multi-Agent workflows
- RAG integration
License
MIT License
About
This project was created as a personal AI Engineering project to explore:
- OpenAI Agents SDK
- Model Context Protocol (MCP)
- AI Database Assistants
- Tool Calling
- Multi-database orchestration
- Agentic AI
The architecture has been designed to be modular, extensible and easily adaptable to additional databases and external services.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
