Skip to main content

Universal MCP server for any OpenAI-compatible LLM. Supports OpenAI and Anthropic API formats.

Project description

AgentSpawnMCP

Universal MCP server for any OpenAI-compatible LLM. Supports OpenAI and Anthropic API formats, cloud providers (OpenAI, Grok, Claude, Minimax, DeepSeek) and local models (Ollama, LM Studio, Jan). Built on FastMCP with pure httpx.

Quick Start — Spawn Agents

# No install needed — run directly with uvx
uvx agent-spawn-mcp spawn \
  --name minimax \
  --url https://api.minimax.io/anthropic/v1 \
  --token your-token \
  --model MiniMax-M2.7 \
  --api-type anthropic

Or install globally:

pip install agent-spawn-mcp
agent-spawn-mcp spawn --name minimax --url https://api.minimax.io --token TOKEN --model MiniMax-M2.7

API Types

  • --api-type openai (default) — OpenAI-compatible (chat/completions)
  • --api-type anthropic — Anthropic API (v1/messages)

URL versioning

Pass --url pointing directly at the API root. If your base URL already contains a version segment (e.g. …/paas/v4), the client will not re-append v1/. Examples:

Provider --url --api-type
OpenAI https://api.openai.com/v1 openai
Grok https://api.x.ai/v1 openai
z.ai (primary) https://api.z.ai/api/paas/v4 openai
z.ai (coding) https://api.z.ai/api/coding/paas/v4 openai
z.ai Anthropic https://api.z.ai/api/anthropic anthropic
Anthropic https://api.anthropic.com anthropic
Minimax https://api.minimax.io/anthropic/v1 anthropic

Claude Code / OpenCode Integration

Add to your .mcp.json:

{
  "mcpServers": {
    "minimax-agent": {
      "command": "uvx",
      "args": ["agent-spawn-mcp", "spawn",
               "--name", "minimax",
               "--url", "https://api.minimax.io/anthropic/v1",
               "--token", "your-minimax-token",
               "--model", "MiniMax-M2.7",
               "--api-type", "anthropic"]
    },
    "claude-agent": {
      "command": "uvx",
      "args": ["agent-spawn-mcp", "spawn",
               "--name", "claude",
               "--url", "https://api.anthropic.com",
               "--token", "your-anthropic-token",
               "--model", "claude-sonnet-4-20250514",
               "--api-type", "anthropic"]
    },
    "glm-agent": {
      "command": "uvx",
      "args": ["agent-spawn-mcp", "spawn",
               "--name", "glm",
               "--url", "https://api.z.ai/api/paas/v4",
               "--token", "your-zai-token",
               "--model", "glm-5.1"]
    },
    "glm-turbo-agent": {
      "command": "uvx",
      "args": ["agent-spawn-mcp", "spawn",
               "--name", "glm-turbo",
               "--url", "https://api.z.ai/api/paas/v4",
               "--token", "your-zai-token",
               "--model", "glm-5-turbo"]
    }
  }
}

Gotchas:

  • Each entry in .mcp.json must use a unique --name — it becomes the tool name {name}_agent, and duplicates collide.
  • --token on the command line is visible in ps output and some crash logs. Prefer keeping the MCP config file read-protected (chmod 600).

Tools Exposed

  • {name}_agent(task, model?, system_prompt?, temperature?, max_tokens?, timeout?) — Spawn agent
  • agent_info() — Get provider info

Return Format

{
    "result": "...",  # Agent response text
    "metadata": {
        "provider": "minimax",
        "model_used": "MiniMax-M2.7",
        "usage": {"prompt_tokens": 100, "completion_tokens": 500},
        "latency_ms": 2340
    }
}

AgentSpawnMCP — Full Server

Full MCP server with all tools (chat, vision, files, search, agent). Requires git clone.

git clone https://github.com/sandsaber/AgentSpawnMCP
cd AgentSpawnMCP
uv sync
cp example.env .env
# Edit .env with your tokens

uv run python main.py main --provider grok

Auto-Discovery

Providers auto-detected when env var is set:

Env Var Provider
XAI_TOKEN Grok
OPENAI_TOKEN OpenAI
GROQ_TOKEN Groq
DEEPSEEK_TOKEN DeepSeek
ZAI_TOKEN z.ai (GLM)

Available Tools (Full Server)

Tool Description
list_providers All discovered providers
list_models Models for the active provider
chat Text completion with session history
stateful_chat Server-side conversation
chat_with_vision Analyze images (jpg/jpeg/png)
generate_image Create or edit images (OpenAI-format only)
upload_file / list_files / get_file_content / delete_file File management
chat_with_files Chat with documents
web_search Agentic web search
code_executor Execute code
agent Unified agent
list_chat_sessions / get_chat_history / clear_chat_history Session history

Image generation support

generate_image targets the OpenAI /images/generations request shape (model / prompt / n / image_url). Providers that expose the same shape (OpenAI dall-e-3, Grok grok-imagine-image) work out of the box.

Providers with custom image APIs are not currently supported:

  • z.ai (glm-image, cogview-4-250304) expects quality / size / user_id at /paas/v4/images/generations, not the OpenAI shape.
  • Anthropic-compat endpoints don't expose image generation at all.

For these, use the provider's native HTTP API directly.

License

MIT License

Copyright (c) 2025 Michael Makarov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_spawn_mcp-1.1.0.tar.gz (67.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_spawn_mcp-1.1.0-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file agent_spawn_mcp-1.1.0.tar.gz.

File metadata

  • Download URL: agent_spawn_mcp-1.1.0.tar.gz
  • Upload date:
  • Size: 67.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for agent_spawn_mcp-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0a4fa05e084b532517d5952d0ddc70d2cdbb2e5fd1b88b4832fb38d76f90eb2f
MD5 2458b759775a5644fd36b97845552f51
BLAKE2b-256 d5b73ccca5a6e25930b5c3aa3f2c11be1e2d1133120cc17db33036ea88f88fea

See more details on using hashes here.

File details

Details for the file agent_spawn_mcp-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: agent_spawn_mcp-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for agent_spawn_mcp-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e54a0ad40ea3fbacc26b77ab0e96f0c4f55e76df57eac383c82de11fd706be57
MD5 803af065f6060efdf2bd9ed75b358b4a
BLAKE2b-256 73a1c5961027262e942df30c1f814fe99e44075f2a4084cde03c2b7bb9761a17

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page