Content
# Expert MCP
> Equip your AI model with an advanced expert advisor that can be consulted at any time.
When downstream models encounter complex problems, they can forward the issues to pre-configured advanced models (such as GPT-5.5, Claude Opus 4.7, etc.) using this MCP tool,
obtain in-depth analysis and professional advice, and then provide the final answer based on their own judgment.
[](https://python.org)
[](https://modelcontextprotocol.io)
[](LICENSE)
[](https://github.com/MineJPGcraft/Expert-mcp)
---
## Features
- **OpenAI Compatible** — Connect to any OpenAI format upstream endpoint (OpenAI / DeepSeek / Qwen / vLLM / Ollama, etc.)
- **Configuration File Driven** — All parameters are centrally managed in `config.json` without modifying code
- **Streamable HTTP** — Compliant with the latest MCP standard for streamable HTTP transmission, endpoint `/mcp`
- **Rich Tool Tips** — Carefully designed `description` to guide downstream models to call at the right time
- **Three-Part Input** — `question` (required), `context` (background), `focus` (key direction)
- **Complete Logs** — Request logs + Token usage statistics for easy monitoring and troubleshooting
---
## Working Principle
```text
┌─────────────────────────────────────────────────────────┐
│ User │
└───────────────────────────┬─────────────────────────────┘
│ Asks a question
▼
┌─────────────────────────────────────────────────────────┐
│ Downstream Model (Claude / GPT / Qwen …) │
│ │
│ Encounter complex problem? → Call consult_advanced_model │
└───────────────────────────┬─────────────────────────────┘
│ MCP Streamable HTTP
▼
┌─────────────────────────────────────────────────────────┐
│ Expert MCP Server │
│ (this project server.py) │
└───────────────────────────┬─────────────────────────────┘
│ OpenAI API Request
▼
┌─────────────────────────────────────────────────────────┐
│ Upstream Advanced Model (GPT-5.5, Claude Opus 4.7 …) │
│ Returns in-depth analysis │
└─────────────────────────────────────────────────────────┘
```
---
## Quick Start
### 1. Clone Repository
```bash
git clone https://github.com/MineJPGcraft/Expert-mcp.git
cd Expert-mcp
```
### 2. Install Dependencies
```bash
pip install -r requirements.txt
```
> Recommended Python 3.10+, installation in a virtual environment is suggested.
### 3. Edit Configuration File
Copy and modify `config.json`:
```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": "You are a top-notch senior expert advisor, please conduct in-depth, rigorous, and executable analysis."
}
}
```
See [Configuration Reference](#️-configuration-reference) for configuration item descriptions.
### 4. Start Service
```bash
python server.py
```
See the following log to indicate successful startup:
```
2025-xx-xx | INFO | mcp-advisor | Upstream model: gpt-4o @ https://api.openai.com/v1
2025-xx-xx | INFO | mcp-advisor | MCP listening: http://0.0.0.0:8765/mcp
```
MCP endpoint address:
```
http://127.0.0.1:8765/mcp
```
---
## Client Access
Add the following configuration in MCP Streamable HTTP supported clients (Cherry Studio, Cline, Claude Code, etc.):
```json
{
"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 of the server and ensure the firewall allows the corresponding port.
---
## Configuration Reference
| Field | Type | Default Value | Description |
|---|---|---|---|
| `host` | string | `"0.0.0.0"` | Service listening address |
| `port` | integer | `8765` | Service listening port |
| `upstream.base_url` | string | — | Upstream API base URL (OpenAI compatible format) |
| `upstream.api_key` | string | — | Upstream API Key |
| `upstream.model` | string | — | Upstream model name, such as `gpt-5.5`, `claude-opus-4-7` |
| `upstream.temperature` | float | `0.3` | Generation temperature, recommended to keep low value for analysis tasks |
| `upstream.max_tokens` | integer | `4096` | Maximum tokens for a single response |
| `upstream.timeout` | float | `120` | Request timeout in seconds |
| `upstream.system_prompt` | string | Built-in default value | System prompt for advanced models, fully customizable |
### Switching Configuration Files Using Environment Variables
```bash
MCP_CONFIG=config.prod.json python server.py
```
---
## Tool Description
Tools callable by downstream models:
### `consult_advanced_model`
| Parameter | Type | Required | Description |
|---|---|---|---|
| `question` | string | ✅ | Core question to be consulted, as complete and clear as possible |
| `context` | string | ❌ | Background information, such as code snippets, user requirements, attempted solutions, etc. |
| `focus` | string | ❌ | Direction for advanced models to focus on answering |
**Recommended scenarios for calling:**
- Problems with less than 80% confidence
- User explicitly requires in-depth thinking / rigorous analysis / best solution
- Complex multi-constrained problems
- Mathematical, algorithmic, system design, difficult bugs that require step-by-step reasoning
- Situations where self-conclusion needs to be verified
**Scenarios not recommended for calling:**
- Simple greetings or pure information queries
- Basic questions with obvious answers
- High-frequency repeated simple tasks
---
## Upstream Service Integration
Modify the `upstream` section in `config.json` to integrate with different service providers
## Dependencies
```text
mcp>=1.2.0
openai>=1.40.0
```
---
## License
[MIT License](LICENSE) 2026 [MCJPG](https://github.com/MineJPGcraft)
Connection Info
You Might Also Like
buddy
Your persistent AI coding companion — the /buddy rescue mission. A...
Vera
Local code search combining BM25, vector similarity, and cross-encoder...
agent-base
Agent Base is a source-level research project on coding agents. It compares...
mitmproxy-mcp
MCP Server that wraps mitmproxy and exposes it as a tool to any MCP client,...
nothumanallowed
NotHumanAllowed — AI Agent Tools, CLI, Documentation & MCP Integration
bouvet
Sandbox for Agents