AI Orchestration MCP Server
Provides tools to send prompts to Google Gemini models via API and list available models, enabling delegation of multimodal, research, and creative tasks.
Provides tools to send prompts to local Ollama models and list available models, enabling free, private, low-latency task delegation.
Provides tools to send prompts to OpenAI models such as GPT-4o-mini via API and list available models, enabling delegation of complex reasoning, production code, and detailed analysis.
Click on "Deploy 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., "@AI Orchestration MCP Server Send this refactor to my local model, then have gpt-4o-mini review it"
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.
AI Orchestration MCP Server
Production-grade Model Context Protocol (MCP) server for orchestrating multiple AI providers. Intelligently delegate tasks to local models (Ollama, llama.cpp) or cloud providers (OpenAI, Anthropic, Gemini) to optimize cost and performance.
β¨ Features
π Secure by Design: No shell injection vulnerabilities - uses HTTP APIs and official SDKs
π 5 AI Providers: Ollama, Gemini, OpenAI, Anthropic, llama.cpp
βοΈ Flexible Configuration: File-based config with environment variable support
π Comprehensive Logging: Structured logging with sensitive data redaction
π Request History: Track all requests and responses in JSONL format
π³ Docker Ready: One-command deployment with docker-compose
π Plugin Architecture: Easily add new providers
π‘οΈ Input Validation: Comprehensive sanitization and validation
π¦ TypeScript: Full type safety with strict mode
Related MCP server: MCP Gateway
π Quick Start
Option 1: Docker Hub (Easiest)
# Pull the image
docker pull adakrupp/ai-orchestration-mcp:latest
# Download docker-compose.yml
curl -O https://raw.githubusercontent.com/adakrupp/ai-orchestration-mcp/main/docker-compose.yml
# Start services
docker compose up -d
# View logs
docker compose logs -f ai-orchestration-mcpThat's it! The server is now running with Ollama and ready to use with Claude Code.
Option 2: Build from Source
# Clone repository
git clone https://github.com/adakrupp/ai-orchestration-mcp.git
cd ai-orchestration-mcp
# One-command setup
./docker-setup.sh
# View logs
docker compose logs -f ai-orchestration-mcpπ See DOCKER.md for complete Docker documentation.
Option 3: Local Installation
# Clone and install
git clone https://github.com/adakrupp/ai-orchestration-mcp.git
cd ai-orchestration-mcp
npm install
# Build
npm run build
# Configure
cp config/ai-orchestration.example.json config/ai-orchestration.json
# Edit config/ai-orchestration.json with your settings
# Test
npm testπ Table of Contents
π¦ Installation
Prerequisites
Node.js 18+ (or Docker)
One or more AI providers:
Ollama: Install from ollama.ai
OpenAI: Get API key from platform.openai.com
Anthropic: Get API key from console.anthropic.com
Gemini: Get API key from ai.google.dev
llama.cpp: Run llama.cpp server
Installation Methods
Docker Hub (Recommended)
docker pull adakrupp/ai-orchestration-mcp:latestSee DOCKER.md for complete Docker deployment guide.
Docker Build from Source
See DOCKER.md for building from source.
NPM Installation
# Install dependencies
npm install
# Install optional peer dependencies (as needed)
npm install openai @anthropic-ai/sdk
# Build TypeScript
npm run buildβοΈ Configuration
Configuration File
Create config/ai-orchestration.json:
{
"version": "1.0",
"server": {
"name": "ai-orchestration-mcp",
"version": "2.0.0",
"logLevel": "info",
"historyEnabled": true
},
"providers": {
"ollama": {
"enabled": true,
"baseUrl": "http://localhost:11434",
"models": {
"coder": "qwen2.5-coder:7b",
"general": "qwen2.5:7b"
}
},
"openai": {
"enabled": true,
"apiKey": "${OPENAI_API_KEY}",
"defaultModel": "gpt-4o-mini"
}
},
"security": {
"maxPromptLength": 100000,
"maxResponseLength": 500000
}
}Environment Variables
Create .env file:
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=...Configuration Discovery
The server searches for configuration in this order:
--configCLI argumentAI_ORCHESTRATION_CONFIGenvironment variable./config/ai-orchestration.json(project directory)~/.config/ai-orchestration/config.json(user config)Built-in defaults
π― Usage with Claude Code
Method 1: Docker
Update your .mcp.json:
{
"mcpServers": {
"ai-orchestration": {
"command": "docker",
"args": ["exec", "-i", "ai-orchestration-mcp", "node", "dist/index.js"]
}
}
}Method 2: Local
{
"mcpServers": {
"ai-orchestration": {
"command": "node",
"args": ["/absolute/path/to/ai-orchestration-mcp/dist/index.js"]
}
}
}Available Tools
Once configured, Claude Code will have access to these tools:
For each enabled provider:
use_<provider>: Send a query to the provideruse_ollama model="qwen2.5:7b" prompt="Explain async/await in JavaScript"list_<provider>_models: List available modelslist_ollama_models
Example Usage
User: "Use Ollama to explain what a Docker container is"
Claude: I'll use the local Ollama model for this task.
[Calls use_ollama with qwen2.5:7b]
User: "Now use OpenAI to write production-grade documentation for it"
Claude: I'll use OpenAI for the comprehensive documentation.
[Calls use_openai with gpt-4o-mini]π€ Providers
Ollama (Local Models)
Best for: Simple tasks, code analysis, quick questions
β Free (runs locally)
β Privacy (data stays local)
β Fast (low latency)
β Requires local resources
β Limited compared to cloud models
Setup:
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Pull models
ollama pull qwen2.5:7b
ollama pull qwen2.5-coder:7bOpenAI
Best for: Complex reasoning, production code, detailed analysis
β Powerful models (GPT-4, GPT-4o)
β Good for coding tasks
β Function calling support
β Costs per token
β Data sent to OpenAI
Setup:
npm install openai
# Add to .env
OPENAI_API_KEY=sk-...Anthropic (Claude)
Best for: Long context tasks, analysis, complex reasoning
β Large context windows (200k tokens)
β Strong reasoning capabilities
β Good safety guardrails
β Costs per token
β Data sent to Anthropic
Setup:
npm install @anthropic-ai/sdk
# Add to .env
ANTHROPIC_API_KEY=sk-ant-...Gemini
Best for: Multimodal tasks, web research, creative writing
β Multimodal (text + images)
β Free tier available
β Fast responses
β Less suitable for code
β Data sent to Google
Setup:
# Install Gemini CLI
# See: https://github.com/google/gemini-cli
# Add to .env
GEMINI_API_KEY=...llama.cpp (Local HTTP Server)
Best for: Custom local models, complete privacy
β Run any GGUF model
β Complete privacy
β Customizable
β Manual setup required
β Resource intensive
Setup:
# Run llama.cpp server
./server -m model.gguf --port 8080ποΈ Architecture
βββββββββββββββββββββββββββββββββββββββ
β Claude Code (Client) β
ββββββββββββββββ¬βββββββββββββββββββββββ
β MCP Protocol
β (stdio)
ββββββββββββββββΌβββββββββββββββββββββββ
β AI Orchestration MCP Server β
β β
β βββββββββββββββββββββββββββββββ β
β β Provider Registry β β
β βββββββββββββββββββββββββββββββ β
β β
β ββββββββ ββββββββββ ββββββββββββ β
β βOllamaβ β OpenAI β βAnthropic β β
β ββββ¬ββββ βββββ¬βββββ ββββββ¬ββββββ β
βββββββΌββββββββββΌββββββββββββΌβββββββββ
β β β
βΌ βΌ βΌ
HTTP API REST API REST APIKey Components
Server: MCP protocol handler, routes requests to providers
Provider Registry: Manages all AI providers
Providers: Individual integrations (Ollama, OpenAI, etc.)
Config Loader: Loads and validates configuration
Logger: Structured logging with sensitive data redaction
History Tracker: Records all requests/responses
Security Features
β No Shell Injection: Uses HTTP APIs and spawn() without shell
β Input Validation: Comprehensive sanitization of all inputs
β API Key Redaction: Never logs sensitive credentials
β Type Safety: Full TypeScript with strict mode
β Rate Limiting: Optional rate limiting per provider
β Max Length Limits: Prevents oversized inputs/outputs
π οΈ Development
Setup Development Environment
# Install dependencies
npm install
# Run in dev mode (with auto-reload)
npm run dev
# Type check
npm run type-check
# Lint
npm run lint
# Format code
npm run formatTesting
# Run all tests
npm test
# Unit tests only
npm run test:unit
# Integration tests
npm run test:int
# Coverage report
npm run test:coverageAdding a New Provider
Create provider directory:
src/providers/myprovider/ βββ index.ts # Provider implementation βββ client.ts # API clientImplement BaseProvider:
export class MyProvider extends BaseProvider { readonly name = 'myprovider'; readonly capabilities = { /* ... */ }; async listModels(): Promise<string[]> { /* ... */ } async execute(request: ProviderRequest): Promise<ProviderResponse> { /* ... */ } async validateConfig(): Promise<boolean> { /* ... */ } }Register in
src/index.ts:if (config.providers.myprovider?.enabled) { const provider = new MyProvider(config.providers.myprovider); registry.register(provider); }Add configuration types in
src/types/config.tsAdd tests in
tests/unit/providers/myprovider.test.ts
π Security
Reporting Vulnerabilities
Please report security vulnerabilities via GitHub Security Advisories or by opening a private issue.
Security Best Practices
API Keys: Store in environment variables, never commit
Configuration: Use
.gitignoreto exclude config filesUpdates: Keep dependencies up to date (
npm audit)Logs: Review logs for sensitive data exposure
Rate Limiting: Enable for production deployments
Security Audit
# Check for vulnerabilities
npm audit
# Fix vulnerabilities
npm audit fixπ€ Contributing
Contributions are welcome!
Contribution Guide
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Make your changes
Add tests
Run tests and linting (
npm test && npm run lint)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
MCP Protocol by Anthropic
Ollama for local model serving
All contributors to this project
π Documentation
Docker Deployment Guide - Complete guide for Docker deployment
Example Configuration - Configuration file reference
π¬ Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Documentation: Full Docs
Made with β€οΈ for the AI community
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
Maintenance
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
AI model routing on your own vendor keys: pick the best model per prompt, or route and run it.
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
One API key for every AI model, routed to the cheapest provider. OpenAI-compatible.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA unified local API gateway providing caching, rate limiting, and full Model Context Protocol compatibility for AI agent integration. It enables users to aggregate multiple API endpoints into a single gateway with built-in observability and customizable eviction strategies.-
- AlicenseNot gradedqualityDmaintenanceA production-ready unified entry point for AI agents that implements the Model Context Protocol (MCP). It provides a secure gateway with rate limiting, authentication, and observability for managing and proxying requests to multiple downstream APIs.MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server for LLM fuzzing and testing, providing secure access to multiple AI providers through a standardized interface.-
- FlicenseNot gradedqualityDmaintenanceA production-ready Model Context Protocol server built with Python and FastMCP, featuring modular architecture, centralized tool registration, Docker support, and a suite of utility tools for AI applications.3-