Skip to main content
Glama

mcp-repodna

An MCP server and CLI that analyzes a public repository to extract its holistic engineering culture and compiles it into artifacts for autonomous AI coding agents:

  • skills.sh: an executable bash script encoding the repository's conventions as runnable checks (commit style, branch naming, lint, format, typecheck, test)

  • rules.md: a markdown context document summarizing the repository's engineering DNA for LLM system prompts

The analyzer inspects six dimensions: git conventions, architecture, linting and formatting, tooling, test semantics, and governance.

Installation

Requires Python 3.12+ and git on PATH.

uv tool install mcp-repodna
# or, from this checkout
uv sync

Related MCP server: patchwork

CLI usage

# Analyze a repository and print a summary table
mcp-repodna analyze https://github.com/org/repo

# Analyze and emit the full DNA model as JSON
mcp-repodna analyze https://github.com/org/repo --json

# Analyze and write skills.sh plus rules.md into ./repodna
mcp-repodna compile https://github.com/org/repo --output ./repodna

# Adjust how much commit history is fetched (default 100)
mcp-repodna analyze https://github.com/org/repo --history-depth 500

# Print the JSON schema of the DNA model
mcp-repodna schema

# Start the MCP server over stdio
mcp-repodna serve

Local paths work too:

mcp-repodna analyze ../my-project --json

MCP server

The server exposes four tools and two resources over stdio.

Tools:

  • analyze_repository(repo_url, history_depth, output_dir): returns the DNA model as JSON, optionally writing skills.sh and rules.md

  • generate_skills(repo_url, output_dir, history_depth): writes both artifacts

  • analyze_dimension(repo_url, dimension, history_depth): returns one dimension as JSON

  • list_dimensions(): lists the six dimension names

Resources:

  • dna://schema: JSON schema of the RepoDNA model

  • dna://dimensions: JSON list of dimension names

Example client configuration:

{
  "mcpServers": {
    "repodna": {
      "command": "mcp-repodna",
      "args": ["serve"]
    }
  }
}

DNA dimensions

Dimension

Detects

git

conventional commit ratio, merge strategy, branch prefixes, default branch

architecture

src vs flat vs monorepo layout, test placement, typing strictness, dependency manager

linters

ruff, eslint, prettier, biome, flake8, editorconfig, line length, import sorting

tooling

Makefile targets, npm scripts, Taskfile, pre-commit hooks, CI systems

testing

pytest, jest, vitest, mock libraries, assertion grammar, snapshots, coverage

governance

PR template, CONTRIBUTING, ADRs, CODEOWNERS, SECURITY, issue templates

Every dimension carries a confidence level (low, medium, high) and notes when evidence is missing.

Generated artifacts

skills.sh provides guarded functions:

  • dna:commit <subject>: validates conventional commit subjects when detected

  • dna:branch <name>: validates branch prefixes when detected

  • dna:lint, dna:format, dna:typecheck, dna:test: run the detected tools

  • dna:install-hooks: installs pre-commit when configured

  • dna:preflight: runs all checks as a submission gate

rules.md renders the same DNA as a rule sheet for system context.

Development

uv sync           # install dependencies with Python 3.12
uv run pytest     # run the test suite
uv run ruff check .   # lint

The test suite builds a synthetic git repository in a temp directory and asserts every extractor, the pipeline, the compiler, and the MCP server against it. No network access is required.

License

Distributed under the Apache License 2.0. See the LICENSE file. This project itself follows the conventions it detects: conventional commits, ruff linting, pytest with pytest-mock, and pre-commit hooks.

Available Tools

4 tools
analyze_dimensionB

Analyze a single DNA dimension of a repository and return it as JSON.

Args:
    repo_url: Git URL or local path of the repository to analyze.
    dimension: One of the dimensions from the list_dimensions tool.
    history_depth: Number of commits to fetch for git history analysis.

Inputs: repo_url (required), dimension (required), history_depth. Returns: result

analyze_repositoryA

Analyze a repository and return its engineering DNA as JSON.

Args:
    repo_url: Git URL or local path of the repository to analyze.
    history_depth: Number of commits to fetch for git history analysis.
    output_dir: Optional directory to also write skills.sh and rules.md into.

Inputs: repo_url (required), output_dir, history_depth. Returns: result

generate_skillsA

Generate skills.sh and rules.md for a repository into a directory.

Args:
    repo_url: Git URL or local path of the repository to analyze.
    output_dir: Directory to write skills.sh and rules.md into.
    history_depth: Number of commits to fetch for git history analysis.

Inputs: repo_url (required), output_dir (required), history_depth. Returns: result

list_dimensionsB

List the DNA dimensions available for analysis.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 4 tools

    Disambiguation4/5

    analyze_repository and analyze_dimension are somewhat close since both return DNA analysis as JSON, but the full-vs-single-dimension distinction is clear from the descriptions. generate_skills and list_dimensions are clearly separate in purpose.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern: analyze_repository, generate_skills, analyze_dimension, list_dimensions. This makes the toolset predictable and easy to navigate.

    Tool Count5/5

    Four tools is well-scoped for a focused repository DNA analysis server. Each tool serves a distinct purpose and none feel redundant or extraneous.

    Completeness5/5

    The toolset covers discoverability via list_dimensions, targeted analysis via analyze_dimension, full analysis via analyze_repository, and artifact generation via generate_skills. There are no obvious dead ends or missing operations for the stated purpose.

    Maintenance

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Scans your source code using AST analysis to detect coding conventions, error handling, API patterns, and more, then generates a CONVENTIONS.md file to help AI agents follow your project's style.
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Analyzes repositories, explains architecture, calculates change impact, and enforces guardrails for AI Agents like Claude Code, Cursor, and Codex via MCP tools.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Analyzes a codebase to extract its coding conventions and exposes tools via MCP for AI agents to retrieve live style rules, ensuring generated code matches the project's unwritten style.
      1
      MIT