modular-chunks-cli
v0.1.3
Published
CLI & MCP server for Modular Chunks — feeds approved chunk contracts to coding agents and validates output against contracts
Readme
Modular Chunks CLI
A command-line tool that bridges the Modular Chunks platform with your local development environment and Claude Code.
Install
cd cli
npm install
npm run build
npm link # exposes `modular` globallyWorkflow
Platform (browser) CLI Claude Code
───────────────── ───────────────────── ──────────────────────
1. Build chunks in UI → 2. modular init
3. modular pull → 4. modular serve (MCP)
5. [Claude builds chunk]
6. modular validate →
7. modular sync → Platform sees PASS/FAILCommands
| Command | Description |
|---------|-------------|
| modular init | Set up .modular/config.json (platform URL, project ID, API token) |
| modular pull | Pull approved chunk contracts from the platform into .modular/cache.json |
| modular status | Show all chunks with approval and validation status |
| modular show <n> | Print full agent prompt for chunk N (or 00 for project context) |
| modular next | Print prompt for the next unvalidated approved chunk |
| modular validate [chunk] [--dir <path>] | Run structural validation against source files |
| modular sync [chunk] | POST validation results back to the platform |
| modular serve | Start MCP stdio server for Claude Code |
Claude Code MCP integration
Add to your Claude Code MCP config (e.g. .claude/mcp.json):
{
"mcpServers": {
"modular-chunks": {
"command": "node",
"args": ["/path/to/cli/dist/index.js", "serve"]
}
}
}Claude Code will then have access to these tools:
get_project_context— full project brief + architecture (Chunk 00)list_chunks— all chunks with statusget_current_chunk— next chunk to buildget_chunk— any specific chunk by number or namemark_chunk_validated— mark pass/fail after manual review
Platform setup
The Sync to CLI button in the Assembly page (Stage 06) must be clicked first. This POSTs the current project state to /api/assembly/contracts. The CLI pull command reads from this endpoint.
The optional CONTRACTS_INBOUND_API_KEY environment variable on the platform enables auth. Set apiToken in .modular/config.json on the CLI side to match.
