AdrMcp

io.github.Atypical-Consulting由 GitHub 账号 Atypical-Consulting 发布v0.2.1更新于 Oct 24, 2026

MCP server for Architectural Decision Records: navigate, author, validate, link, and analyze them.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

一个本地 MCP 服务器,把 Markdown 架构决策记录(ADR)文件夹变成助手可搜索、撰写、校验、关联和分析的工具。

可以做什么
列出、读取、搜索和索引 ADR,包括决策时间线、词法或语义搜索,以及比较两份记录或文件与其规范渲染的差异。按 MADR 或 Nygard 模板创建 ADR、更新单个章节、变更状态、取代旧决策、建立记录间链接并重新生成 README 索引。通过相关 ADR 查询和带类型的关系图探索记录之间的联系。校验 MADR 合规性、检测相互冲突的决策、标记失效的代码引用并按架构领域报告覆盖缺口。根据统一 diff 起草 ADR 提案。
适用场景
适用于仓库以 Markdown ADR 保存架构决策,并希望助手就这些记录回答问题、起草和评审新记录,或在保留历史的前提下废止和取代旧决策的场景。也适合发现过期、冲突或缺失的决策。
运行要求
以 .NET 工具(dotnet tool install -g AdrMcp)或借助 .NET SDK 从源码本地通过 stdio 运行,也可使用 Docker 镜像。通过 --adr-root 和 --repo-root 参数或 ADR_ROOT、ADR_REPO_ROOT 环境变量指定 ADR 根目录(默认 docs/adr)和仓库根目录。未声明认证或 API 密钥。
安装前请注意
多个工具会写入磁盘:创建、更新、状态变更、取代、链接和索引重建。它们默认 previewOnly 为 true 并返回差异,请在传入 previewOnly false 前先审阅差异。它会读取并修改所配置 ADR 根目录下的 Markdown 文件,启用写入前请确认该路径。

安装

在 SourceWeft 中

  1. 打开 控制台中的 AdrMcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[AdrMcp banner]

AdrMcp

Table of Contents

Getting Started

Prerequisites

Run

bash
git clone https://github.com/Atypical-Consulting/AdrMcp.gitcd AdrMcpdotnet restoredotnet builddotnet run --project AdrMcp/AdrMcp.csproj

Every architectural decision, on the record — an MCP server that turns a folder of Markdown ADRs into live tools your AI agent can use: search, author, validate, link, and trace decisions.

[CI] [NuGet] [License: MIT] [.NET 10] [MCP server]

🌐 atypical-consulting.github.io/AdrMcp

[AdrMcp — Every architectural decision, on the record]

Features

  • Read & search ADRs — list_adrs, get_adr, search_adrs (lexical or semantic), and get_adr_index for the full decision timeline.
  • Author from a template — create_adr drafts MADR- or Nygard-format ADRs; update_adr replaces or appends a single section.
  • Lifecycle-aware transitions — set_status enforces the ADR lifecycle; supersede_adr creates the replacement and marks/links the old one superseded in a single call.
  • Relationship graph & staleness detection — find_related_adrs / get_adr_graph expose links and supersession chains; find_stale_adrs flags ADRs whose code_refs no longer resolve in the codebase.
  • Conflict & coverage analysis — detect_conflicts surfaces contradictory accepted decisions; coverage_report highlights ADR coverage gaps by architectural area.
  • Preview-by-default writes — every mutating tool defaults to previewOnly: true and returns a unified diff before anything touches disk.
  • Ships as a dotnet tool, NuGet package, and Docker image, plus three bundled Claude Code skills (adr-author, adr-review, adr-supersede) for the judgment layer on top of the raw tools.

The problem

Architectural decisions get made in Slack threads, PR comments, and someone's head — then the reasoning evaporates. Months later a teammate asks "why is it done this way?", nobody remembers, and the decision gets silently re-litigated or accidentally reversed. ADRs fix that — if they're written and kept honest. But a folder of Markdown files is inert: you can't ask it what's still accepted, trace what superseded what, or notice a decision that no longer matches the code.

It's worse with AI coding agents: the one collaborator that could keep decisions current has no way to read, write, or reason about them.

The solution

AdrMcp makes that folder a live surface any MCP client can work. It gives your agent tools to list and search decisions, draft new ones from a MADR template, validate structure and links, supersede a decision while preserving its history, and flag stale or conflicting ones — all preview-by-default, so nothing is written without you seeing the diff.

The records stay plain Markdown in git; AdrMcp adds the tools. Built as a .NET 10 stdio MCP server, architecturally modeled on RoselineMCP — layered Tools → Services, [McpServerTool] attributes, shipped as a dotnet tool + Docker image.

Storage & format

ADRs are markdown files under an ADR root (default docs/adr/), one file per decision named NNNN-kebab-title.md, using MADR 4.0 frontmatter + sections:

markdown
---id: 1title: Use PostgreSQL for persistencestatus: accepted          # proposed | accepted | rejected | deprecated | supersededdate: 2026-07-08tags: [data]links:  - { type: superseded-by, target: 5 }code_refs:  - { path: src/Data/Repository.cs, symbol: PostgresRepository }---
# Use PostgreSQL for persistence
## Context and Problem Statement...## Decision Outcome...## Consequences...

Everything is git-native, human-readable, and diff-able — no database.

Tools

ToolKindDescription
list_adrsreadList/filter ADRs (status, tag, date range)
get_adrreadGet one ADR; optionally only selected ## sections
search_adrsreadLexical (default) or semantic term-vector search
get_adr_indexreadThe decision log / timeline
find_related_adrsreadIncoming/outgoing links + supersession chain
get_adr_graphreadFull relationship graph (nodes + typed edges)
create_adrwriteCreate an ADR from a template (madr or nygard)
update_adrwriteReplace/append a single ## section
set_statuswriteTransition status (enforces the lifecycle)
supersede_adrwriteCreate replacement + mark old superseded + link, in one call
link_adrswriteTyped link between two ADRs (adds inverse)
validate_adrreadMADR compliance: sections, status, dangling links, duplicate ids
detect_conflictsreadExplicit conflicts-with + highly similar accepted ADRs
find_stale_adrsreadADRs whose code_refs no longer resolve
coverage_reportreadADR coverage per architectural area (tag); surfaces gaps
suggest_adr_from_changereadDraft an ADR proposal from a unified diff
render_indexwriteRegenerate the browsable README.md decision index
diff_adrreadDiff two ADRs, or a file vs its canonical rendering

Writes are preview-by-default. Every mutating tool takes previewOnly (default true) and returns a unified diff of the intended change; pass previewOnly=false to write to disk.

Configuration

Resolved in order: CLI arg → env var → default.

SettingCLIEnvDefault
ADR root--adr-root <path>ADR_ROOT<repo>/docs/adr
Repo root (for code_refs)--repo-root <path>ADR_REPO_ROOTcurrent directory

Code-linking is provider-based

find_stale_adrs resolves code_refs through an ICodeLinkProvider. The default FileSystemCodeLinkProvider is language-agnostic (a ref resolves if the file exists and, when a symbol is given, that symbol's text is present). A Roslyn (.NET) or codebase-memory provider can be plugged in behind the same interface — deep symbol resolution stays the client's job.

Run

bash
# from sourcedotnet run --project AdrMcp -- --adr-root ./docs/adr
# as a global tooldotnet tool install -g AdrMcpadr-mcp --adr-root ./docs/adr

MCP client config

json
{  "mcpServers": {    "adr": {      "command": "adr-mcp",      "args": ["--adr-root", "/path/to/repo/docs/adr", "--repo-root", "/path/to/repo"]    }  }}

Docker

bash
docker build -t adr-mcp .docker run --rm -i -v "$PWD:/workspace" adr-mcp --adr-root /workspace/docs/adr

Usage

Once adr-mcp is registered as an MCP server, an agent calls its tools directly. A typical read-then-write flow:

jsonc
// "What ADRs do we have about data storage?"list_adrs({ "tag": "data" })// → [{ "id": 5, "title": "Use PostgreSQL for persistence", "status": "accepted", "tags": ["data"] }]
// "Draft a decision for switching to gRPC internally" — nothing is written yetcreate_adr({  "title": "Adopt gRPC for internal services",  "template": "madr",  "previewOnly": true})// → unified diff of the new docs/adr/0006-adopt-grpc-for-internal-services.md
// Once the content looks right, write it for realcreate_adr({ "title": "Adopt gRPC for internal services", "template": "madr", "previewOnly": false })
// Later, retire an old decision in favor of a new one, preserving historysupersede_adr({ "oldId": 2, "newTitle": "Replace REST gateway with gRPC", "previewOnly": false })

Claude skills

Three project skills under .claude/skills/ add the judgment/workflow layer on top of the MCP tools (the server provides the mechanics; the skills provide the craft). They activate automatically in Claude Code when the connected AdrMcp server is available:

SkillTriggers onWhat it does
adr-author"write an ADR", "record this decision"Decide if a decision warrants an ADR, frame a sharp Context/Decision/Consequences, draft via create_adr + validate_adr
adr-review"review this ADR", "does this decision hold up"Structural + substantive critique against a rubric, using validate_adr / detect_conflicts
adr-supersede"we changed our mind", "retire this decision"Pick the right lifecycle move and drive supersede_adr / set_status with correct linking

Develop

bash
dotnet build AdrMcp.slnxdotnet test AdrMcp.slnx        # unit tests + MCP-over-stdio integration testsdotnet pack AdrMcp/AdrMcp.csproj -c Release -o ./artifacts

Continuous integration

CI/CD runs on GitHub Actions, modeled on RoselineMCP:

WorkflowTriggerWhat it does
ci.ymlpush / PR to main/devBuild + test matrix (ubuntu/windows/macos); 80% line-coverage gate on ubuntu
codeql.ymlpush / PR / weeklyCodeQL security analysis (C#)
pages.ymlpush to site/** on devPublish the landing page to GitHub Pages
release-please.ymlpush to devMaintain a release PR (Conventional Commits); on merge, publish NuGet + MCPB + MCP Registry + GHCR image

Releases are automated with release-please: merge the release PR it opens to ship. See PUBLISH.md.

Project layout

AdrMcp/├── Interfaces/   service contracts (IAdrRepository, ICodeLinkProvider, …)├── Services/     repository, templates, validation, graph, search, embeddings, code-links├── Tools/        Navigation / Authoring / Intelligence / Utility MCP tools├── Models/       Adr, AdrStatus, AdrLink, CodeRef, response DTOs└── Program.cs    DI wiring + stdio MCP host

Tech Stack

  • .NET 10
  • ModelContextProtocol
  • xunit
  • xunit.runner.visualstudio
  • DiffPlex
  • Markdig
  • Microsoft.Extensions.Hosting
  • YamlDotNet

Roadmap

  • Real embedding-backed semantic search for search_adrs / detect_conflicts (beyond term-vector similarity)
  • Roslyn-based ICodeLinkProvider for deep C# symbol resolution in find_stale_adrs
  • Additional ADR templates beyond MADR/Nygard (e.g. Y-statements)
  • Editor extension (VS Code / JetBrains) to browse and visualize the decision graph
  • Broaden the CI coverage gate and publish to additional package registries

See the open issues for details and to propose new ideas.

Atypical MCP servers

Part of a suite of Model Context Protocol servers by Atypical Consulting:

  • RoselineMCP — Roslyn code intelligence for AI agents
  • ASTral — structured code retrieval (tree-sitter)
  • AdrMcp — Architecture Decision Records over MCP
  • MarkdownInk — Markdown rendering for the terminal

Contributing

Contributions are welcome. Open an issue first to discuss any significant change.

  1. Fork the repository and create your branch (git checkout -b feat/my-feature)
  2. Commit your changes (git commit -m 'feat: ...')
  3. Push the branch and open a Pull Request

Built by Atypical Consulting. We also make NuGetKeep, a self-hosted NuGet server with supply-chain quarantine.

来源:README.md,提交 1f104ab

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分