Bellwether

Open-source CLI for testing MCP servers and detecting schema drift

Bellwether

Build Status npm version Documentation License: MIT PRs Welcome

The open-source MCP testing tool. Catch drift before your users do.

What is MCP? MCP (Model Context Protocol) is how AI assistants like Claude connect to external tools—read files, query databases, call APIs. When those tool schemas change, AI workflows break silently.

Why Bellwether?

MCP servers expose tools with JSON schemas. When those schemas change—a parameter renamed, a type modified, a tool removed—AI agents break silently. Bellwether catches these changes before they reach production.

ProblemSolution
Breaking changes slip into productionDrift detection catches schema changes in CI
No standard for MCP testingNative MCP support understands tools, prompts, resources
Manual testing misses edge casesAutomated exploration covers what humans miss
Documentation gets staleCONTRACT.md generated from actual behavior

Quick Start

npm install -g @dotsetlabs/bellwether
bellwether init npx @mcp/your-server
bellwether check

That's it. No API keys. No LLM costs. Runs in seconds.

Product Focus

Bellwether is intentionally opinionated:

  • Core workflow (default): init -> check -> baseline
  • Advanced workflow (opt-in): explore, watch, discover, golden, contract, registry

If you only need CI-safe drift detection, you can stay entirely in the core workflow.

Two Modes

ModePurposeCostWhen to Use
checkSchema drift detectionFreeCI/CD, every PR
exploreLLM-powered behavioral testingLLM API costsLocal dev, deep analysis

Most users only need check. It's deterministic, fast, and catches the changes that break AI agents.

CI/CD Workflow

Store your baseline in git. Run checks in CI. No account needed.

# 1. Initialize and save baseline (one-time setup)
bellwether init npx @mcp/your-server
bellwether check
bellwether baseline save
git add bellwether.yaml bellwether-baseline.json
git commit -m "Add Bellwether baseline"
# 2. Add to CI (.github/workflows/bellwether.yml)
name: MCP Drift Detection
on: [pull_request]

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npx @dotsetlabs/bellwether check --fail-on-drift

What It Detects

ChangeExampleSeverity
Tool added/removeddelete_file appears or disappearsBreaking
Schema changedParameter path becomes requiredBreaking
Parameter renamedpath to file_pathBreaking
Description changedTool help text updatedWarning
Performance regressionLatency increased >10%Warning
Tool annotations changedreadOnlyHint flipped to falseWarning
Output schema changedReturn type structure modifiedWarning
Entity title changedTool/prompt/resource title updatedInfo
Task support changedExecution mode switched to asyncWarning
Server instructions changedServer-level instructions updatedInfo
Prompt added/removedPrompt template appears or disappearsBreaking
Resource changedResource URI or MIME type modifiedWarning

Comparisons are protocol-version-aware — version-specific fields (annotations, titles, output schemas, etc.) are only compared when both baselines support the relevant MCP protocol version.

Command Tiers

Core Commands (Recommended)

CommandPurpose
initCreate bellwether.yaml
checkDeterministic schema drift detection
baseline saveSave snapshot for future comparisons
baseline compareCompare latest check output to saved baseline

Advanced Commands (Optional)

CommandPurpose
exploreLLM behavioral testing and AGENTS.md generation
watchContinuous checking on file changes
discoverCapability inspection without tests
registrySearch MCP Registry
goldenGolden output regression testing
contractContract validation and generation
authManage LLM provider API keys
validate-configValidate bellwether.yaml without running tests

CI/CD Exit Codes

CodeMeaningSuggested Action
0No changesPass
1Info-level changesPass or warn
2Warning-level changesWarn
3Breaking changesFail
4Runtime errorFail
5Low confidence metricsWarn or fail

GitHub Action

- uses: dotsetlabs/bellwether@v2.1.3
  with:
    version: '2.1.3'
    server-command: 'npx @mcp/your-server'
    baseline-path: './bellwether-baseline.json'
    fail-on-severity: 'warning'

Configuration

All settings live in bellwether.yaml. Create one with presets:

bellwether init npx @mcp/your-server           # Default (free, fast)
bellwether init --preset ci npx @mcp/server    # Optimized for CI/CD
bellwether init --preset local npx @mcp/server # Local Ollama (free)

For remote MCP servers that require auth headers, configure:

server:
  transport: sse
  url: "https://api.example.com/mcp"
  headers:
    Authorization: "Bearer ${MCP_SERVER_TOKEN}"

Or use one-off CLI overrides:

bellwether check -H "Authorization: Bearer $MCP_SERVER_TOKEN"

Environment Variables

VariableDescription
OPENAI_API_KEYOpenAI API key (explore only)
ANTHROPIC_API_KEYAnthropic API key (explore only)
OLLAMA_BASE_URLOllama URL (default: http://localhost:11434)

Documentation

docs.bellwether.sh — Full reference for configuration and commands.

Project Governance

Community

Development

git clone https://github.com/dotsetlabs/bellwether
cd bellwether
npm install
npm run build
npm test

License

MIT License - see LICENSE for details.


Related Servers