AI-Orchestrator-MCP

AI-Orchestrator-MCP

Enables AI agents to interact with heterogeneous databases (MySQL, MongoDB, BigQuery) through MCP tools, allowing natural language queries and database operations.

Category
Visit Server

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

Architecture

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:

  1. The user submits a request.
  2. The Agent reasons about the request.
  3. The Agent selects the appropriate MCP tool.
  4. The MCP Client invokes the MCP Server.
  5. The selected tool queries the database.
  6. Results are returned to the Agent.
  7. 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

  1. Add credentials to .env.
  2. Create a new manager in db/.
  3. Implement the database methods.
  4. Create MCP tools in tools/.
  5. Register the tools in mcp_server.py.
  6. Update the Agent instructions if needed.
  7. Test the manager.
  8. Test the tools.
  9. 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured