Skip to main content

The AI That Builds Itself: Recursive Claude Spawning via Meta-MCP

Project description

Context Foundry

Context Foundry

"Generate probabilistically, validate deterministically."

Autonomous AI development platform that spawns fresh Claude instances to research, design, build, test, and deploy complete software projects. Walk away and come back to production-ready code.

Version 2.5.0 | Quick Start | Documentation | Features


What is Context Foundry?

Context Foundry is an autonomous development platform with three main components:

Component Description
MCP Server Model Context Protocol server that exposes build tools to Claude Code
Daemon (cfd) Background service managing build queues, resource limits, and process monitoring
CLI Tools Terminal interface for monitoring builds and managing the system

Unlike traditional AI coding assistants that require constant supervision, Context Foundry runs complete build pipelines autonomously:

You: "Build a weather dashboard with React"
[Walk away for 10 minutes]
Result: Complete app deployed to GitHub, tests passing

Core Philosophy

Context Foundry combines probabilistic AI generation with deterministic validation:

  • Probabilistic: AI agents generate code freely using their full capabilities
  • Deterministic: Code-level validators verify outputs, checksums detect unauthorized changes, phase contracts enforce handoffs

This hybrid approach makes autonomous operation reliable. See Architecture for details.


Key Features

Build Pipeline

Feature Description
8-Phase Workflow Scout -> Architect -> Builder -> Test -> Docs -> Deploy -> Feedback
Self-Healing Tests Automatically fixes test failures through redesign/rebuild cycles
Parallel Execution AI decides when to spawn parallel agents for faster builds
Incremental Builds Smart change detection rebuilds only what changed

Pattern Learning

Feature Description
Context Codex SQLite database tracking issues, solutions, and build metrics
Skills Library Reusable code implementations with success rate tracking

Infrastructure

Feature Description
Daemon Service Background process with task queue, resource limits, watchdog
Mission Control TUI Terminal interface for real-time build monitoring
BAML Type Safety Structured JSON outputs with schema validation
Deterministic Enforcement Post-phase validators, checksum verification, state machine

Extensions

Extensions let you specialize Context Foundry for specific domains. Think of them as giving the AI a business case, architectural blueprints, and success criteria before asking it to build something complex.

Create an extension by adding domain-specific patterns, example implementations, and validation rules to extensions/<your-domain>/. The AI will reference these during builds to produce domain-appropriate solutions.


Architecture

                                    Context Foundry
    ┌─────────────────────────────────────────────────────────────────┐
    │                                                                 │
    │   ┌─────────────┐    ┌─────────────┐    ┌─────────────┐        │
    │   │  MCP Server │    │   Daemon    │    │  CLI / TUI  │        │
    │   │             │    │   (cfd)     │    │             │        │
    │   │ - Build API │    │ - Queue     │    │ - Monitor   │        │
    │   │ - Patterns  │    │ - Watchdog  │    │ - Dashboard │        │
    │   │ - Skills    │    │ - Resources │    │ - Logs      │        │
    │   └──────┬──────┘    └──────┬──────┘    └─────────────┘        │
    │          │                  │                                   │
    │          └────────┬─────────┘                                   │
    │                   │                                             │
    │          ┌────────▼────────┐                                    │
    │          │  Phase Executor │                                    │
    │          │                 │                                    │
    │          │ Scout ──────────┼──▶ scout_report.json              │
    │          │ Architect ──────┼──▶ architecture.json              │
    │          │ Builder ────────┼──▶ source code                    │
    │          │ Test ───────────┼──▶ test-report.md                 │
    │          │ Deploy ─────────┼──▶ GitHub repo                    │
    │          └────────┬────────┘                                    │
    │                   │                                             │
    │          ┌────────▼────────┐                                    │
    │          │   Validators    │  ◀── Deterministic Enforcement    │
    │          │                 │                                    │
    │          │ - File checks   │                                    │
    │          │ - Checksums     │                                    │
    │          │ - BAML schemas  │                                    │
    │          └─────────────────┘                                    │
    │                                                                 │
    └─────────────────────────────────────────────────────────────────┘

Each phase spawns a fresh Claude instance with isolated context, preventing token bloat and ensuring consistent quality across long builds.


Quick Start

1. Install

npm install -g context-foundry

This installs the package and automatically configures Claude Code. (Alternative: pip install context-foundry && cf setup)

2. Build Something

In Claude Code, just ask in natural language:

"Use CF to build a weather dashboard with React"

Walk away. Come back to deployed code on GitHub.

See Quick Start Guide for detailed setup instructions.


CLI Tools

Mission Control TUI

cf                    # Launch interactive terminal UI

Daemon Management

cfd start             # Start the daemon
cfd status            # Check status
cfd logs <job-id>     # View build logs
cfd list              # List active builds
cfd stop              # Stop the daemon

MCP Tools Available

Tool Description
autonomous_build_and_deploy Full build pipeline: research -> design -> build -> test -> deploy
delegate_to_claude_code Spawn fresh Claude instance for subtasks
delegate_to_claude_code_async Non-blocking delegation with progress tracking
search_skills Find reusable code implementations
save_skill Save successful implementation as reusable skill
create_evolution_task Create self-improvement task
get_daemon_status Check daemon health and resource usage

See MCP Tools Reference for complete documentation.


Documentation

Guide Description
Quick Start Get running in 5 minutes
User Guide Detailed usage instructions
Architecture How it works under the hood
Features Complete feature reference
Innovations Technical breakthroughs explained
Phase Handoff Flow Inter-phase data contracts
Troubleshooting Common issues and fixes
FAQ Frequently asked questions

File Structure

context-foundry/
├── tools/
│   ├── mcp_server.py          # MCP server entry point
│   ├── mcp_utils/             # Build orchestration, delegation, patterns
│   ├── prompts/phases/        # Phase-specific system prompts
│   ├── evolution/             # Daemon, self-improvement, safety
│   ├── cli.py                 # Main CLI (cf command)
│   └── cfd                    # Daemon CLI script
├── extensions/                # Domain-specific extensions
├── npm/                       # npm package wrapper
├── docs/                      # Documentation
└── CLAUDE.md                  # Instructions for AI agents

Contributing

We welcome contributions. See Contributing Guide for details.


License

MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

context_foundry-2.5.2.tar.gz (670.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

context_foundry-2.5.2-py3-none-any.whl (611.0 kB view details)

Uploaded Python 3

File details

Details for the file context_foundry-2.5.2.tar.gz.

File metadata

  • Download URL: context_foundry-2.5.2.tar.gz
  • Upload date:
  • Size: 670.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for context_foundry-2.5.2.tar.gz
Algorithm Hash digest
SHA256 5d31feb1b5c648bd1cb687d52deeca8848a77cd91e1cfed7f8a4f8ef733f5d5e
MD5 8ce50fc40ba7c12826c06c048fe672d4
BLAKE2b-256 6c54b7c9463b8d66c829536f2a40a834ff1d6f13dbe347f31b35d22f36d65173

See more details on using hashes here.

File details

Details for the file context_foundry-2.5.2-py3-none-any.whl.

File metadata

  • Download URL: context_foundry-2.5.2-py3-none-any.whl
  • Upload date:
  • Size: 611.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for context_foundry-2.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d7a50de2979964dbfc07e566f312c3a037e66a60f0a7bb354f681f7dfc1bbd5c
MD5 177ea8e3364f56d8ab9d01366e36fe50
BLAKE2b-256 d14bd2df74f1f16ecbe6ae2c9ddf4c2b69454fb2ad0e17060eb80050cfcad356

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page