Purpose
outsource-mcp is an MCP (Model Context Protocol) server used to let AI applications outsource tasks to various model providers. It provides a unified interface so that AI tools that support MCP (such as Claude Desktop, Cline, and other MCP applications) can call external models to complete tasks such as text or image generation.
Main Capabilities
- Multi-provider support: Access 20+ AI providers through a single interface.
- Text generation: Generate text using models from providers such as OpenAI, Anthropic, Google, and others.
- Image generation: Create images using DALL-E 3 and DALL-E 2, returning the URL of the generated image.
- Simple API: Unified interface requiring only three parameters: provider, model, prompt.
- Flexible authentication: Only configure the corresponding API key for the provider you plan to use.
Usage
Add the corresponding configuration in the MCP client (environment variables are optional; only include the API keys for the providers you need to use). After configuration is complete, you can use the tools in the MCP client:
- Generate text: Use the outsource_text tool, passing provider (such as "openai"), model (such as "gpt-4o-mini"), and prompt (such as "Write a haiku about coding"). Its function is to generate a text response by creating an Agno agent through the specified provider and model. Parameter description: provider is the provider name (such as "openai", "anthropic", "google", "groq", etc.); model is the model name (such as "gpt-4o", "claude-3-5-sonnet-20241022", "gemini-2.0-flash-exp"); prompt is the text prompt sent to the model.
- Generate image: Use the outsource_image tool, passing provider (currently only "openai" is supported), model ("dall-e-3" or "dall-e-2"), and prompt, returning the URL of the generated image. Note: Imagegeneration currently only supports OpenAI models (DALL-E 2 and DALL-E 3); other providers only support text generation.
Supported Providers
Use the provider name in parentheses as the provider parameter.
Main providers:
- OpenAI (openai) — GPT-4, GPT-3.5, DALL-E, etc.
- Anthropic (anthropic) — Claude 3.5, Claude 3, etc.
- Google (google) — Gemini Pro, Gemini Flash, etc.
- Groq (groq) — Llama 3, Mixtral, etc.
- DeepSeek (deepseek) — DeepSeek Chat & Coder
- xAI (xai) — Grok models
- Perplexity (perplexity) — Sonar models
Other providers:
- Cohere (cohere) — Command models
- Mistral AI (mistral) — Mistral Large, Medium, Small
- NVIDIA (nvidia) — Multiple models
- HuggingFace (huggingface) — Open-source models
- Ollama (ollama) — Local models
- Fireworks AI (fireworks) — Fast inference
- OpenRouter (openrouter) — Multi-provider access
- Together AI (together) — Open-source models
- Cerebras (cerebras) — Fast inference
- DeepInfra (deepinfra) — Optimized models
- SambaNova (sambanova) — Enterprise-grade models
Enterprise providers:
- AWS Bedrock (aws or bedrock) — AWS-hosted models
- Azure AI (azure) — Azure-hosted models
- IBM WatsonX (ibm or watsonx) — IBM models
- LiteLLM (litellm) — Universal interface
- Vercel v0 (vercel or v0) — Vercel AI
- Meta Llama (meta) — Direct access to Meta
Each provider requires configuring the corresponding API key; you only need to configure the keys for the providers you plan to use.
Environment requirements and testing
- Python 3.11 or later
- uv package manager
You can use MCP Inspector to test the server interactively. The test suite includes integration tests to verify text and image generation; the integration tests require API keys to be set in the environment.
Common troubleshooting
- "Error: Unknown provider": Check whether you are using one of the supported provider names listed above; provider names are case-insensitive.
- "Error: OpenAI API error": Confirm that the API key in the environment variables is set correctly; check whether the key has access to the requested model; ensure there is sufficient credit/quota.
- "Error: No image was generated": This may be caused by a failed image generation request; try a simpler prompt or switch models (dall-e-2 and dall-e-3).
- Environment variables not taking effect: Restart the MCP client after updating the configuration; confirm the location of the configuration file for the corresponding MCP client; check whether the environment variable format in the configuration is correct.
Applicable scenarios and limitations
Suitable for scenarios where you need to call multiple model providers in AI tools for text or image generation, and especially suitable for users who already use MCP clients such as Claude Desktop and Cline. Limitations: image generation only supports OpenAI's DALL-E 2 and DALL-E 3, while other providers only support text generation; some providers may require an account, key, and quota. The project welcomes Pull Requests.