Metadata-Version: 2.4
Name: architect-c4-mcp
Version: 0.3.3
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Documentation
Requires-Dist: fastmcp[tasks]>=2.0
Requires-Dist: pydantic>=2.12
Requires-Dist: pytest>=8 ; extra == 'dev'
Requires-Dist: pytest-cov>=6 ; extra == 'dev'
Requires-Dist: ruff>=0.12 ; extra == 'dev'
Requires-Dist: maturin>=1.8,<2 ; extra == 'dev'
Provides-Extra: dev
License-File: LICENSE
Summary: C4 architecture MCP sidecar — TOML under docs/, Rust write queue
Keywords: mcp,c4,architecture,adr,fastmcp
Author: hewimetall
License-Expression: MIT
Requires-Python: >=3.12
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://github.com/hewimetall/architect-c4-mcp/blob/main/docs/QUICKSTART.md
Project-URL: Homepage, https://github.com/hewimetall/architect-c4-mcp
Project-URL: Issues, https://github.com/hewimetall/architect-c4-mcp/issues
Project-URL: Repository, https://github.com/hewimetall/architect-c4-mcp

# architect-c4

MCP-сервис рядом с вашим git-репозиторием: агент ведёт **C4**, **ADR** и **потоки поведения** как файлы в `docs/`.

```text
ваш-репо/
  docs/
    model.toml
    adr/{id}.toml
    flows/{id}.toml
```

На диске продукта — только TOML. Запись идёт через очередь на Rust. История — git.

Подробнее: [концепт](docs/CONCEPT.md) · [быстрый старт](docs/QUICKSTART.md) · [инструменты](docs/MCP_TOOLS.md) · [публикация](docs/PUBLISH.md)

## Установка

Нужен Python 3.12+. Rust не требуется.

```bash
uvx architect-c4-mcp --docs /abs/path/to/product/docs
```

или

```bash
uv tool install architect-c4-mcp
architect-c4-mcp --docs /abs/path/to/product/docs
```

пакет: https://pypi.org/project/architect-c4-mcp/

Альтернатива: образ `ghcr.io/hewimetall/architect-c4-mcp`.

## Быстрый старт

```bash
uvx architect-c4-mcp \
  --docs /abs/path/to/product/docs \
  --public-base https://c4.example.com
```

Эквивалент через env: `ARCHITECT_C4_DOCS` (CLI `--docs` важнее).

HTTP:

```bash
uvx architect-c4-mcp \
  --docs /abs/path/to/product/docs \
  --transport http --host 127.0.0.1 --port 8766
```

- MCP: `http://127.0.0.1:8766/mcp`
- Viewer: `http://127.0.0.1:8766/?layer=context`

### Cursor

```json
{
  "mcpServers": {
    "architect-c4": {
      "command": "uvx",
      "args": [
        "architect-c4-mcp",
        "--docs", "/ABS/product/docs",
        "--public-base", "https://c4.example.com"
      ]
    }
  }
}
```

## Что умеет агент

| Действие | Tools / prompts |
|----------|-----------------|
| Привязать `docs/` | `bind_docs` · prompt `sidecar_onboard` |
| Модель C4 | `upsert_element`, `upsert_relationship`, `validate_model` · `model_c4` |
| ADR (GFM → `.toml`) | `upsert_adr`, `set_adr_status` · `write_adr` |
| Сценарии | `upsert_flow`, `get_flow_diagram` · `write_flow` |
| Ссылки на схемы | `get_view_links`, `get_overview_diagram` · `validate_architecture` |

Промпты: https://gofastmcp.com/servers/prompts

## Docker

```bash
docker pull ghcr.io/hewimetall/architect-c4-mcp:latest
docker run --rm -p 8766:8766 \
  -v /abs/path/to/product/docs:/docs \
  -e ARCHITECT_C4_DOCS=/docs \
  -e ARCHITECT_C4_TRANSPORT=http \
  ghcr.io/hewimetall/architect-c4-mcp:latest
```

## Разработка

```bash
git clone https://github.com/hewimetall/architect-c4-mcp.git
cd architect-c4-mcp
uv sync --extra dev
uv run maturin develop
uv run architect-c4-mcp --docs ./examples/docs
```

## CI

| Событие | Что делает |
|---------|------------|
| push / PR | pytest, `cargo test`, lint, docker build |
| tag `v*` | coverage ≥93% (py+rust) → PyPI wheels, GitHub Release, GHCR |

## Лицензия

MIT — см. [LICENSE](LICENSE).

