llm-api-facade
Routes completion and streaming requests to Gemini through a dedicated adapter, translating parts-based content, model roles, functionCall detection, header-based API keys, and normalized errors.
Routes local completion and streaming requests to Ollama models through the OpenAI-compatible adapter; always enabled and supports sampling parameters, tool calling, structured output, and content blocks.
Routes completion and streaming requests to OpenAI models through the OpenAI-compatible adapter, supporting sampling parameters, tool calling, structured JSON output, content blocks, and normalized errors.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
llm-api-facade
An MCP server that provides a universal abstraction layer for interacting with any LLM backend -- local or cloud -- through a single, stable interface.
What It Does
One MCP server surface. Any LLM behind it. The consumer sends a generation request using a normalized vocabulary. The facade routes it to whichever backend is configured, translating parameters and response shapes as needed.
The architecture has two layers:
Layer 1 (Universal): Normalized types, provider-agnostic. Messages, content blocks, token usage, generation parameters, error taxonomy. Works without knowing which provider serves the request.
Layer 2 (Extensions): Structured, typed, discoverable provider-specific features. Cache control, safety settings, reasoning configuration, structured output guarantees, token breakdowns.
Related MCP server: yuntu-mcp-server
Quick Start
npm install
npm run buildThe server communicates via stdio. Add it to your MCP client config:
{
"mcpServers": {
"server": {
"command": "node",
"args": ["/path/to/llm-api-facade/dist/index.js"]
}
}
}Or install as a Claude Code plugin from the RedJay marketplace.
Provider Configuration
Providers auto-register when their env vars are set. Ollama is always on.
Provider | Env Var | Adapter |
Ollama (local) | Always on | OpenAI-compat |
OpenAI |
| OpenAI-compat |
Anthropic |
| Dedicated |
Google Gemini |
| Dedicated |
Cohere |
| Dedicated |
Mistral |
| OpenAI-compat |
xAI (Grok) |
| OpenAI-compat |
vLLM |
| OpenAI-compat |
LM Studio |
| OpenAI-compat |
llama.cpp |
| OpenAI-compat |
MCP Tools
Tool | Description |
| Send messages to any LLM, receive a completion. Supports tools, structured output, all sampling parameters. |
| Streaming variant. Returns accumulated chunks with usage. |
| List configured providers. |
The Seam
The architecture enforces a clean boundary -- the seam -- between two zones:
Consumer Side | THE SEAM | Provider Side
Layer 1: Universal | Normalizes | Provider-specific SDKs
Layer 2: Extensions | Organizes | Native API formats
Typed errors | | Raw error responses
Capability discovery | | Feature negotiationLayer 1 normalizes (many shapes into one). Layer 2 organizes (provider-specific features into typed, discoverable extensions). Infrastructure concerns (auth, retry, transport) never cross the seam.
Current State
Implemented and tested (50 scenarios across Ollama + OpenAI):
Text completion (batch and streaming)
All sampling parameters (temperature, top_p, frequency/presence penalty, seed, stop sequences)
Tool calling (single-turn, multi-turn with results, multiple tools, correct tool selection)
Structured output (JSON mode, JSON Schema with constrained output)
Content block model (TextBlock, ToolUseBlock, ToolResultBlock, ThinkingBlock, ImageBlock)
Error taxonomy (4 genera, 14 species)
Adapters (all 11 providers covered):
OpenAI-compatible adapter: Ollama, OpenAI, Mistral, xAI, vLLM, LM Studio, llama.cpp
Anthropic adapter: system-as-parameter, content blocks, role compression, named SSE streaming
Gemini adapter: parts-based content, "model" role, functionCall detection, API key in header
Cohere adapter: flat response, uppercase finish reasons, named SSE events
Not yet implemented:
Extension system (cache_control, safety_settings, reasoning_config, structured_output, token_details)
MCP resources (models://catalog, config://state, session://{id})
validate_request, estimate_tokens, get_model_info tools
Documentation
Documentation/
Architecture/
Principles.md # 8 governing principles (dual-layer)
DomainModel.md # Universal concepts, behavioral contracts, the seam
McpServerSpec.md # MCP tools, resources, schemas, error codes (v0.3.0)
OntologicalTaxonomy.md # Categorical framework, cross-validated
TypeSpecification.md # Formal types, 48+ invariants, state machine
SoftSpots.md # 13 resolved weak points with positions taken
ToolCallingChoreography.md # Multi-turn tool flows, 7-dimension provider divergence
PositionPaper-*.md # Facade as information architecture
ExtensionCatalog.md # 5 extensions with schemas and adapter tables
Decisions/
ADR-001 through ADR-007 # Architecture decision records
Vendors/
OpenAI, Anthropic, Gemini, Mistral/Cohere/xAI, Local RuntimesLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Connect MCP clients to 2,000+ AI models without managing provider API keys.
Text generation over MCP: prose, emails, blog outlines, SQL, humanizing, text diffs, fake data.
Call AI by role, not by model: tiered AI gateway over REST and MCP.
Related MCP Servers
- FlicenseAqualityDmaintenanceUnified MCP server for querying multiple LLM providers (Gemini, OpenAI, Anthropic, etc.) with advanced routing, cost optimization, and fallback resilience.2-
- FlicenseAqualityDmaintenanceEnables LLM chat with routing and failover, balance checking, and model listing via MCP.3-
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible applications to interact with local and cloud-hosted LLM models for model management, text generation, chat, embeddings, and web search/fetch.727 npmAGPL 3.0
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible applications to manage local and cloud language models, run text generation and chat, generate embeddings, and perform web search and content fetching.727 npmAGPL 3.0