MU

Multi Model Advisor MCP Server Synthesizing Ollama Insights

Orchestrate queries across multiple Ollama models with an MCP server that synthesizes insights to deliver comprehensive, multifaceted AI perspectives.

Quick Install
npx -y @YuChenSSR/multi-ai-advisor-mcp

Overview

This MCP (Model Context Protocol) server acts as an orchestration layer that queries multiple Ollama-hosted models in parallel, merges their outputs, and returns a synthesized, multifaceted response. Instead of depending on a single model, the server collects insights from several specialized or differently-configured models and synthesizes their reasoning, enabling richer, more robust answers for complex prompts.

The server is useful when you want ensemble-like behavior, model comparison, or a combined perspective across models with different strengths (e.g., creativity vs. factuality). It implements a lightweight MCP interface (REST endpoints) so you can integrate it into existing apps, pipelines, or developer tooling with minimal changes.

Features

  • Parallel querying of multiple Ollama models
  • Aggregation and synthesis of model outputs (score, metadata, and combined response)
  • Configurable model lists, timeouts, and temperature per model
  • Simple REST API that follows MCP-style semantics for prompt/context exchange
  • Response provenance: keeps per-model outputs and confidence scores
  • Extendable: add new post-processors or synthesis strategies (voting, ranking, weighted averaging)
  • Optional Docker deployment for reproducible environments

Installation / Configuration

Prerequisites:

  • Ollama server reachable from this MCP server (local or remote)
  • Node.js 18+ (or the runtime specified in the repo)
  • Docker (optional)

Clone and install:

git clone https://github.com/YuChenSSR/multi-ai-advisor-mcp.git
cd multi-ai-advisor-mcp
npm install

Example .env (create a .env file in the project root):

# URL for your Ollama instance (e.g. http://localhost:11434)
OLLAMA_URL=http://localhost:11434

# Comma-separated default models to query
DEFAULT_MODELS=gpt4o-mini,assistant-small,expert-qa

# Server port
PORT=8080

# Timeout in milliseconds for each model request
MODEL_TIMEOUT_MS=12000

Start the server locally:

npm run start
# or for development with hot reload
npm run dev

Docker:

docker build -t multi-ai-advisor-mcp .
docker run -p 8080:8080 \
  -e OLLAMA_URL=http://host.docker.internal:11434 \
  -e DEFAULT_MODELS="gpt4o-mini,assistant-small" \
  multi-ai-advisor-mcp

Configuration options (typical):

  • DEFAULT_MODELS: comma-separated models used when client doesn’t specify
  • MODEL_TIMEOUT_MS: per-request timeout for each model
  • SYNTHESIS_STRATEGY: simple, weighted, consensus (determines how outputs are combined)
  • LOG_LEVEL: info/debug/error

Available Resources

API endpoints (HTTP JSON)

EndpointMethodDescription
/mcp/synthesizePOSTSend a prompt and get a synthesized multi-model response
/mcp/modelsGETList configured/default models and their status
/mcp/probeGETHealth check and Ollama connectivity test
/mcp/configGET/POSTRetrieve or update runtime synthesis configuration (admin)

Example POST /mcp/synthesize request:

POST /mcp/synthesize
Content-Type: application/json

{
  "prompt": "Summarize the key risks of using third-party AI models in production.",
  "models": ["expert-qa", "safety-checker"],
  "temperature": 0.2,
  "strategy": "weighted"
}

Example synthesized response (abridged):

{
  "synthesis": "Key risks include data leakage, model drift, and lack of explainability. Mitigations: encrypt data, monitor performance, and maintain audit trails.",
  "provenance": [
    {"model":"expert-qa","output":"...","score":0.9},
    {"model":"safety-checker","output":"...","score":0.75}
  ],
  "strategy": "weighted"
}

Other tools/resources included in the repository:

  • CLI tool for quick probing and one-off synthesize calls
  • Sample config JSON and default synthesis strategies
  • Metrics endpoint (Prometheus format) for basic observability

Use Cases

  • Multi-model comparison: compare responses from several Ollama models and surface differences for human review (useful during model evaluation).
  • Ensemble answers: synthesize outputs from creative and factual models to produce responses that are both engaging and accurate.
  • Safety and verification: run a primary model plus a safety-checker model, then synthesize and flag risky content for review.
  • Domain specialization: query a domain-specific model in parallel with a generalist model and combine the domain expertise with broader context.
  • A/B testing and monitoring: route production prompts to multiple candidate models and synthesize a “canonical” response while collecting per-model telemetry.

Concrete example — curl call:

curl -X POST http://localhost:8080/mcp/synthesize \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Explain OAuth2 flows for single-page applications.",
    "models": ["tech-explainer", "concise"],
    "strategy": "consensus"
  }'

Expected behavior: the server queries both models in parallel, computes a consensus answer (preferring overlapping assertions), and returns the synthesized explanation along with per-model outputs and confidence metadata.

Extending & Contributing

  • Add synthesis strategies under src/synthesis (voting, weighted, rank-merge)
  • Add new connectors if you use alternative model hosts besides Ollama
  • Improve scoring heuristics (e.g., semantic similarity, factuality checks)

For code, issues, and updates: https://github.com/YuChenSSR/multi-ai-advisor-mcp

License and contribution details are available in the repository.