Thank you for your interest in contributing! This guide will help you add scenarios, MCP configurations, and improvements to the benchmark.
Context Bench is designed for easy contribution - most additions require no code changes. You can add scenarios and MCP configurations by adding YAML files and oracle implementations.
Context Bench organizes scenarios by AI framework packages. Choose an existing package or create a new one:
Existing packages:
autogen- Microsoft Autogenlanggraph- LangGraph by LangChainopenai-agents- OpenAI Agents SDKagno- Agno frameworkopenrouter-sdk- OpenRouter SDK
Edit scenarios/{package}.yaml or create a new one:
package-id: my-framework
name: My AI Framework
registry: py_pi # or npm for TypeScript packages
context7-id: /org/my-framework # Context7 library identifier
deepcon-id: my-framework # Deepcon package name (optional)
scenarios:
- id: streaming-agent
query: |
Using the My Framework library, build an agent with streaming
capabilities. The agent should respond to user queries in real-time
and handle tool calling for external APIs.
oracle: scenarios/my-framework/streaming_agent.py
sources:
- https://docs.my-framework.io/quickstart
- https://docs.my-framework.io/streaming
- id: multi-agent-team
query: |
Create a multi-agent team with task delegation. Build a research
crew that can plan subtasks, execute them in parallel, and
aggregate results.
oracle: scenarios/my-framework/multi_agent_team.py
sources:
- https://docs.my-framework.io/teams
runtime:
language: python
version: "python3.11"
env_vars:
OPENAI_API_KEY: "${OPENAI_API_KEY}"Create scenarios/{package}/{scenario_id}.py (or .ts for TypeScript):
"""
Oracle implementation for streaming-agent scenario.
This file demonstrates the EXPECTED implementation that MCP context
should enable. Evaluators compare MCP documentation against this
reference to determine if sufficient context was provided.
"""
from my_framework import Agent, StreamingModel
def main():
# Initialize agent with streaming
agent = Agent(
model=StreamingModel(id="gpt-4"),
streaming=True
)
# Run agent with query
response = agent.run(
query="What's the weather like?",
stream=True
)
# Handle streaming response
for chunk in response:
print(chunk, end="", flush=True)
if __name__ == "__main__":
main()Oracle Best Practices:
- ✅ Use realistic, complete implementations
- ✅ Include imports and setup
- ✅ Demonstrate key APIs and parameters
- ✅ Show usage patterns clearly
- ✅ Include error handling if critical
- ✅ Keep code concise but complete
Every scenario query should:
✅ Specify the framework - "Using the {Framework} library..." ✅ Define the task clearly - What needs to be implemented ✅ Include key requirements - Tool calling, streaming, team orchestration, etc. ✅ Be implementation-focused - What to build, not how to build it ✅ Test MCP differentiation - Complex enough to differentiate between MCP servers
Good Query Example:
Using the Autogen Python library with selector-based group chat,
create a small research 'crew': (1) Plan subtasks; (2) run a mock
web search; (3) compute a percentage change; Stop when planning is
complete and say 'TERMINATE'.
Bad Query Example:
Make an agent that does stuff with Autogen.
# Test with single MCP server
npx tsx harness/cli.ts \
--scenario my-framework:streaming-agent \
--mode oneshot \
--config nia \
--verbose
# Test with all MCP servers
npx tsx harness/cli.ts \
--scenario my-framework:streaming-agent \
--mode oneshot \
--all-configs
# Check evaluation results
cat workspace/run-*/oneshot/nia/my-framework:streaming-agent/evaluation_oneshot.jsonFor package YAML:
-
package-id- Unique identifier (kebab-case) -
name- Human-readable framework name -
registry- Package registry (py_pi, npm) -
scenarios- List of scenarios with id, query, oracle, sources -
runtime- Language and version -
env_vars- Environment variables needed
For each scenario:
-
id- Unique scenario identifier (kebab-case) -
query- Clear task description -
oracle- Path to reference implementation -
sources- Official documentation URLs
Simple scenarios (1-2 API patterns):
- Basic agent initialization
- Single tool calling
- Simple streaming
Complex scenarios (3+ API patterns):
- Multi-agent teams
- Parallel execution
- State management
- Human-in-the-loop
- Complex orchestration
Prefer complex scenarios for better MCP server differentiation.
git checkout -b add-scenario-{name}
git add scenarios/{package}.yaml scenarios/{package}/{scenario}.py
git commit -m "Add {framework}:{scenario} scenario"
git push origin add-scenario-{name}Open PR with:
- Description of the framework and scenario
- Example MCP context expectations
- Evaluation results across MCP servers
Create mcp-configs/{config-name}.ts:
import { MCPConfig } from '../harness/types.js';
export const myMcpConfig: MCPConfig = {
config_name: 'my-mcp',
description: 'My MCP Documentation Server',
mcp_servers: {
'my-server': {
command: 'npx',
args: ['-y', '@my-org/mcp-server'],
env: {
MY_API_KEY: process.env.MY_API_KEY!,
},
},
},
env_requirements: ['MY_API_KEY'],
};Add to mcp-configs/index.ts:
export { myMcpConfig } from './my-mcp.js';Add to harness/config-loader.ts:
import { myMcpConfig } from '../mcp-configs/index.js';
const MCP_CONFIGS: Record<string, MCPConfig> = {
baseline: baselineConfig,
nia: niaConfig,
context7: context7Config,
deepcon: deepconConfig,
exa: exaConfig,
'my-mcp': myMcpConfig, // Add this line
};# Test with single scenario
npx tsx harness/cli.ts \
--scenario autogen:streaming-tools \
--mode oneshot \
--config my-mcp
# Compare with other MCP servers
npx tsx harness/cli.ts \
--scenario autogen:streaming-tools \
--mode oneshot \
--all-configsAdd to your PR description:
- MCP server name and purpose
- Installation requirements
- API key setup instructions
- Expected documentation characteristics
Key modules:
harness/cli.ts- CLI interfaceharness/run-scenario.ts- Main orchestrationharness/oneshot-runner.ts- MCP tool call executionharness/evaluator.ts- Multi-model evaluationharness/mcp-client.ts- MCP server connectionharness/scenario-loader.ts- YAML parsing
-
Read existing code
- Understand oneshot mode execution
- Review multi-model evaluation logic
- Study MCP client management
-
Follow existing patterns
- Specification-driven execution (YAML configs)
- Clear separation of concerns
- Comprehensive logging
-
Testing your changes:
# Test with verbose logging npx tsx harness/cli.ts \ --scenario autogen:streaming-tools \ --mode oneshot \ --config nia \ --verbose -
Code style:
- TypeScript with strict mode
- JSDoc comments for public APIs
- ES modules (not CommonJS)
- Consistent error handling
Context Bench uses 3 LLMs for consensus-based evaluation:
- GPT-5 (OpenAI)
- Grok-4 (xAI)
- Deepseek-v3.2 (Deepseek)
Each model evaluates:
- Completeness (Boolean): Can all requirements be inferred from MCP context?
- Relevance (Boolean): Does MCP context address the task?
- Overall Score (1-5): Quality assessment
- Confidence (high/medium/low): Evaluator certainty
Pass Criteria: 2/3 models must agree on both completeness AND relevance.
- README.md - Main documentation
- CONTRIBUTING.md - This file
- SETUP.md - Installation guide (if needed)
We welcome:
- Scenario walkthroughs
- MCP server comparison analyses
- Framework integration guides
- Evaluation result interpretations
-
Test your scenario with all MCP servers
npx tsx harness/cli.ts \ --scenario {package}:{scenario} \ --mode oneshot \ --all-configs -
Verify evaluation results
# Check pass/fail for each MCP server find workspace -name "evaluation_oneshot.json" | \ xargs jq '{scenario, pass: .aggregated.pass}'
-
Count tokens
npx tsx scripts/count-tokens.ts workspace/run-{timestamp} -
Review evaluation reasoning
# Check why scenarios passed or failed jq '.models[].reasoning' workspace/.../evaluation_oneshot.json
Include:
-
Environment
- OS and version
- Node.js version
- MCP server versions
-
Command used
npx tsx harness/cli.ts --scenario X --config Y --verbose
-
Logs
- Attach relevant log output
- Include error stack traces
-
Expected vs Actual
- What you expected
- What actually happened
- Evaluation results if applicable
Describe:
- Use case - What problem does this solve?
- Proposed solution - How should it work?
- Impact - Who benefits?
When contributing, follow these principles:
-
Specification-driven
- Prefer YAML/JSON over code
- Keep harness generic and reusable
-
Zero code changes for scenarios
- Adding scenarios shouldn't require harness modifications
- Use YAML + oracle files only
-
Fair evaluation
- Multi-model consensus reduces bias
- Clear evaluation criteria
- Transparent reasoning
-
Research quality
- Controlled experiments (fixed evaluators)
- Clear independent/dependent variables
- Reproducible results
- Questions? Open a GitHub Discussion
- Bugs? Open a GitHub Issue
- Ideas? Start a Discussion or RFC
By contributing, you agree that your contributions will be licensed under the MIT License.
Every contribution helps make Context Bench better. Whether you're adding a scenario, improving documentation, or adding MCP server support - thank you for your help!