# context-foundry

An autonomous execution pipeline that works through TASKS.md with isolated agents and verification checks. Best for testable code changes.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 20
- Author: context-foundry
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/context-foundry/context-foundry
- Updated: 2026-06-11
- HTML: https://affpapa.org/en/nevibecode/mcp/context-foundry

## What it does

This MCP harness drives a multi-stage software delivery loop based on your `TASKS.md` file. Each role — investigation, planning, coding, and auditing — runs as a fresh Claude Code process. No conversation history passes between stages. Agents exchange only curated markdown outputs inside the `.buildloop` folder.

A separate verification pass audits new edits from a clean slate. It executes tests, resolves flagged issues, and writes a git commit: `feat(task_id)` on success or `WIP(task_id)` when problems remain. Reusable engineering lessons are cataloged under `~/.foundry/patterns/` as JSON. Without an `ANTHROPIC_API_KEY` environment variable, the process will not start.

Running this loop on unstructured prose or documentation updates wastes tokens. Verification cannot validate freeform text, so save the pipeline for code backed by concrete tests.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `ANTHROPIC_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add context-foundry -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -- uvx context-foundry
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from context-foundry <command>

### Codex

**Platform CLI**
```bash
codex mcp add context-foundry --env ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -- uvx context-foundry
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from context-foundry <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "context-foundry": {
            "command": "uvx",
            "args": [
                "context-foundry"
            ],
            "env": {
                "ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from context-foundry <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "context-foundry": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "context-foundry"
            ],
            "env": {
                "ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from context-foundry <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> context-foundry uvx context-foundry
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from context-foundry <command>

## When to use it
- execute engineering items from `TASKS.md` automatically
- audit generated patches using a clean agent context
- store discovered project patterns in `~/.foundry/patterns/`
- commit progress to git with per-task status indicators

## Example prompts
- Run the pending task queue from `TASKS.md` in sprint mode
- Audit recent changes with a clean verification agent
- Extract reusable codebase patterns into `.foundry`

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
