Catalog PyPI
Back to packageRELEASE DETAILS

2.0.0

PyPI

agent-spawn-mcp

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

agentanthropicllmmcpopenaiuniversal
Published14 May 2026
Direct dependencies6
Transitive dependenciesNot calculated

README

Version 2.0.0 documentation

AgentSpawnMCP

AgentSpawnMCP routing tasks to multiple model agents

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
export MINIMAX_TOKEN=your-token
uvx agent-spawn-mcp spawn \
  --name minimax \
  --url https://api.minimax.io/anthropic/v1 \
  --token-env MINIMAX_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-env MINIMAX_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
OpenAIhttps://api.openai.com/v1openai
Grokhttps://api.x.ai/v1openai
z.ai (primary)https://api.z.ai/api/paas/v4openai
z.ai (coding)https://api.z.ai/api/coding/paas/v4openai
z.ai Anthropichttps://api.z.ai/api/anthropicanthropic
Anthropichttps://api.anthropic.comanthropic
Minimaxhttps://api.minimax.io/anthropic/v1anthropic

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).

Codex CLI Integration

Codex can register stdio MCP servers with codex mcp add.

For a Minimax Anthropic-compatible agent:

export MINIMAX_TOKEN=your-minimax-token

codex mcp add minimax-agent -- \
  uvx agent-spawn-mcp spawn \
    --name minimax \
    --url https://api.minimax.io/anthropic/v1 \
    --token-env MINIMAX_TOKEN \
    --model MiniMax-M2.7 \
    --api-type anthropic

For z.ai GLM through the OpenAI-compatible API:

export ZAI_TOKEN=your-zai-token

codex mcp add glm-agent -- \
  uvx agent-spawn-mcp spawn \
    --name glm \
    --url https://api.z.ai/api/paas/v4 \
    --token-env ZAI_TOKEN \
    --model glm-5.1

Verify the registration:

codex mcp list
codex mcp get minimax-agent

Restart Codex from a shell where the token env var is set. The tool exposed to Codex is named from --name, for example minimax_agent or glm_agent.

If you need Codex to store the env var with the MCP server config, add --env MINIMAX_TOKEN="$MINIMAX_TOKEN" before --. This is convenient, but it stores the secret in Codex config. Passing --token directly also works, but stores the token in the command args.

Tools Exposed

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

max_tokens behaviour

The client imposes no cap. Behaviour when max_tokens is omitted depends on --api-type:

  • openai — the field is simply not sent; the provider falls back to its own default (usually the model's full output budget). Reasoning models like GLM-5.x can burn huge amounts on chain-of-thought, so pass an explicit limit for short tasks.

  • anthropic — the Anthropic API requires the field, so when you omit it the client fills in a safe default of 16384. Override when you need more or want to cap spend:

    claude_agent(task="summarise this PR")                    # uses 16384
    claude_agent(task="exhaustive review", max_tokens=64000)  # bigger
    claude_agent(task="ping",              max_tokens=256)    # cheaper
    

    Typical values:

    Use casemax_tokens
    Short answer / ping1024
    Summary / routine agent run4096
    Code generation / long task8192
    Default (if omitted)16384
    Exhaustive analysis32000+

    Upper bound is model-specific (Claude Sonnet 4 — 64k, Opus 4 — 32k, GLM-4.5-Air — 8k, etc.). Pass max_tokens explicitly up to that limit.

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 VarProvider
XAI_TOKENGrok
OPENAI_TOKENOpenAI
GROQ_TOKENGroq
DEEPSEEK_TOKENDeepSeek
ZAI_TOKENz.ai (GLM)

Available Tools (Full Server)

ToolDescription
list_providersAll discovered providers
list_modelsModels for the active provider
chatText completion with session history
stateful_chatServer-side conversation
chat_with_visionAnalyze images (jpg/jpeg/png)
generate_imageCreate or edit images (OpenAI-format only)
upload_file / list_files / get_file_content / delete_fileFile management
chat_with_filesChat with documents
web_searchAgentic web search
code_executorExecute code
agentUnified agent
list_chat_sessions / get_chat_history / clear_chat_historySession 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) 2026 Michael Makarov.

See LICENSE for the full license text.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 6

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
httpx
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.11",
  "evaluation": "NOT_EVALUATED"
}
httpx>=0.28.1runtime
mcp
Environment
{
  "extras": "cli",
  "marker": null,
  "requires_python": ">=3.11",
  "evaluation": "NOT_EVALUATED"
}
mcp[cli]>=1.13.1runtime
pydantic
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.11",
  "evaluation": "NOT_EVALUATED"
}
pydantic>=2.9.0runtime
python-dotenv
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.11",
  "evaluation": "NOT_EVALUATED"
}
python-dotenv>=1.0.1runtime
pyyaml
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.11",
  "evaluation": "NOT_EVALUATED"
}
pyyaml>=6.0.2runtime
typer
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.11",
  "evaluation": "NOT_EVALUATED"
}
typer>=0.21.0runtime

Distribution files

2 collected
agent_spawn_mcp-2.0.0-py3-none-any.whl

bdist_wheel · 28.23 KB · Python py3

Source file
agent_spawn_mcp-2.0.0.tar.gz

sdist · 1,279.81 KB · Python source

Source file

Repository

PENDING
sandsaber/agentspawnmcp

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:27 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:815c804a39ca757e1d569b25213ad292b4e9d3de0a925ac7e162c19011e39778

Other collected versions

View all collected versions →