Skip to main content
Glama
README.md
# ๐ŸŒ Enterprise Model Context Protocol (MCP) Agent Framework

[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python: 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)
[![Protocol: Model Context Protocol](https://img.shields.io/badge/Protocol-MCP-orange.svg)](https://modelcontextprotocol.io)
[![Standard: Open Interoperability](https://img.shields.io/badge/Standard-Open_Standards-green.svg)](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.