Skip to main content

bellwether interview

Conduct a full interview of an MCP server and generate behavioral documentation.

Synopsis

bellwether interview [options] <command> [args...]

Description

The interview command is the core of Bellwether. It connects to an MCP server, discovers its capabilities, and uses an LLM to generate intelligent test scenarios. The results are synthesized into comprehensive behavioral documentation.

The interview process includes:

  • Tool Testing: Each discovered tool is tested with multiple scenarios
  • Prompt Testing: If the server exposes prompts, they are also tested and documented
  • Resource Testing: If the server exposes resources (data sources), they are read and documented with content previews
  • Multi-Persona Analysis: Different perspectives (documentation, security, QA) provide comprehensive coverage
  • Behavioral Profiling: Results are synthesized into profiles describing expected behavior

Arguments

ArgumentDescription
<command>The command to start the MCP server
[args...]Arguments to pass to the server command

Options

Output Options

OptionDescriptionDefault
-o, --output <dir>Output directory for generated files.
--jsonAlso output JSON reportfalse
--output-format <format>Output format: markdown, json, sarif, junitmarkdown

LLM Options

OptionDescriptionDefault
--provider <provider>LLM provider: openai, anthropic, ollamaAuto-detect
--model <model>Specific model to useProvider default
-q, --quickQuick mode: 1 question, cheap modelfalse

Interview Options

OptionDescriptionDefault
--preset <preset>Use a preset configuration (see below)-
--max-questions <n>Maximum questions per tool3
--timeout <ms>Tool call timeout in milliseconds60000
--persona <personas>Comma-separated list of personasAll
-c, --config <path>Config file pathbellwether.yaml

Presets

Presets provide optimized configurations for common use cases:

PresetDescriptionPersonasQuestions
docsQuick documentation generationTechnical Writer3
securitySecurity-focused testingTechnical Writer, Security Tester3
thoroughComprehensive testingAll 4 personas5
ciFast CI/CD checksTechnical Writer1

Preset options can be overridden with explicit flags.

Baseline Options

OptionDescriptionDefault
--save-baseline [path]Save baseline for drift detection-
--compare-baseline <path>Compare against existing baseline-
--fail-on-driftExit with error if drift detectedfalse

CI/CD Options

OptionDescriptionDefault
--ciCI mode: no colors, machine-readable outputfalse
--fail-on-securityExit with error on security findingsfalse
--show-costShow LLM token usage and costfalse

Remote Server Options

OptionDescriptionDefault
--transport <type>Transport type: stdio, sse, streamable-httpstdio
--url <url>URL for remote MCP server (requires --transport sse or streamable-http)-
--session-id <id>Session ID for remote server authentication-

Custom Scenario Options

OptionDescriptionDefault
--scenarios <path>Path to custom test scenarios YAML file-
--scenarios-onlyOnly run custom scenarios (skip LLM-generated questions)false
--init-scenariosGenerate a sample bellwether-tests.yaml and exit-
Auto-detection

If a bellwether-tests.yaml file exists in the output directory, it will be automatically loaded.

Debug Options

OptionDescriptionDefault
--verboseVerbose outputfalse
--debugDebug MCP protocol messagesfalse
--log-level <level>Log level: debug, info, warn, errorinfo
--log-file <path>Write logs to file-

Examples

Basic Interview

# Interview a filesystem server
bellwether interview npx @modelcontextprotocol/server-filesystem /tmp

# Interview a memory server
bellwether interview npx @modelcontextprotocol/server-memory

Using Presets

# Quick documentation generation (recommended for first use)
bellwether interview --preset docs npx your-server

# Security-focused testing
bellwether interview --preset security npx your-server

# Comprehensive testing with all personas
bellwether interview --preset thorough npx your-server

# Fast CI/CD checks
bellwether interview --preset ci npx your-server

Custom Model and Options

bellwether interview \
--model gpt-4o \
--max-questions 5 \
--json \
npx @modelcontextprotocol/server-postgres

Override Preset Options

# Use security preset but with more questions
bellwether interview --preset security --max-questions 5 npx your-server

Quick Mode for CI

bellwether interview --quick --ci npx your-server

Save and Compare Baselines

# Create initial baseline
bellwether interview --save-baseline npx your-server

# Later, compare against baseline
bellwether interview \
--compare-baseline bellwether-baseline.json \
--fail-on-drift \
npx your-server

Security Testing

bellwether interview \
--persona security_tester \
--fail-on-security \
--output-format sarif \
-o ./security \
npx your-server

Multiple Personas

bellwether interview \
--persona technical_writer,security_tester,qa_engineer \
--max-questions 5 \
npx your-server

Remote MCP Servers

# Connect to a remote server via SSE
bellwether interview \
--transport sse \
--url https://api.example.com/mcp \
--session-id "auth-token-123"

# Connect via Streamable HTTP
bellwether interview \
--transport streamable-http \
--url https://api.example.com/mcp

Custom Test Scenarios

# Generate a sample scenarios file
bellwether interview --init-scenarios

# Run with custom scenarios (alongside LLM-generated)
bellwether interview \
--scenarios ./bellwether-tests.yaml \
npx your-server

# Run ONLY custom scenarios (no LLM generation)
bellwether interview \
--scenarios ./bellwether-tests.yaml \
--scenarios-only \
npx your-server

Exit Codes

CodeMeaning
0Success - interview completed, no issues
1Failure - behavioral drift or security issues detected
2Error - interview failed (connection, LLM, timeout)

Output Files

Depending on options, the following files may be generated:

FileDescription
AGENTS.mdHuman-readable behavioral documentation (includes tool profiles and prompt profiles)
bellwether-report.jsonMachine-readable JSON report
bellwether-baseline.jsonBaseline for drift detection
bellwether.sarifSARIF output for GitHub Code Scanning
junit.xmlJUnit XML for test runners

AGENTS.md Contents

The generated documentation includes:

  • Server Information: Name, version, protocol version
  • Quick Reference: Tool signatures and return types at a glance
  • Performance Metrics: Response times (avg/p50/p95/max) and error rates per tool
  • Tool Profiles: For each tool - description, parameters, expected behavior, edge cases
  • Prompt Profiles: For each prompt (if any) - description, arguments, expected output
  • Resource Profiles: For each resource (if any) - URI, MIME type, content preview, access patterns
  • Security Findings: Any security concerns discovered during testing
  • Custom Scenario Results: Pass/fail status for user-defined test scenarios (if provided)

Environment Variables

VariableDescription
OPENAI_API_KEYOpenAI API key
ANTHROPIC_API_KEYAnthropic API key
OLLAMA_BASE_URLOllama server URL (default: http://localhost:11434)
BELLWETHER_LOG_LEVELDefault log level

See Also