Files
OpenCode Test f63172c4cf feat(external-llm): standardize tiers and optimize model selection
- Rename tiers: opus/sonnet/haiku → frontier/mid-tier/lightweight
- Align with industry benchmarks (MMLU, GPQA, Chatbot Arena)
- Add /external command for LLM mode control
- Fix invoke.py timeout passthrough (now 600s default)

Tier changes:
- Promote gemini-2.5-pro to frontier (benchmark-validated)
- Demote glm-4.7 to mid-tier then removed (unreliable)
- Promote gemini-2.5-flash to mid-tier

New models added:
- gpt-5-mini, gpt-5-nano (GPT family coverage)
- grok-code (Grok/X family)
- glm-4.5-air (lightweight GLM)

Removed (redundant/unreliable):
- o3 (not available)
- glm-4.7 (timeouts)
- gpt-4o, big-pickle, glm-4.5-flash (redundant)

Final: 11 models across 3 tiers, 4 model families

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 03:30:51 -08:00
..

MCP Integrations

Model Context Protocol servers and delegation helpers.

Directory Structure

mcp/
├── gmail/              # Gmail OAuth setup and venv
│   ├── venv/           # Python virtual environment
│   └── ...
└── delegation/         # Tiered delegation helpers
    ├── gmail_delegate.py
    └── gcal_delegate.py

Gmail Integration

Setup

The Gmail integration uses a Python virtual environment with gmail-mcp:

# Create venv (one time)
cd ~/.claude/mcp/gmail
python3 -m venv venv
source venv/bin/activate
pip install gmail-mcp

# Credentials
# OAuth credentials at: ~/.gmail-mcp/credentials.json
# Token cached at: ~/.gmail-mcp/token.json

Usage

Skills reference the venv directly:

~/.claude/mcp/gmail/venv/bin/python script.py

Delegation Helpers

Helpers that implement tiered model delegation:

Helper Purpose Tiers
gmail_delegate.py Gmail operations Haiku (list), Sonnet (summarize)
gcal_delegate.py Calendar operations Haiku (list), Sonnet (analyze)

Pattern

GMAIL_PY=~/.claude/mcp/gmail/venv/bin/python
HELPER=~/.claude/mcp/delegation/gmail_delegate.py

# Haiku tier - no LLM, just fetch
$GMAIL_PY $HELPER check-unread --days 7

# Sonnet tier - spawns claude --model sonnet
$GMAIL_PY $HELPER summarize --query "from:github.com"

Adding MCP Servers

For proper MCP servers (vs. delegation helpers):

  1. Create server in mcp/server-name/
  2. Add to .mcp.json or plugin.json:
{
  "mcpServers": {
    "server-name": {
      "command": "node",
      "args": ["${CLAUDE_PLUGIN_ROOT}/mcp/server-name/index.js"]
    }
  }
}

Note

Current integrations use direct Python API calls rather than MCP protocol. This works but doesn't leverage MCP's tool registration and permissions.

Future improvement: Convert to proper MCP servers.