Spec-to-code mapping: core library, MCP server, and CLI
Project description
Specmap
Map AI-generated code changes back to spec intent.
Specmap generates LLM-powered annotations that link code changes to specification documents. When an AI agent writes code, reviewers can see which spec requirements each code region implements, with inline [N] citations pointing to the exact spec sections.
How It Works
- MCP server integrates with your coding agent (e.g., Claude Code) to annotate code changes with spec references as you work
- CLI validates annotations in CI (
specmap validate) - Web UI lets reviewers browse PRs with spec annotations overlaid on diffs
Coding Agent ──MCP──► Specmap Server ──LLM──► .specmap/{branch}.json
│ │
reads specs committed to git
reads diffs │
▼
specmap validate (CI)
specmap serve (Web UI)
Use Specmap on Your Projects
No need to clone this repo. Install as a tool and use it in any project:
# Install
uv tool install git+https://github.com/jdraines/specmap.git
# Verify
specmap --version
Add the MCP server to your coding agent (.mcp.json in your project):
{
"mcpServers": {
"specmap": {
"command": "specmap-mcp",
"env": {
"SPECMAP_API_KEY": "sk-..."
}
}
}
}
See the full documentation for configuration, CLI commands, and CI integration.
Develop Specmap
Clone and run locally:
git clone https://github.com/jdraines/specmap.git
cd specmap
# Install dependencies
just mcp-install # Python (core library, MCP server, CLI, API server)
just web-install # Node (React frontend)
# Run full dev stack (API + Vite dev server)
just dev
# Run tests
just test-all # Unit + functional tests
just lint # ruff + tsc
# Build wheel with bundled frontend
just build
To run the web UI locally, you'll need a forge token (PAT or OAuth). See Development for the complete setup.
Prerequisites
| Tool | Install |
|---|---|
| Python 3.11+ | System package manager |
| uv | curl -LsSf https://astral.sh/uv/install.sh | sh |
| Node.js 20+ | System package manager |
| just | cargo install just or system packages |
| git | System package manager |
Project Structure
specmap/
├── core/ Python: core library, MCP server, CLI, API server
├── web/ React frontend (Vite + Tailwind)
├── tests/ Functional test suite
├── docs/ MkDocs documentation
└── justfile Task runner (run `just` to see all commands)
License
See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file specmap-0.3.12.tar.gz.
File metadata
- Download URL: specmap-0.3.12.tar.gz
- Upload date:
- Size: 448.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd37ea54849f3a2b4e01a174a951b047c6988fd14a299513949926520a7ae2e1
|
|
| MD5 |
7f52e1fe30b80dab711ed343233452b4
|
|
| BLAKE2b-256 |
f03304841516abc42c093856fcf69d5319d7c20cf06e7098c953c2b07d0e4c97
|
File details
Details for the file specmap-0.3.12-py3-none-any.whl.
File metadata
- Download URL: specmap-0.3.12-py3-none-any.whl
- Upload date:
- Size: 308.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50c24b03fe6e0ed7922d0c7b013b5e402e0ff9c3290db8a7c848942dd26f25c2
|
|
| MD5 |
96483ebaf3c810943163b142f7b40f8a
|
|
| BLAKE2b-256 |
ec2abff392f33a4ffaa4dddd530c209f2d753c81c12547f37be5cd8c6adf0cff
|