ArchRepoMCP
Provides management of architectural Git repositories, including local Git operations (status, diff, history, commit, branches, remotes) and explicit remote synchronization (clone, fetch, fast-forward pull, publish).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ArchRepoMCP Initialize the government repository and list all entity types."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ArchRepoMCP
MCP-сервер для локального управления архитектурными Git-репозиториями. Структура сущностей задаётся декларацией DSL, а удалённые Git-сервисы рассматриваются только как явный контур синхронизации.
Текущий MVP позволяет AI-агенту сначала получить из government repository полную модель сущностей и шаблоны, затем явно выбрать рабочий repository и локально управлять его содержимым. Доступ к remote выполняется только через отдельные явные операции; остальные возможности полностью работают offline.
Реализовано
строгий parser и validator DSL
architecture_repository/v2;обязательное семантическое
descriptionдля каждого entity type;закрытая грамматика, проверка presets, relations, regex и duplicate YAML keys;
обнаружение корня локального Git repository без сетевых операций;
repository confinement и запрет symbolic-link обходов;
проверка templates, конфликтов file matching и форматов файлов;
безопасное создание repository из декларации и её template bundle;
автоматически создаваемый government repository со встроенным нормативным preset;
описание AI-facing модели через
repository_describeи явный выбор черезrepository_list;единый локальный workspace, настраиваемый через stdio, environment или
.env;Entity Service:
list,read,search,create,update,delete;rollback entity mutations, не прошедших полную repository validation;
Local Git Service:
status,diff,history,commit, branches и remotes;Remote Sync Service: явные
clone,fetch, безопасный fast-forwardpullиpublish;MCP server на официальном Python SDK v2 со stdio transport;
нормализованная модель ошибок;
автоматические DSL, repository, entity, local Git, remote sync и MCP contract tests.
Related MCP server: scryer-mcp
Архитектура текущего среза
MCP tools
│
├── Government Model ───── initialize / describe / list repositories
├── Repository Service ─── create / open / validate
├── Entity Service ────── list / read / search / create / update / delete
├── Local Git Service ─── status / diff / history / commit / branches / remotes
└── Remote Sync Service ── clone / fetch / pull / publish
│ │
├── DSL v2 Engine └── explicit Git transport
│
▼
Local Git RepositoryНормативные документы расположены в specs/, реализация — в src/, а проверки
соответствия — в tests/.
Требования
Python 3.11 или новее;
Git, доступный через
PATH;Windows, Linux или macOS.
Установка для разработки
PowerShell:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e ".[dev]"Linux/macOS:
python -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[dev]'Запуск MCP
После установки пакет предоставляет stdio-команду:
arch-repo-mcpЭквивалентный запуск через Python:
python -m arch_repo_mcp.serverДля MCP host команда настраивается как stdio server. Рекомендуемый пример конфигурации:
{
"mcpServers": {
"arch-repo": {
"command": "arch-repo-mcp",
"env": {
"ARCH_REPO_MCP_WORKSPACE": "D:\\ArchitectureRepositories",
"ARCH_REPO_MCP_GOVERNMENT_REPOSITORY": "government"
}
}
}
}Конкретный формат файла конфигурации зависит от MCP host. Команда должна запускаться в
окружении, где установлен пакет arch-repo-mcp.
Workspace и .env
ARCH_REPO_MCP_WORKSPACE задаёт локальную директорию, внутри которой находятся government
и все рабочие repositories. ARCH_REPO_MCP_GOVERNMENT_REPOSITORY задаёт абсолютный путь
внутри workspace либо относительный путь; значение по умолчанию — government.
Те же значения можно сохранить в .env текущей директории процесса:
ARCH_REPO_MCP_WORKSPACE=D:/ArchitectureRepositories
ARCH_REPO_MCP_GOVERNMENT_REPOSITORY=governmentДругой env-файл выбирается через ARCH_REPO_MCP_ENV_FILE. Для
government_repository_initialize, repository_describe и repository_list значения
можно передать непосредственно по stdio в аргументах workspace_path,
government_repository_path и env_file. Приоритет: stdio-аргумент, process environment,
.env, затем документированное имя government repository по умолчанию.
Если workspace настроен, относительные repository_path и target_path разрешаются внутри
него, а выход за его границы отклоняется. Entity tools дополнительно запрещают использовать
government repository как рабочий.
Запуск в Goose на macOS
Goose подключает локальные MCP-серверы как STDIO extensions. Сначала установите нужный клиент Goose через Homebrew (CLI, Desktop или оба):
brew install block-goose-cli
brew install --cask block-gooseНастройте LLM provider при первом запуске Goose или позднее через goose configure в CLI либо
Settings → Models в Desktop. Затем подготовьте ArchRepoMCP и локальный workspace. Во всех
следующих примерах замените /Users/you/... своими абсолютными путями:
cd /Users/you/src/ArchRepoMCP
python3 -m venv .venv
./.venv/bin/python -m pip install -e .
mkdir -p /Users/you/ArchitectureRepositoriesИспользуйте абсолютный путь к .venv/bin/arch-repo-mcp: Goose Desktop может не наследовать
PATH интерактивной shell. Переменные окружения также лучше передать в настройках extension,
поскольку рабочая директория процесса Goose не обязана совпадать с каталогом проекта.
Goose CLI
Для постоянного подключения выполните:
goose configureВ интерактивном меню выберите Add Extension → Command-Line Extension и укажите:
name:
ArchRepoMCP;command:
/Users/you/src/ArchRepoMCP/.venv/bin/arch-repo-mcp;timeout:
300;environment variable
ARCH_REPO_MCP_WORKSPACE:/Users/you/ArchitectureRepositories;environment variable
ARCH_REPO_MCP_GOVERNMENT_REPOSITORY:government.
После добавления запустите обычную сессию:
goose sessionДля одноразовой сессии без сохранения extension в конфигурации Goose используйте:
goose session --with-extension \
"ARCH_REPO_MCP_WORKSPACE=/Users/you/ArchitectureRepositories ARCH_REPO_MCP_GOVERNMENT_REPOSITORY=government /Users/you/src/ArchRepoMCP/.venv/bin/arch-repo-mcp"Goose Desktop (GUI)
Откройте боковую панель Goose Desktop и перейдите в
Extensions.Нажмите
Add custom extension.Выберите type
Standard IO, задайте IDarch-repo-mcp, nameArchRepoMCPи command/Users/you/src/ArchRepoMCP/.venv/bin/arch-repo-mcp.Добавьте через отдельную кнопку
Addобе переменные окружения из CLI-инструкции выше и установите timeout300.Нажмите
Add, убедитесь, что extension включён, и начните новую сессию.
Для проверки подключения попросите Goose: Вызови repository_describe, затем repository_list.
Первый вызов автоматически создаст government repository со встроенными DSL-декларацией и
шаблонами, если его ещё нет. Конфигурация CLI и Desktop общая и хранится Goose в
~/.config/goose/config.yaml.
Актуальные названия пунктов интерфейса и варианты установки приведены в официальной инструкции по установке Goose и документации по extensions.
MCP tools
Tool | Назначение |
| Открыть или создать government repository из встроенного DSL preset |
| Получить entity semantics, relations, file rules и полное содержимое templates |
| Получить рабочие repositories для явного выбора |
| Создать локальный Git repository из DSL declaration bundle |
| Открыть и полностью проверить локальный architecture repository |
| Получить детальный validation report без изменения repository |
| Получить структурированный локальный Git status |
| Получить working-tree, staged или revision diff |
| Получить ограниченную локальную commit history |
| Валидировать и закоммитить только DSL-controlled paths |
| Получить список локальных веток |
| Создать локальную ветку без автоматического switch |
| Переключиться на валидную локальную ветку из clean state |
| Получить remotes с очищенными URL |
| Добавить или явно заменить remote без сетевого запроса |
| Явно клонировать remote и создать target только после validation |
| Явно получить refs без изменения index и working tree |
| Выполнить только валидированный fast-forward из clean state |
| Валидировать и явно отправить текущий |
| Создать entity из объявленного template |
| Получить список экземпляров указанного DSL entity |
| Прочитать один экземпляр по repository-relative path |
| Прочитать связанные файлы по DSL и front matter исходной entity |
| Найти текст во всех или в указанном типе entity |
| Локально заменить entity с validation и rollback |
| Локально удалить entity с validation и rollback |
Все операции над существующим repository принимают repository_path; repository_create
и repository_clone вместо него принимают новый target_path. Repository и Entity tools,
которым требуется декларация, также принимают необязательный declaration_path с явно
документированным значением по умолчанию architecture.yaml. Git inspection отделён от
DSL validation и остаётся доступен для диагностики невалидного working tree. Ответ имеет
единый envelope:
{
"ok": true,
"result": {}
}или:
{
"ok": false,
"error": {
"code": "INVALID_REPOSITORY",
"message": "Architecture repository validation failed",
"details": {}
}
}Сценарий AI-агента
Вызвать
repository_describe; отсутствующий government repository будет создан из встроенныхarchitecture.yamlи templates без commit или remote.Использовать возвращённые
description,relations,path_rule,filename_rule,formatиtemplate_contentкак источник правил классификации исходного текста.Вызвать
repository_list, выбрать только валидный repository сmodel_matches_government=trueи явно передавать егоrepository_pathво все entity tools.Для каждого результата классификации вызвать
entity_create, затемentity_updateс полным UTF-8 содержимым по шаблону.Отдельно проверить изменения и при необходимости явно выполнить commit/publish.
Создание repository
repository_create принимает отсутствующий target_path и путь к исходной DSL-декларации
declaration_source. Все указанные декларацией templates должны находиться рядом с ней по
repository-relative путям. Сначала bundle полностью проверяется, затем во временном
staging-каталоге выполняется git init, и только валидный результат переносится в target.
Начальная ветка задаётся параметром initial_branch с документированным значением по
умолчанию main. Операция не создаёт commit и не настраивает remote.
Изменение entities
entity_create всегда использует объявленный DSL template как стартовое содержимое.
entity_update принимает полное новое UTF-8 содержимое. Все три mutation tools оставляют
изменения только в working tree, выполняют полную validation и восстанавливают исходное
состояние при ошибке. Commit или push автоматически не выполняются.
DSL relations содержит только имена допустимых связанных entity types. Ссылки на экземпляры
хранятся исключительно во front matter конкретного файла:
relations:
- entity: category
files:
- C-0001.mdentity_read_related проверяет направление связи по DSL и filename по правилу целевой
entity. Найденный файл возвращается вместе с содержимым. Для корректной ссылки на
отсутствующий файл возвращаются relation_valid=true, found=false, status=missing и,
когда path selector точный, ожидаемый expected_path. Отсутствие target не делает repository
невалидным. При нескольких подходящих файлах возвращается status=ambiguous и
candidate_paths; неявный выбор не выполняется.
Local Git operations
repository_commit сначала выполняет полную repository validation, затем включает в
commit только изменённые declaration, templates и файлы, однозначно принадлежащие DSL
entities. Посторонние staged-файлы не попадают в commit и остаются в index. Push не
выполняется.
branch_switch разрешён только при полностью чистых index и working tree. Remote branch
guessing, stash, reset и автоматическое разрешение конфликтов не используются. Если target
branch не проходит validation, MCP возвращается на исходную ветку и сообщает ошибку.
remote_configure изменяет только локальный .git/config. Замена существующего remote
требует явного replace=true. HTTP(S) URL со встроенными credentials, query или fragment
отклоняются; repository_remotes удаляет credential-bearing части из возвращаемых URL.
Remote synchronization
Remote-операции никогда не запускаются другими tools неявно и не запрашивают credentials
интерактивно. repository_clone клонирует во временный каталог рядом с target_path,
отключает рекурсивное получение submodules, выполняет полную DSL/repository validation и
только после успеха перемещает результат в target. Невалидный clone не оставляет частично
созданный repository по целевому пути.
repository_fetch требует явное имя настроенного remote и только обновляет remote-tracking
refs. Операция не выполняет merge, rebase, switch, stash или reset и не меняет index и
working tree. Получение tags и prune отключены по умолчанию и включаются отдельными
параметрами.
repository_publish требует clean index и working tree, повторно валидирует repository и
публикует текущий HEAD в явно указанные remote и branch. Операция не настраивает upstream,
не отправляет tags, не использует force push и сообщает о non-fast-forward как об ошибке.
HTTP(S) URL со встроенными credentials, query или fragment запрещены также для clone;
секреты следует передавать средствами окружения и Git credential helper вне MCP-ответов.
repository_pull доступен только для clean working tree и fast-forward history. Fetched tree
валидируется до изменения текущей ветки; divergence, invalid tree и конфликты отклоняются без
implicit stash, reset, rebase или автоматического разрешения конфликтов.
Минимальная DSL-декларация
declaration:
kind: architecture_repository
version: v2
entities:
- name: fact
files:
path:
match: exact
value: facts
filename:
match: regex
value: '^F-[0-9]{4}\.md$'
format: markdown_front_matter
template: templates/fact.mdДля каждого entity один matched-файл считается одним экземпляром. path сопоставляется
с repository-relative parent path, filename — только с basename. Regex применяется как
full match. Один файл не может одновременно принадлежать нескольким entities.
Поддерживаемые форматы: yaml, json, markdown, markdown_front_matter, text.
Полный нормативный контракт находится в specs/dsl/DSL_V2_TABLES.md, валидные примеры —
в specs/examples/declarations/.
Проверки
python -m pytest
python -m ruff check .Тесты создают временные локальные Git repositories. Remote sync проверяется через локальные
bare repositories и file:// transport, поэтому Forgejo и доступ к сети не требуются.
Forgejo и credentials
Интеграция с Forgejo ещё не включена в runtime. Для будущих integration tests параметры
берутся только из локального .forgejo.env или переменных окружения:
FORGEJO_URL
FORGEJO_API_URL
FORGEJO_TOKEN
FORGEJO_USERNAME
FORGEJO_ORGANIZATION
FORGEJO_DEFAULT_BRANCH
FORGEJO_DEFAULT_PRIVATE
FORGEJO_TLS_VERIFYЛокальные файлы .forgejo.env, forgejo.env и forgego.env исключены из Git. Tokens и
другие credentials нельзя помещать в DSL, source code, test data, logs или исключения.
Основные принципы
local repository first;
contract-driven API;
DSL-driven file model без hardcoded
facts/requirements/categories;никаких implicit commit, push, pull, merge, rebase, stash или reset;
публикация только после validation и только явной командой;
provider independence и полноценная offline-работа локальных функций.
Проект распространяется по лицензии MIT.
Available Tools
26 toolsbranch_createA
Create a local branch without switching the repository to it.
Inputs: branch_name (required), repository_path (required), start_point. Returns: object
branch_switchA
Switch to a valid local branch only when the worktree and index are clean.
Inputs: branch_name (required), repository_path (required), declaration_path. Returns: object
entity_createA
Create a local entity from its DSL template without commit or publication.
Inputs: entity_name (required), entity_path (required), repository_path (required), declaration_path. Returns: object
entity_deleteC
Delete one local entity without commit or publication.
Inputs: entity_name (required), entity_path (required), repository_path (required), declaration_path. Returns: object
entity_listB
List instances of a DSL-declared entity type from the local repository.
Inputs: entity_name (required), repository_path (required), declaration_path. Returns: object
entity_readC
Read one local entity selected by type and repository-relative path.
Inputs: entity_name (required), entity_path (required), repository_path (required), declaration_path. Returns: object
entity_searchB
Search text in all or one type of local DSL-resolved entity.
Inputs: query (required), repository_path (required), entity_name, case_sensitive, +1 more. Returns: object
entity_updateB
Replace a local entity and roll back when validation fails.
Inputs: content (required), entity_name (required), entity_path (required), repository_path (required), +1 more. Returns: object
government_repository_initializeC
Open or create the government repository from the built-in DSL and templates.
Inputs: env_file, initial_branch, workspace_path, government_repository_path. Returns: object
remote_configureB
Add or explicitly replace local remote configuration without network access.
Inputs: url (required), name (required), repository_path (required), replace. Returns: object
repository_branchesA
List local branches without contacting a remote.
Inputs: repository_path (required). Returns: object
repository_cloneC
Explicitly clone and validate a remote Git architecture repository.
Inputs: remote_url (required), target_path (required), branch, include_tags, +1 more. Returns: object
repository_commitA
Validate and commit only changed DSL-controlled paths without push.
Inputs: message (required), repository_path (required), declaration_path. Returns: object
repository_createC
Create a validated local Git repository without creating a commit.
Inputs: target_path (required), declaration_source (required), initial_branch, declaration_path. Returns: object
repository_describeC
Return the authoritative DSL model, templates, and entity-management workflow.
Inputs: env_file, workspace_path, government_repository_path. Returns: object
repository_diffA
Return working-tree, staged, or revision-to-revision local Git diff.
Inputs: repository_path (required), staged, base_revision, target_revision. Returns: object
repository_fetchA
Explicitly fetch a configured remote without changing the working tree.
Inputs: remote (required), repository_path (required), prune, include_tags. Returns: object
repository_historyA
Return bounded local commit history without contacting a remote.
Inputs: repository_path (required), revision, max_count. Returns: object
repository_listA
List working repositories so an agent can explicitly select a repository_path.
Inputs: env_file, workspace_path, government_repository_path. Returns: object
repository_openB
Open and fully validate a local architecture Git repository without network access.
Inputs: repository_path (required), declaration_path. Returns: object
repository_publishA
Validate and explicitly push current HEAD without force or implicit upstream.
Inputs: remote (required), remote_branch (required), repository_path (required), declaration_path. Returns: object
repository_pullA
Fetch and integrate only a validated fast-forward into a clean local branch.
Inputs: remote (required), remote_branch (required), repository_path (required), declaration_path. Returns: object
repository_remotesA
List local Git remotes while redacting credential-bearing URL components.
Inputs: repository_path (required). Returns: object
repository_statusA
Return local Git status without fetch, pull, or other network operations.
Inputs: repository_path (required). Returns: object
repository_validateC
Validate the DSL, templates, paths, matching rules, and local entity files.
Inputs: repository_path (required), declaration_path. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 26 tools
Most tools target clearly distinct resources and actions, and entity CRUD is well separated from Git repository operations. However, repository_create, repository_open, repository_validate, and government_repository_initialize have overlapping lifecycle responsibilities that could cause an agent to mis-select.
Tool names are uniformly snake_case and mostly follow a <domain>_<operation> pattern, but operations are inconsistently verbs or nouns (repository_branches vs branch_create), and branch/remote tools break the repository_ prefix. The style is readable but not a single predictable convention.
With 26 tools, the surface is above the clearly heavy threshold and includes several closely related lifecycle operations that could be consolidated, such as validate/open, commit/publish, and status/list. The broad Git-plus-entity scope explains some size, but the count still feels excessive for an MCP server.
The tool set covers repository creation/open/validation, local Git workflows, remotes, and full entity CRUD plus search, so core workflows have no obvious dead ends. Missing branch deletion/merge, remote removal, and tag operations are minor gaps agents can generally work around.
Maintenance
Related MCP Connectors
Git collaboration for AI agents and people: tasks, hand-offs, reviews, teams, shared memory.
Git-backed platform for skills, tools, and context for AI agents
Runnable, versioned lists for agents: tools, prompts and lists as resources. Git under the hood.
One memory for every AI you work with: your rules, notes and decisions in your own Git repo.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read and write a local-first knowledge base of plain markdown files in git, with governance gates for safe, hash-anchored edits.1Apache 2.0
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to read, modify, and build from architecture models, keeping the model as the source of truth for intent and synchronized with code.124-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to interact with a local-first git client that provides a knowledge graph of the repository, including graph analysis, issue and proposal management, and architectural review.2MIT
- AlicenseNot gradedqualityBmaintenanceEnables coding agents to maintain local-first project memory, coordinate task ownership across Git worktrees, and verify completion against project-defined checks with durable evidence stored in the repository.1Apache 2.0