Multi-Provider LLM MCP Server
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., "@Multi-Provider LLM MCP Server Review this Python code using Gemini and Claude for consensus."
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.
Multi-Provider LLM MCP Server
An official Model Context Protocol (MCP) server that exposes a unified, secure routing interface to query multiple Large Language Model (LLM) providers. Built on top of TypeScript, it dynamically integrates with Google Gemini, OpenAI, Anthropic Claude, Cohere, Groq, Mistral AI, and OpenRouter using a modular Strategy Pattern.
This server enables agentic IDE clients (such as Claude Desktop, Cursor, Windsurf, or GitHub Copilot) to switch models dynamically based on task requirements, evaluate model outputs, and optimize API costs.
1. Why This Server? (Key Use Cases)
This MCP server goes beyond basic completions. It empowers your AI assistants with the following advanced capabilities:
π Cross-Model Consensus Code Auditing (Multi-Model Voting)
Security and logic flaws can easily be missed by a single LLM. By invoking the query_llm tool across multiple providers (e.g. OpenAI, Anthropic, Gemini) on the same code snippet, your IDE agent can compare outputs:
How it works: The agent sends the same prompt to GPT-4o, Claude 3.5 Sonnet, and Gemini 2.5. If two out of three models flag a potential SQL injection or logic bug, the agent warns you before deploying.
π LLM-as-a-Judge (Automated Quality Evaluation)
Build automated feedback loops inside your workspace:
How it works: Model A (OpenAI) writes a function. Model B (Anthropic) generates unit test cases. Model C (Gemini) evaluates both the implementation and test coverage, grading the overall solution and suggesting improvements.
π Fallback Resilience & High-Availability Routing
API rate limits, service-specific outages, or server lag can interrupt automated coding workflows:
How it works: If an API call to OpenAI fails or hits a rate limit, the routing service can dynamically catch the error and retry the query with Anthropic or Gemini, keeping your developer loop uninterrupted.
π Cost-Optimized Context Compression (Token Optimization)
LLM costs scale with context size. Sending large files directly to high-reasoning models like Claude 3.5 Sonnet can quickly become expensive:
How it works: Send massive logs or document dumps to a fast, cost-efficient model (such as Groq/Llama-3 or Gemini Flash) first. Instruct it to compress the information into a concise summary, and then send that summary to Claude for final refactoring.
π Privacy Redaction & PII Pre-Filtering
When working with sensitive projects, sending raw user data or company secrets directly to closed-source proprietary APIs poses security risks:
How it works: Route raw user messages to a local or open-source model (via Groq/Mistral) to redact secrets, keys, or PII (personally identifiable information) before forwarding the sanitized input to external proprietary models.
π Synthetic Dialogue Simulation (Agent-User Mocking)
Testing interactive chatbot features requires realistic dialogues:
How it works: Prompt one model (e.g. Mistral) to act as a difficult customer and another (e.g. GPT-4o-mini) to act as the support representative. You can simulate multi-turn chats automatically to test error handling, response times, and chat flows.
Related MCP server: cloud-chat-assistant
2. Architecture & Design Patterns
The server is designed using the Strategy Pattern and a Central Registry to ensure clean separation of concerns and effortless extensibility:
src/
βββ index.ts # Transport Bootstrapper
βββ server.ts # MCP Tool Definition & Schema Validation
βββ services/
βββ types.ts # Common contracts and LLMProvider interface
βββ llm.ts # Central Provider Registry
βββ providers/ # Individual Provider Clients (Strategies)
βββ gemini.ts
βββ openai.ts
βββ anthropic.ts
βββ cohere.ts
βββ groq.ts
βββ mistral.ts
βββ openrouter.tsEvery provider implements the LLMProvider contract:
export interface LLMProvider {
name: string;
defaultModel: string;
envKey: string;
query(params: QueryLLMParams): Promise<QueryLLMResult>;
}Adding New Providers
To support a new provider, you do not need to modify the server routing logic:
Create a new provider file under
src/services/providers/your_provider.tsimplementingLLMProvider.Register it in
src/services/llm.ts.
3. Tool Interface
The server registers two primary tools with your MCP client:
1. query_llm
Query any supported LLM provider with a prompt.
provider(Required):"gemini"|"openai"|"anthropic"|"cohere"|"groq"|"mistral"|"openrouter".prompt(Required): The input message.apiKey(Optional): API Token. Falls back to environment variables if omitted.model(Optional): Specific model name. Defaults to a sensible model if omitted.systemPrompt(Optional): Guiding system context.temperature(Optional): Controls randomness (0.0to2.0).maxTokens(Optional): Max tokens to generate.responseFormat(Optional):"text"(raw completion),"json_object"(strictly JSON), or"detailed"(returns markdown reporting execution time, provider metadata, and token usage).chatHistory(Optional): Array of previous message history objects[{ role: "user" | "assistant", content: "..." }].
2. list_providers
Lists status of all LLM providers, including default models, required environment keys, and if keys are set.
4. Installation & Configurations
Detailed templates for setting up this server in popular IDEs and clients are located in the sample_mcp_configs directory:
Publishing to NPM
To publish this package publicly under your scope, run:
npm publish --access publicOnce published, users can configure their MCP client command to npx with args ["-y", "@abhishek-kumar-00019/llm-mcp-server"].
Available Tools
2 toolslist_providersA
Check status of all LLM providers, showcasing default models, required environment keys, and if keys are set.
Inputs: no named parameters.
query_llmB
Query a supported LLM provider (Gemini, OpenAI, Anthropic, Cohere, Groq, Mistral, OpenRouter) with a prompt and retrieve the model response.
Inputs: prompt (required), provider (required), model, apiKey, +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 2 tools
Both tools serve entirely distinct purposes: querying a model vs. listing providers. No overlap or confusion possible.
Both tools use a consistent verb_noun pattern in snake_case: query_llm and list_providers. Perfectly uniform.
Only two tools, which is minimal but reasonable for a simple query-and-status server. Not overly sparse, but barely adequate.
Covers the two core needs: querying and checking provider availability. Missing advanced features like dynamic key management or model selection, but acceptable for a minimal interface.
Maintenance
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that functions as an intelligent gateway for multiple LLM backends including OpenAI, Claude, and Ollama. It supports automatic provider fallback, streaming responses via Server-Sent Events, and real-time monitoring for robust AI integration.MIT
- FlicenseNot gradedqualityCmaintenanceMulti-cloud MCP server that exposes cloud AI models as tools for AI CLI agents, supporting streaming, conversation history, parallel multi-model queries, and dynamic model discovery.2-
- FlicenseCqualityDmaintenanceAn MCP server that routes LLM requests across multiple providers and orchestrates other MCP servers, with a focus on local privacy for embeddings and memory.283-
- AlicenseNot gradedqualityDmaintenanceMCP server that enables agents to dynamically switch between multiple AI models (OpenAI, Anthropic, Google, etc.) with unified protocol-driven configuration and capability discovery.Apache 2.0