MCP Agent Gateway
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Agent Gatewayrun a codebase health check on my project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Problem Solved
AI agents need to interact with local tools (filesystem, terminal, database), but every integration requires custom glue code. MCP provides a standard protocol, but existing implementations are either too heavy or lack performance optimization.
This project delivers: A ready-to-run MCP gateway + Agent scheduling system with 14 built-in tools, 3-layer performance optimization, and 65% latency reduction.
Related MCP server: slop-mcp
Quick Start
git clone https://github.com/wuwo1979/agent.git
cd agent
pip install -r requirements.txt
# Run demo (recommended first)
python demo.py
# Run benchmarks
python main.py --benchmark
# Start gateway
python main.py --host 0.0.0.0 --port 9090Benchmark Results
Metric | Result | Target | Status |
Token Compression | 49.5% | >35% | PASS |
Parallel Speedup | 2.8x | >1.4x | PASS |
Latency Reduction | 64.4% | >40% | PASS |
Context Compression | 99.1% | - | PASS |
Cache Hit Rate | 37.5% | - | PASS |
Architecture
User/App -> MCP Gateway (JSON-RPC 2.0) -> 14 Built-in Tools
|
Supervisor-Worker <- LangGraph
|
Performance: Cache | Parallel | AdapterMCP Gateway Layer
Standard JSON-RPC 2.0 with
initialize/tools/list/tools/call3 built-in Providers: Filesystem(5), Terminal(3), Database(5)
Plugin-based
BaseToolProviderfor custom toolsSecurity: API Key auth + token-bucket rate limiting + tool permissions
Agent Scheduling Layer
Supervisor-Worker pattern: 1 coordinator + 3 specialized Workers
Task DAG decomposition -> topological sort parallel -> result validation
Retry (exponential backoff x3) + circuit breaker + checkpoint resume
Performance Layer
Incremental context cache: content hash dedup + LRU, 49.5% token reduction
Parallel scheduler: topological sort layers, 64.4% latency reduction
Multi-model adapter: DeepSeek-V4 / Ollama / vLLM unified interface
Demo Output
$ python demo.py
================================================================
MCP Gateway + Multi-Agent: Codebase Health Check
================================================================
Scenario: Developer needs to analyze a Python project
- 14 Python files across 4 modules
- Without MCP: 5+ custom scripts, 3 tool integrations
- With MCP: 1 unified pipeline, 3 lines of config
[1] Creating test codebase (14 Python files)...
OK Created 14 files, 402 total lines
[2] Registering MCP tool providers...
OK 3 providers, 11 tools ready
[3] Testing individual MCP tools...
OK list_dir found 4 items (2.9ms)
OK read_file 683 chars (2.3ms)
OK sysinfo windows (245.9ms)
OK run_command 'hello' (182.1ms)
[5] Performance analysis...
Cache hit rate: 66.7%
================================================================
Results Summary
================================================================
Tools registered | 14 | 3 providers
Cache hit rate | 66.7% | repeated reads use cache
Files analyzed | 14 | 402 lines, 5 with TODOsProject Structure
agent/
├── mcp_gateway/ # MCP Gateway Layer
│ ├── protocol.py # Protocol core + ToolRegistry
│ ├── transport.py # HTTP/SSE/STDIO transport
│ ├── server.py # Production gateway entry
│ ├── security.py # Auth + rate limiting
│ └── tools/ # 14 built-in tools
│ ├── filesystem.py # Filesystem (5 tools)
│ ├── terminal.py # Terminal (3 tools)
│ └── database.py # Database (5 tools)
├── agent_scheduler/ # Agent Scheduling Layer
│ ├── graph.py # LangGraph workflow
│ ├── supervisor.py # Supervisor-Worker pattern
│ ├── state.py # State + snapshot management
│ ├── retry.py # Retry + circuit breaker
│ └── agents/ # 3 Worker agents
│ ├── planner.py # Task decomposition
│ ├── executor.py # Tool execution
│ └── validator.py # Result verification
├── performance/ # Performance Layer
│ ├── cache.py # Incremental context cache
│ ├── parallel.py # Parallel scheduler + DAG
│ └── adapter.py # Multi-model adapter
├── core/ # Infrastructure
│ ├── types.py # Data types
│ ├── interfaces.py # Abstract interfaces
│ ├── exceptions.py # Error hierarchy
│ └── observability.py # Metrics + health check
├── docker/ # Docker deployment
│ ├── Dockerfile
│ └── docker-compose.yml
├── tests/ # Tests
│ ├── test_mcp.py # 10 MCP tests
│ ├── test_agent.py # 12 Agent tests
│ └── benchmark.py # 5 benchmarks
├── docs/ # Documentation
│ ├── MCP Protocol.md
│ ├── A2A Protocol.md
│ ├── LangGraph Guide.md
│ ├── Performance.md
│ └── Interview Prep.md
├── demo.py # Demo script
├── main.py # Entry point
└── requirements.txtTech Stack
Category | Technology |
Protocol | MCP + JSON-RPC 2.0 |
Orchestration | LangGraph (StateGraph + Checkpoint) |
LLM | DeepSeek-V4 / Ollama / vLLM |
Vector DB | ChromaDB / Milvus |
Deployment | Docker Compose (7 services) |
Testing | pytest + asyncio |
2026 Protocol Alignment
Trend | Status |
MCP Streamable HTTP | Implemented |
A2A Agent Collaboration | Architecture compatible |
Progressive Discovery | Planned |
Programmatic Tool Calling | Implemented |
Structured Output | Implemented |
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/wuwo1979/agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server