Skip to main content

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

  1. MCP server integrates with your coding agent (e.g., Claude Code) to annotate code changes with spec references as you work
  2. CLI validates annotations in CI (specmap validate)
  3. 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


Download files

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

Source Distribution

specmap-0.2.39.tar.gz (381.5 kB view details)

Uploaded Source

Built Distribution

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

specmap-0.2.39-py3-none-any.whl (275.6 kB view details)

Uploaded Python 3

File details

Details for the file specmap-0.2.39.tar.gz.

File metadata

  • Download URL: specmap-0.2.39.tar.gz
  • Upload date:
  • Size: 381.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for specmap-0.2.39.tar.gz
Algorithm Hash digest
SHA256 4a5bea27132282991bc18a3f7c5c8b4ac043b9157c641ca4d37d43eb277172c7
MD5 b69badbd88f55eb519a02478eecd75f5
BLAKE2b-256 550220e88db2fad8e451c2fa944878eaff4a089cd7cf89200c142e16b66b5f74

See more details on using hashes here.

File details

Details for the file specmap-0.2.39-py3-none-any.whl.

File metadata

  • Download URL: specmap-0.2.39-py3-none-any.whl
  • Upload date:
  • Size: 275.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for specmap-0.2.39-py3-none-any.whl
Algorithm Hash digest
SHA256 856b4d338f5c4e2364e2b57d4d0d6f351232c4e9cc16e7b4129c7c8ddce43c96
MD5 a2b45eebc6ddc463497c65d95c943762
BLAKE2b-256 aa1dd7aa24e0814ecf05b0eb959435180176f4c206f71dad96c2578f49b18a77

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