Crates.io | foundry-mcp |
lib.rs | foundry-mcp |
version | 0.7.0 |
created_at | 2025-08-21 03:47:57.973337+00 |
updated_at | 2025-09-25 18:53:46.355896+00 |
description | A comprehensive CLI tool and MCP server for deterministic project management and AI coding assistant integration |
homepage | https://github.com/cafreeman/foundry-mcp |
repository | https://github.com/cafreeman/foundry-mcp |
max_upload_size | |
id | 1804266 |
size | 936,068 |
Deterministic project context management for AI coding assistants
An MCP (Model Context Protocol) server that enables AI assistants like Claude and Cursor to maintain persistent project context, specifications, and task lists across development sessions. Stores all context in ~/.foundry/
to keep your codebase clean.
cargo install foundry-mcp
After installation, configure Foundry with your AI development environment:
# For Cursor
foundry install cursor
# For Claude Code
foundry install claude-code
# Verify installation
foundry status
That's it! Foundry MCP tools are now available in your AI assistant.
Installation includes helpful templates:
.cursor/rules/foundry.mdc
with edit_commands guidance and workflow examples~/.claude/agents/foundry-mcp-agent.md
with edit_commands usage and intelligent defaults~/.foundry/
Current AI coding assistant workflows suffer from critical issues:
Foundry MCP provides a set of MCP tools that enable deterministic project and specification management through a centralized file system outside of project directories.
Foundry provides 9 MCP tools that enable comprehensive project management for AI assistants:
create_project
: Create new project with vision, tech stack, and summaryanalyze_project
: Create project structure by analyzing existing codebasesload_project
: Load complete project context for LLM sessionslist_projects
: List all available projects with metadatacreate_spec
: Create timestamped specification with task breakdownload_spec
: Load specification content with project contextupdate_spec
: Edit spec files using intent-based edit commands with precise anchors and idempotent updatesdelete_spec
: Delete existing specification and all its filesvalidate_content
: Validate content against schema requirementsget_foundry_help
: Get comprehensive workflow guidance and examplesFoundry stores structured project context in ~/.foundry/
:
~/.foundry/my-project/
βββ vision.md # Product vision and goals
βββ tech-stack.md # Technology decisions
βββ summary.md # Quick context summary
βββ specs/
βββ 20250826_143052_user_auth/
βββ spec.md # Feature requirements
βββ task-list.md # Implementation checklist
βββ notes.md # Design decisions
Benefits: Clean codebase separation β’ Persistent across git operations β’ Chronological feature tracking
Foundry uses a faΓ§ade plus pluggable backend design to keep domain logic independent of storage.
Foundry<B: FoundryBackend>
centralizes domain logic (spec naming/validation, fuzzy matching) and delegates I/O to a backend.FilesystemBackend
preserves the existing on-disk layout and atomic write semantics.SpecContentStore
implemented by the faΓ§ade for read/write operations.location_hint
and locator
for UI/deeplink use. The legacy path
field is retained for compatibility but considered deprecated.See docs/backends.md for trait contracts, invariants, and a checklist for adding new backends.
When you work with AI assistants like Claude or Cursor, Foundry provides:
Day 1: "Build a task management app"
β AI creates project with vision, tech stack, feature specs
Day 5: "Let's work on authentication"
β AI loads complete context, knows exactly what you're building
set_task_status
, upsert_task
, append_to_section
for adding new contentremove_list_item
, remove_from_section
, remove_section
for cleanup operationsreplace_list_item
, replace_in_section
, replace_section_content
for updatestask_text
(exact checkbox text), section
(case-insensitive headers), text_in_section
(precise text targeting)project_name
(string), spec_name
(string), commands
(array, non-empty){
"name": "update_spec",
"arguments": {
"project_name": "proj",
"spec_name": "spec",
"commands": [
{
"target": "spec",
"command": "append_to_section",
"selector": { "type": "section", "value": "## Overview" },
"content": "New line"
}
]
}
}
task_text
(e.g., 1. Title
). Convenience matching without the number is supported when the remainder is unique.Once installed, AI assistants have access to these tools:
create_project
- Create new project with vision, tech stack, and summaryanalyze_project
- Create project from existing codebase analysisload_project
- Load complete project context for AI sessionslist_projects
- List all available projects with metadatacreate_spec
- Create timestamped specification with task breakdownload_spec
- Load specification content with project contextupdate_spec
- Edit spec files using comprehensive content management: addition, removal, and replacement operationsdelete_spec
- Delete existing specification and all its filesvalidate_content
- Validate content against schema requirementsget_foundry_help
- Get workflow guidance and examplesgit clone https://github.com/cafreeman/foundry-mcp.git
cd foundry-mcp
cargo build --release
cargo test
# Start MCP server
cargo run -- serve
# With verbose logging for debugging
cargo run -- serve --verbose
Test MCP tools from the command line:
# Basic workflow test
cargo run -- mcp create-project test-app --vision "Test app" --tech-stack "Rust" --summary "Testing Foundry"
cargo run -- mcp list-projects
cargo run -- mcp load-project test-app
cargo test
passes