MCP Gateway
by 3thanol4
README.md
# ๐ Enterprise Model Context Protocol (MCP) Agent Framework
[](https://opensource.org/licenses/Apache-2.0)
[](https://www.python.org/downloads/)
[](https://modelcontextprotocol.io)
[](https://www.undp.org)
> An open-standard, production-grade **Model Context Protocol (MCP)** implementation and **Multi-Server Gateway** designed for enterprise agentic workflows, dynamic tool discovery, and vendor-agnostic AI orchestration.
---
## ๐ Executive Summary
Modern AI systems require seamless, reliable, and standardized communication with external software tools, databases, and enterprise workspaces. Traditional integrations suffer from brittle hardcoded bindings and proprietary vendor lock-in.
This repository implements the **Model Context Protocol (MCP)** โ the emerging industry standard for connecting AI models to contextual tools and external APIs:
* **Zero-Hardcoding**: Tools are declared with strict JSON Schema definitions and discovered dynamically at runtime via `/tools/list`.
* **Central MCP Gateway**: Aggregates distributed MCP servers, manages namespacing, handles route dispatching, and exports standardized function definitions for any Large Language Model (Anthropic Claude, OpenAI, Gemini, Groq, Llama).
* **Enterprise Productivity Adapters**: Built-in modules for real-time web intelligence, document parsing (PDF/RAG), calendar scheduling, and email communication.
* **Alignment with Digital Public Goods & Open Standards**: Fully open-source, modular, and privacy-first architecture suitable for public sector organizations (e.g., United Nations, UNDP), multilateral agencies, and global enterprises.
---
## ๐ Architecture Overview
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LLM / AGENTIC ORCHESTRATOR โ
โ (OpenAI, Anthropic Claude, Gemini, Groq, Llama) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Dynamic Tool Call (JSON Schema)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP SERVER GATEWAY โ
โ - Multi-server Discovery & Schema Aggregation โ
โ - Namespacing & Collision Avoidance โ
โ - Fault-tolerant Fallback & In-Memory Routing โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTP Stream / JSON-RPC โ HTTP Stream / JSON-RPC
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CORE WORKSPACE SERVER โ โ WEB INTELLIGENCE SERVER โ
โ - Meeting & Calendar Sync โ โ - Live DuckDuckGo / Tavily Search โ
โ - Email Dispatch โ โ - Source Extraction & Verification โ
โ - Drive / Document Parsing โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
---
## ๐ Key Capabilities
| Tool / Capability | Protocol Action | Description |
| :--- | :--- | :--- |
| **`web_search`** | `tools/call` | Real-time web intelligence and reference gathering with structured citations. |
| **`parse_document`** | `tools/call` | Extracts structured text and metadata from PDF, Markdown, and TXT files for RAG pipelines. |
| **`schedule_meeting`** | `tools/call` | Creates calendar events with automated virtual meeting room generation. |
| **`send_email`** | `tools/call` | Drafts and dispatches communications with structured recipients and audit logs. |
| **`list_drive_files`** | `tools/call` | Navigates hierarchical enterprise repositories and file trees. |
| **MCP Gateway** | `tools/list` | Dynamic aggregation bus with automated conversion to LLM function calling schemas. |
---
## ๐ Quickstart in 60 Seconds
### 1. Clone & Set Up Environment
```bash
# Clone the repository
git clone https://gitlab.com/your-username/mcp-agent-showcase.git
cd mcp-agent-showcase
# Create and activate virtual environment
python -m venv .venv
# On Linux/macOS: source .venv/bin/activate
# On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
```
### 2. Run the Interactive End-to-End Demo
Execute the self-contained demonstration script:
```bash
python quickstart_demo.py
```
This script automatically:
1. Spawns the MCP Server in the background.
2. Initializes the MCP Gateway and discovers published tools dynamically.
3. Generates the exact JSON Schemas used for LLM Function Calling.
4. Executes a full 4-step automated agentic workflow (Web Search โ Document Parsing โ Meeting Scheduling โ Email Confirmation).
---
## ๐ฆ Project Structure
```text
mcp-agent-showcase/
โโโ mcp_server.py # Core MCP Server (FastMCP / JSON-RPC endpoints)
โโโ mcp_gateway.py # Central Gateway aggregating multiple MCP servers
โโโ quickstart_demo.py # End-to-end multi-step workflow demonstration
โโโ requirements.txt # Minimal, clean Python dependencies
โโโ .env.example # Configuration template
โโโ LICENSE # Apache 2.0 Open Source License
โโโ tools/ # Standardized tool adapters
โ โโโ __init__.py
โ โโโ web_search.py # DuckDuckGo search integration
โ โโโ document_parser.py # Text and PDF extractor for RAG
โ โโโ workspace_tools.py # Email, Calendar, Drive & Sheets adapters
โโโ tests/ # Automated verification suite
โโโ __init__.py
โโโ test_mcp_gateway.py # Gateway and tool schema validation tests
```
---
## ๐งช Testing & Verification
Run automated test suites using `pytest`:
```bash
pytest tests/ -v
```
All tool schemas, parameter validation, and gateway registry mappings are verified to ensure deterministic execution.
---
## ๐ Strategic Relevance for Multilateral Agencies (e.g., UNDP)
* **Open Standards & Digital Public Goods**: Fully compliant with open protocol definitions, preventing dependence on proprietary walled gardens.
* **Administrative Automation**: Streamlines reporting, multi-stakeholder meeting scheduling, and document synthesis.
* **Security & Transparency**: Deterministic JSON Schemas provide auditable boundaries for AI tool execution, enabling human-in-the-loop oversight.
---
## ๐ License
This project is licensed under the **Apache License 2.0**. See the [LICENSE](LICENSE) file for details.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues