Skip to main content
Glama

๐Ÿง  Expert MCP

Equip your AI model with an "on-call" senior expert consultant.

When downstream models encounter complex problems, they can use this MCP tool to forward the query to a pre-configured advanced model (e.g., GPT-5.5, Claude Opus 4.7, etc.) to obtain deep analysis and professional advice, then combine it with their own judgment to provide a final answer.

Python MCP License GitHub


โœจ Features

  • ๐Ÿ”Œ OpenAI Compatible โ€” Connects to any upstream endpoint in OpenAI format (OpenAI / DeepSeek / Qwen / vLLM / Ollama, etc.)

  • โš™๏ธ Config-Driven โ€” All parameters are centrally managed in config.json, no code changes required

  • ๐Ÿ“ก Streamable HTTP โ€” Compliant with the latest MCP standard for streaming HTTP transport, endpoint /mcp

  • ๐Ÿ› ๏ธ Rich Tool Prompts โ€” Carefully designed description to guide downstream models to call at the right time

  • ๐Ÿงฉ Three-Part Input โ€” question (required), context (background), focus (key areas)

  • ๐Ÿ“Š Full Logging โ€” Request logs + Token usage statistics for easy monitoring and troubleshooting


Related MCP server: Consult LLM MCP

๐Ÿ—๏ธ How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      ็”จๆˆท (User)                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚ ๆ้—ฎ
                            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              ไธ‹ๆธธๆจกๅž‹ (Claude / GPT / Qwen โ€ฆ)            โ”‚
โ”‚                                                         โ”‚
โ”‚   ้‡ๅˆฐๅคๆ‚้—ฎ้ข˜๏ผŸโ†’ ่ฐƒ็”จ consult_advanced_model ๅทฅๅ…ท       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚ MCP Streamable HTTP
                            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   Expert MCP Server                     โ”‚
โ”‚               (ๆœฌ้กน็›ฎ server.py)                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚ OpenAI API ่ฏทๆฑ‚
                            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         ไธŠๆธธ้ซ˜็บงๆจกๅž‹ (GPT-5.5ใ€Claude Opus 4.7 โ€ฆ)      โ”‚
โ”‚                   ่ฟ”ๅ›žๆทฑๅบฆๅˆ†ๆžๆ„่ง                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ฆ Quick Start

1. Clone the repository

git clone https://github.com/MineJPGcraft/Expert-mcp.git
cd Expert-mcp

2. Install dependencies

pip install -r requirements.txt

Python 3.10+ is recommended; installation within a virtual environment is suggested.

3. Edit the configuration file

Copy and modify config.json:

{
  "host": "0.0.0.0",
  "port": 8765,
  "upstream": {
    "base_url": "https://api.openai.com/v1",
    "api_key": "sk-xxxxxxxxxxxxxxxxxxxx",
    "model": "gpt-5.5",
    "temperature": 0.3,
    "max_tokens": 4096,
    "timeout": 120,
    "system_prompt": "ไฝ ๆ˜ฏไธ€ไฝ้กถๅฐ–็š„่ต„ๆทฑไธ“ๅฎถ้กพ้—ฎ๏ผŒ่ฏทๅฏน้—ฎ้ข˜่ฟ›่กŒๆทฑๅ…ฅใ€ไธฅ่ฐจใ€ๅฏๆ‰ง่กŒ็š„ๅˆ†ๆžใ€‚"
  }
}

See โš™๏ธ Configuration Reference below for details on configuration items.

4. Start the service

python server.py

Successful startup is indicated by the following logs:

2025-xx-xx | INFO    | mcp-advisor | ไธŠๆธธๆจกๅž‹: gpt-4o @ https://api.openai.com/v1
2025-xx-xx | INFO    | mcp-advisor | MCP ็›‘ๅฌ: http://0.0.0.0:8765/mcp

MCP endpoint address:

http://127.0.0.1:8765/mcp

๐Ÿ”ง Client Integration

Add the following configuration in clients that support MCP Streamable HTTP (Cherry Studio, Cline, Claude Code, etc.):

{
  "mcpServers": {
    "expert-advisor": {
      "type": "streamableHttp",
      "url": "http://127.0.0.1:8765/mcp"
    }
  }
}

Remote deployment? Replace 127.0.0.1 with the actual IP or domain name of the server and ensure the corresponding port is open in the firewall.


โš™๏ธ Configuration Reference

Field

Type

Default

Description

host

string

"0.0.0.0"

Service listening address

port

integer

8765

Service listening port

upstream.base_url

string

โ€”

Base URL of the upstream API (OpenAI compatible format)

upstream.api_key

string

โ€”

Upstream API Key

upstream.model

string

โ€”

Upstream model name, e.g., gpt-5.5, claude-opus-4-7

upstream.temperature

float

0.3

Generation temperature; lower values are recommended for analytical tasks

upstream.max_tokens

integer

4096

Maximum tokens per response

upstream.timeout

float

120

Request timeout in seconds

upstream.system_prompt

string

Built-in default

System prompt for the advanced model, fully customizable

Switch configuration files using environment variables

MCP_CONFIG=config.prod.json python server.py

๐Ÿ› ๏ธ Tool Description

Tools available for downstream models to call:

consult_advanced_model

Parameter

Type

Required

Description

question

string

โœ…

The core question to consult, keep it complete and clear

context

string

โŒ

Background information, such as code snippets, user requirements, attempted solutions, etc.

focus

string

โŒ

The direction you want the advanced model to focus on

Recommended scenarios for calling:

  • Problems where your own confidence is < 80%

  • User explicitly requests deep thinking / rigorous analysis / best practices

  • Multi-constraint problems involving complex trade-offs

  • Mathematics, algorithms, system design, or difficult bugs requiring step-by-step reasoning

  • Situations where you need to verify your own conclusions

Scenarios not recommended:

  • Simple greetings or pure information lookups

  • Basic questions with obvious answers

  • High-frequency, repetitive simple tasks


๐ŸŒ Connecting to Upstream Services

Simply modify the upstream section in config.json to connect to different service providers.

๐Ÿ“‹ Dependencies

mcp>=1.2.0
openai>=1.40.0

๐Ÿ“„ License

MIT License ยฉ 2026 MCJPG

Related MCP Connectors

Related MCP Servers