ralph-loop-mcp
Automates a three-phase development workflow: planning, spec generation, and iterative task execution with verification.
README
Ralph Loop MCP (Node + TypeScript)
This MCP server turns the repo's .ralph/ folder into a 3-phase workflow:
- Phase 1: Create or refine plan documents under
.github/plans/. Phase 1 produces plan files only. - Phase 2: Generate/refine specs under
.ralph/specs/**and tasks in.ralph/fix_plan.md. - Phase 3: Iterate one task at a time with strict verification (npm run ci + npm run test:e2e).
See docs/DESIGN.md for architecture and positioning.
Phase 1 generator script
ralph.generate_phase1 bootstraps .ralph/phase1.sh and seeds .github/plans/project-plan.md when missing.
The generated Phase 1 session is intentionally constrained to planning output only:
-
It writes plan documents only under
.github/plans/ -
It does not create
.ralph/specs/** -
It does not create
.ralph/fix_plan.mdtask items -
Run directly:
bash ./.ralph/phase1.sh -
Run via MCP tool:
ralph.generate_phase1
Phase 2 generator script
ralph.generate_phase2 scaffolds .ralph/phase2.sh and creates the baseline Phase 2 artifacts:
-
.ralph/specs/*.md -
.ralph/fix_plan.md -
.ralph/config.json -
.ralph/logs/progress.txt -
.ralph/logs/learnings.md -
Run directly:
bash ./.ralph/phase2.sh -
Run via MCP tool:
ralph.generate_phase2
ralph.generate_phase2 performs a lightweight schema validation of .ralph/config.json.
If the file exists and is invalid, the tool reports validation errors without executing the script.
Phase 3 generator script
ralph.generate_phase3 scaffolds .ralph/phase3.sh and creates the Phase 3 prompt files.
It fails with a clear error if .ralph/fix_plan.md does not yet exist.
When the fix plan has fewer than five unchecked active tasks, it seeds Phase 2 planning items as checkboxes automatically.
Artifacts created:
-
.ralph/phase3.sh -
.ralph/phase3-plan-prompt.md -
.ralph/phase3-dev-prompt.md -
.ralph/phase3-dev-signoff-prompt.md -
.ralph/phase3-qa-prompt.md -
.ralph/phase3-qa-close-prompt.md -
.ralph/logs/phase3-feedback.md -
Run directly:
bash ./.ralph/phase3.sh -
Run via MCP tool:
ralph.generate_phase3
Prerequisites
- Node.js 20 or later
- npm
- Build the package before running or testing (see Build section below)
Install
Standalone (this repo cloned directly as the package root):
npm install
Nested (package embedded under a parent monorepo, e.g. at ./mcp/ralph_loop_mcp):
npm install --prefix ./mcp/ralph_loop_mcp
Build
Standalone:
npm run build
Nested:
npm run --prefix ./mcp/ralph_loop_mcp build
Run (stdio)
Standalone:
node dist/index.js
Nested:
node ./mcp/ralph_loop_mcp/dist/index.js
VS Code MCP registration
Set cwd to the target project -- the repo whose .ralph/ folder the server will manage. This is typically the project you are actively developing, not the directory where this MCP package lives.
Example configuration for a standalone clone (open the target project folder in VS Code so ${workspaceFolder} resolves to it):
{
"mcpServers": {
"ralph-loop": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "${workspaceFolder}"
}
}
}
Example for a nested layout where the package lives at ./mcp/ralph_loop_mcp inside the target project:
{
"mcpServers": {
"ralph-loop": {
"command": "node",
"args": ["./mcp/ralph_loop_mcp/dist/index.js"],
"cwd": "${workspaceFolder}"
}
}
}
If VS Code reports ${workspaceFolder} cannot be resolved, open the repository with File -> Open Folder..., or set cwd to an absolute path pointing at the target project root.
Verification prereqs
ralph.run_verification runs npm run ci followed by npm run test:e2e on the target repo (the project under cwd). Both scripts must be defined in that repo's package.json, or the tool will reject them by design.
To extend the allowlist for additional scripts, add an allowedNpmScripts array to .ralph/config.json in the target repo:
{
"allowedNpmScripts": ["lint", "type-check"]
}
Conventions
.ralph/fix_plan.mdis the task source of truth.- Blocked tasks live under a dedicated heading:
## Blocked(or## Blocked Tasks). - Phase 1 planning documents live under
.github/plans/. - Phase 2 generator script lives at
.ralph/phase2.shand is auto-created byralph.generate_phase2when absent. - Phase 3 generator script lives at
.ralph/phase3.shand is auto-created byralph.generate_phase3when absent.
Dev tests
Standalone:
npm test
Nested:
npm run --prefix ./mcp/ralph_loop_mcp test
Note: Run
npm run buildbefore running tests for the first time sodist/index.jsexists for integration tests.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.