CodeForgeX
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CodeForgeX Reproduce the failing test, fix the bug, and verify all tests pass"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CodeForgeX: Deterministic AI-Agent Evaluation Environment & MCP Software Engineering Harness
CodeForgeX is an enterprise-grade, deterministic AI-agent software engineering evaluation environment and tool-calling execution harness. Built on the official Model Context Protocol (MCP Python SDK v2), it provides an isolated, uncheatable sandbox where AI agents explore repositories, reproduce failures, formulate hypotheses, apply unified diff patches, and verify solutions against public and hidden test suites.
Unlike subjective "LLM-as-a-judge" grading, CodeForgeX employs deterministic, multi-criteria verification with cryptographic test tampering detection, regression guards, and wall-clock execution limits.
Architecture Topology
flowchart TD
subgraph ControlPlane["CLI & Orchestration (scripts/run_evaluation.py)"]
CLI["CLI Runner"] --> Runner["EvaluationRunner"]
CLI --> Loop["AgentExecutionLoop"]
end
subgraph AgentLayer["Autonomous Agent & Planning (src/agent/)"]
Loop --> Planner["SystematicSWEPlanner / LLMPlanner"]
Planner -->|AgentAction| Loop
Loop -->|call_tool| Client["MCPClient (Async stdio)"]
end
subgraph ProtocolBoundary["Model Context Protocol Boundary"]
Client <==>|Anonymous OS Pipes (stdio JSON-RPC)| Server["MCPServer (Subprocess)"]
end
subgraph ToolSurface["Sandboxed Tool Surface (src/mcp_server/)"]
Server --> T1["list_files"]
Server --> T2["read_file"]
Server --> T3["search_code"]
Server --> T4["apply_patch"]
Server --> T5["get_git_diff"]
Server --> T6["run_tests"]
Server --> T7["get_test_output"]
Server --> T8["get_repository_status"]
end
subgraph SecurityBoundary["Security & Anti-Cheat Sandbox (src/mcp_server/security/)"]
T1 & T2 & T3 & T4 & T5 & T6 & T7 & T8 --> Sandbox["SecurityPolicy Engine"]
Sandbox --> Guard1["Path Traversal Containment"]
Sandbox --> Guard2["Anti-Cheat (Hidden Tests Isolated)"]
Sandbox --> Guard3["Command Whitelisting & Injection Defense"]
end
subgraph TaskWorkspaces["Ephemeral Sandboxes (tasks/)"]
Guard1 & Guard2 & Guard3 --> TargetRepo["Ephemeral Workspace (.git)"]
end
subgraph Evaluator["Deterministic Evaluator Engine (src/evaluator/)"]
TargetRepo --> Verifier["TaskVerifier"]
Verifier --> ShaCheck["SHA-256 Digest Tamper Check"]
Verifier --> PublicRun["Public Test Execution"]
Verifier --> HiddenRun["Privileged Hidden Test Suite"]
Verifier --> DiffAnalysis["Git Diff & Line Metrics"]
ShaCheck & PublicRun & HiddenRun & DiffAnalysis --> Scorer["ScoringEngine (100 Pt Model)"]
Scorer --> Artifacts["Telemetry Artifacts (results/eval_*.json, .md)"]
endRelated MCP server: MCP Software-Engineering RL Environment
Key System Capabilities
Official Model Context Protocol (SDK v2): Real-time tool discovery and execution over standard I/O (
stdio), eliminating TCP port exhaustion and network race conditions.Multi-Provider Schema Reflection: Dynamic tool schema conversion supporting OpenAI function calling, Anthropic Claude, and Google Gemini function declarations.
Multi-Dimensional Scoring (0 - 100 Points):
Task Completion (40 pts)
Hidden Verification Tests (25 pts)
Public Baseline Tests (15 pts)
Regression Safety (10 pts)
Tool Efficiency & Token Conservation (5 pts)
Patch Conciseness & Quality (5 pts)
Anti-Cheat & Anti-Tampering Protection: Dual-layer defense with cryptographic SHA-256 test file digest verification. Modifying or deleting test assertions forces an immediate
0.0 / 100.0disqualification score.Systematic SWE Reasoning Workflow: Enforces Test-Driven Software Engineering:
EXPLORE$\rightarrow$REPRODUCE$\rightarrow$ANALYZE$\rightarrow$PATCH$\rightarrow$VERIFY$\rightarrow$FINISH.Fault-Tolerant Circuit Breakers: Active consecutive-failure guards prevent runaway token expenditure and model hallucination loops.
Hardened Docker Isolation: Non-root user execution (
uid=1000),cap_drop: [ALL],no-new-privileges:true, and RAM-backed in-memorytmpfsmounts.Unified Benchmark Dashboard: Terminal dashboard with JSON and Markdown artifact generation.
Benchmark Suite Catalog
CodeForgeX includes 6 diverse benchmark tasks spanning core software engineering modalities:
Task ID | Category | Difficulty | Problem Domain | Baseline Defect | Golden Score |
|
| Easy | E-Commerce Pricing Engine | Flat rate subtraction instead of % calculation; no bound checks |
|
|
| Medium | Concurrent LRU Cache with TTL | Expired nodes not purged on access; evicts MRU instead of LRU |
|
|
| Medium | Thread-Safe Token Bucket Limiter | Class raises |
|
|
| Medium | Request Dispatcher to Strategy | Monolithic |
|
|
| Medium | Log Stream Deduplication ($O(N^2) \rightarrow O(N)$) | $O(N \times W)$ quadratic nested search takes > 1.5s and times out |
|
|
| Medium | Topological Build Dependency Sorter | Lacks topological sort and Tarjan/DFS cycle path detection |
|
Quickstart Guide
1. Installation & Environment Setup
# Clone the repository
git clone https://github.com/kirubesh/CodeForgeX.git
cd CodeForgeX
# Install virtual environment and dependencies using uv or pip
pip install -e .2. Run the Full Test Suite (91 Tests)
pytest -v3. Run Benchmark Evaluations via CLI
# Run the entire benchmark suite in golden reference mode
python scripts/run_evaluation.py --all
# Run a specific task in autonomous agent mode (MCP stdio tool-calling loop)
python scripts/run_evaluation.py --task bug_fix_001 --mode agent-systematic
# Filter benchmarks by category or difficulty
python scripts/run_evaluation.py --category algorithm
python scripts/run_evaluation.py --difficulty medium4. Containerized Execution with Docker
# Build the security-hardened container
docker build -t codeforge-x:latest .
# Run full evaluation across all tasks inside Docker
docker run --rm codeforge-x:latest --evaluate-all
# Or run using Docker Compose with cgroups limits and tmpfs in-memory sandboxes
docker compose up codeforge-evalTechnical Documentation & Interview Defenses
System Architecture Specification: Deep-dive into MCP server tools, security sandboxing, scoring math, and agent loop lifecycle.
Security & Threat Modeling: Comprehensive threat matrix covering path traversal, shell injection, privilege elevation, and anti-cheat guards.
Docker Reproducibility Guide: Container security specs, capability dropping, and cgroup resource quotas.
Staff-Level Technical Interview Defense Guide: Complete question-and-answer handbook defending every architectural trade-off and systems engineering choice.
License
MIT License. See LICENSE for details.
Available Tools
8 toolsapply_patchA
Atomically apply a unified diff patch to repository files.
Args: patch: The unified diff content (e.g., standard 'diff --git' or '--- / +++' format). file_path: Optional relative target path if targeting a single file.
Returns: JSON string with success status, list of changed files, and status message.
Inputs: patch (required), file_path. Returns: result
get_git_diffA
Retrieve the deterministic Git diff of changes made in the repository.
Args: path: Optional relative file or directory path to scope the diff. cached: If True, inspects staged changes (git diff --cached) (default: False).
Returns: JSON string containing diff string, has_changes boolean, and changed_files list.
Inputs: path, cached. Returns: result
get_repository_statusA
Inspect the current Git repository status (modified, staged, untracked files).
Returns: JSON string with branch, clean flag, and lists of modified/staged/untracked files.
Inputs: no named parameters. Returns: result
get_test_outputA
Retrieve test execution output and logs from a previous test run.
Args: run_id: Specific test run identifier (empty string defaults to most recent run). full: If True, returns full untruncated stdout and stderr (default: False).
Returns: JSON string containing logs, exit code, duration, and pass/fail counts.
Inputs: full, run_id. Returns: result
list_filesA
List files and directories in the repository.
Args: directory: Relative subfolder inside the repository (empty string for root). recursive: Whether to list recursively through child directories (default: True). max_depth: Maximum directory recursion depth (default: 10).
Returns: JSON string containing total_entries and a structured list of files with sizes.
Inputs: directory, max_depth, recursive. Returns: result
read_fileA
Read text content from a file inside the repository with line windowing.
Args: path: Relative path to the file inside the repository. start_line: 1-indexed starting line number (default: 1). end_line: 1-indexed ending line number (default: None, reads up to 1000 lines).
Returns: JSON string containing path, line numbers, content, and truncation status.
Inputs: path (required), end_line, start_line. Returns: result
run_testsA
Execute automated pytest tests within the repository sandbox.
Args: test_target: Optional relative test file or test node (e.g. 'tests/test_math.py::test_add'). timeout_seconds: Maximum time allowed before terminating process (default: 30s).
Returns: JSON string with exit code, passed/failed counts, duration, and output summary.
Inputs: test_target, timeout_seconds. Returns: result
search_codeA
Search for literal text or regular expressions across repository files.
Args: query: The substring or regex to search for. path: Optional relative directory or file to constrain search scope. is_regex: Whether query is a regular expression (default: False). case_sensitive: Whether match should be case-sensitive (default: False). max_results: Maximum matching lines to return (default: 50).
Returns: JSON string with matched lines, line numbers, and file paths.
Inputs: query (required), path, is_regex, max_results, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct concern: file listing, status inspection, content reading, search, test execution, test output retrieval, patching, and diff viewing. The only related pair is run_tests/get_test_output, but their roles are clearly sequential rather than interchangeable.
Most tools follow a clear verb_noun pattern like list_files, read_file, search_code, run_tests, and apply_patch. The get_* variants are slightly different in style but still predictable and consistent with common Git-related naming.
Eight tools is a well-scoped size for a repository coding assistant. Each tool covers a necessary operation without redundancy or bloat, and the set is small enough for an agent to navigate easily.
The toolset covers the core inspect-modify-test loop well: reading, searching, patching, diffing, and running tests. Missing commit/branch management tools are a minor gap for full repository lifecycle coverage, but agents can still complete most coding workflows.
Maintenance
Related MCP Connectors
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Run AI agent tasks in isolated sandboxes with a cost cap, saved workflows and scoped connections.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEmpower any MCP-compatible AI Agent(MCP Client) with engineering-grade capabilities to understand, modify, run, and deliver real-world code repositories.137 PyPI1,222Apache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables reproducible evaluation of AI coding agents by exposing repository inspection, code editing, test running, and deterministic verification through MCP tools.-
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to safely inspect, edit, and test code within a bounded repository environment to solve software engineering tasks and verify fixes.-
- FlicenseNot gradedqualityCmaintenanceEnables deterministic, sandboxed evaluation and RL training of software engineering agents via MCP, providing repository and terminal tools, failure classification, and live dashboards.-