Agent Exchange
A persistent multi-provider MCP chat server for talking to other AI models through their APIs.
Send a message to Anthropic, OpenAI, or xAI models and receive a reply.
Start new conversations or continue existing ones by
conversation_id, with history saved to disk.Switch provider or model between turns, even mid-conversation.
Set a system prompt when starting a conversation.
Control reply length with
max_tokensand Anthropic thinking effort witheffort(low–max).List configured providers, default models, and whether API keys are set.
List saved conversations with ID, turn count, and system prompt.
Delete a conversation and its history with
reset_conversation.README also documents
server_infofor config diagnostics, but it is not present in the provided schema.
Allows chatting with OpenAI models via the Chat Completions API, with configurable model and base URL settings and persistent multi-turn conversation history.
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., "@Agent Exchange ask claude to plan a 3-day trip to kyoto, then get grok's take"
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.
Agent_Exchange_MCP
An MCP server that lets an AI client (Claude Code, Claude Desktop, …) talk to other AI models through their APIs. Supports Anthropic, OpenAI and xAI, with multi-turn conversations saved to disk.
Features
Multiple providers — Anthropic (Claude), OpenAI, xAI (Grok). Choose the provider from the client UI, and switch it per call, even mid-conversation.
Multi-turn conversations — history is kept per
conversation_id.Persistent — each conversation is a JSON file on disk and survives server restarts.
Simple config — API keys and models live in a
.envfile.
Related MCP server: Multi-CLI MCP
Installation
Requires Python 3.11+.
git clone https://github.com/cat-people-82/Agent_Exchange_MCP.git
cd Agent_Exchange_MCP
pip install -e .
cp .env.example .env # then add your API keysConfiguration
Settings are read from .env in the project root (or the current directory, or the file named by AGENT_EXCHANGE_ENV_FILE). Real environment variables take precedence over .env. .env is git-ignored — never commit it.
Variable | Default | Purpose |
|
| Where conversations are saved |
| – / | Anthropic credentials and default model |
| – / | OpenAI settings |
| off | Set |
| – / | xAI settings |
Provider selection is not configured here — it happens in the client (see below). .env only holds API keys, models and the data directory. You only need keys for the providers you use. Adjust the default OpenAI/xAI model IDs to whatever your account offers.
Register with an MCP client
Claude Code:
claude mcp add agent-exchange -- agent-exchange-mcpClaude Desktop — edit claude_desktop_config.json (Settings → Developer → Edit Config). command must be an executable (not the path to server.py), so point it at the Python interpreter of the environment where you ran pip install -e . and run the package as a module:
{
"mcpServers": {
"agent-exchange": {
"command": "/absolute/path/to/Agent_Exchange_MCP/.venv/bin/python",
"args": ["-m", "agent_exchange_mcp"]
}
}
}Tips:
Create the environment first:
python3 -m venv .venv && .venv/bin/pip install -e .(find an existing interpreter's path withwhich pythonwhile its environment is active).Claude Desktop doesn't inherit your shell environment; keys are read from the project's
.env, or pass them via an"env": { "ANTHROPIC_API_KEY": "..." }entry.Fully quit and reopen Claude Desktop after editing the config. Logs are in
~/Library/Logs/Claude/mcp-server-agent-exchange.log.
Tools
Tool | Description |
| Send a message and get the reply. Omit |
| Configured providers, default models, and whether a key is set. |
| Diagnose config: which |
| Saved conversations (id, turns, system prompt). |
| Delete a conversation. |
chat returns {conversation_id, provider, model, reply}.
Example flow: ask Claude a question, then continue the same conversation with provider: "xai" to get Grok's take with the full history.
Choosing a provider
The provider is picked in your MCP client, not in config:
chathas aproviderparameter (anthropic|openai|xai), which clients show as a choice list and which the calling model or you can set.If it is omitted when starting a conversation and more than one provider has an API key, the server asks you to choose through the client's prompt (MCP elicitation, supported by clients such as Claude Code).
If the client doesn't support elicitation, or only one provider has a key, the first provider with a key is used.
A continued conversation keeps its last provider unless you pass a different one.
Storage
Conversations are stored as <conversation_id>.json (system prompt + message list) in the data directory. Files are plain text and contain your prompts and replies, so protect the directory accordingly. Delete a conversation with reset_conversation or by removing its file.
Troubleshooting
has_api_key: false— callserver_infoto see which.envfiles were checked. Sandboxed clients may not let the server read the project folder; set the keys in the client's environment-variable settings instead. Config is read at startup, so reconnect after changes.Could not reach the <provider> API: Connection error— the client app may export proxy variables (ALL_PROXY,HTTPS_PROXY) that point at a proxy this process can't reach.server_infoshows them underproxy_env. If the machine can reach the API directly, setAGENT_EXCHANGE_IGNORE_PROXY=true.Using SOCKS proxy, but 'socksio' is not installed— reinstall (pip install -e .);socksiois a dependency.SSLCertVerificationError: ('OSStatus -26276',)(macOS) — the SDK default client verifies through the OS trust store (httpx 2.x usestruststore, which calls the Security framework) and that can fail even for a valid public certificate. Both client factories therefore verify againstcertifi; override withAGENT_EXCHANGE_CA_BUNDLEif you sit behind a TLS-terminating proxy whose CA is not in certifi.A sandboxed client may offer no direct egress. If
AGENT_EXCHANGE_IGNORE_PROXY=trueproducesnodename nor servname provided, the proxy is the only route out — leave the flag off. WhereALL_PROXYis SOCKS but only the HTTP proxy serves, the server rewrites the catch-all to the HTTP proxy at startup and reports it assocks_fallbackinserver_info; disable withAGENT_EXCHANGE_SOCKS_FALLBACK=false.
Notes
If a provider call fails, the turn is not saved, so history stays consistent.
Anthropic calls use adaptive thinking and streaming; OpenAI and xAI use the Chat Completions API.
Available Tools
4 toolschatA
Send a message to another AI model and get its reply.
Omit conversation_id to start a new conversation; pass the returned conversation_id to continue it (history is saved to disk, and you may switch provider between turns).
Args: message: The user message. conversation_id: Continue an existing conversation. provider: Provider to use. If omitted: a continued conversation keeps its last provider; a new one asks the user to choose (via the client UI when supported). model: Model ID override for this turn. system: System prompt (only applied when starting a conversation). max_tokens: Maximum tokens in the reply. effort: Thinking effort (Anthropic only; ignored by other providers).
Inputs: message (required), model, effort, system, +3 more.
list_conversationsA
List active conversations (id, turn count, system prompt).
Inputs: no named parameters. Returns: result
list_providersA
List configured providers, their default models, and whether an API key is set.
Inputs: no named parameters. Returns: result
reset_conversationC
Delete a conversation and its history.
Inputs: conversation_id (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
chat is the sole action tool, while list_providers, list_conversations, and reset_conversation are clearly scoped to different resources. There is no meaningful overlap between messaging and conversation/provider management.
Three tools follow a clear verb_noun pattern (list_providers, list_conversations, reset_conversation), but chat is a single-word noun/verb that breaks the pattern slightly. The set remains readable and predictable overall.
Four tools cleanly cover the server's narrow scope: sending messages, discovering providers, inspecting conversations, and deleting a conversation. No tool feels redundant, and the set is not bloated.
Core conversation lifecycle is covered (start/continue/delete/list) and providers can be listed. However, there is no get_conversation or history-retrieval tool, and provider/model management is read-only, leaving minor gaps.
Maintenance
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
Cloud-hosted MCP server for durable AI memory
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Shared memory and mail for your AI agents. Verified with Claude Code; other MCP clients in testing.
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
- FlicenseAqualityDmaintenanceAn MCP server that bridges multiple AI clients (Claude, Gemini, Codex, OpenCode) so they can call each other as tools.1139 npm76-
- -licenseNot gradedqualityNot gradedmaintenanceAn MCP server that enables multiple AI models (Claude, ChatGPT, Gemini) to share and persist context via a local-first vault of markdown files and SQLite index, allowing seamless cross-AI memory.-
- AlicenseNot gradedqualityDmaintenanceA production-ready MCP server for persistent AI memory across LLMs like Claude and ChatGPT. Provides automatic conversation backup, multi-user support, and multi-storage (PostgreSQL, Redis, Qdrant).11 npm14MIT