adb4a781ac
- app.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
91 lines
3.0 KiB
Markdown
91 lines
3.0 KiB
Markdown
---
|
|
name: registry_mcp
|
|
lang: go
|
|
domain: infra
|
|
version: 0.1.0
|
|
description: "Servidor MCP (Model Context Protocol) que expone registry.db a clientes Claude (Code, Desktop). Tools read-only (search/show/code/list_domains/uses/doctor) y mutadoras (fn_run, fn_create_function) para iterar sobre el registry sin shellear sqlite3 ni fn CLI."
|
|
tags: [service, mcp, registry, claude, ai-agents]
|
|
uses_functions: []
|
|
uses_types: []
|
|
framework: "mcp"
|
|
entry_point: "main.go"
|
|
dir_path: "apps/registry_mcp"
|
|
repo_url: "https://gitea.organic-machine.com/dataforge/registry_mcp"
|
|
service:
|
|
port: null
|
|
health_endpoint: null
|
|
health_timeout_s: 3
|
|
systemd_unit: registry_mcp.service
|
|
systemd_scope: user
|
|
restart_policy: on-failure
|
|
runtime: stdio
|
|
pc_targets:
|
|
- aurgi-pc
|
|
is_local_only: true
|
|
---
|
|
|
|
## Overview
|
|
|
|
Servidor MCP que sirve `registry.db` como herramientas tipadas a Claude:
|
|
|
|
| Tool | Que hace |
|
|
|---|---|
|
|
| `fn_search` | FTS5 sobre functions + types con filtros (kind, lang, domain, purity) |
|
|
| `fn_show` | Markdown card de una funcion/tipo (frontmatter + code fenced) |
|
|
| `fn_code` | Solo la columna `code` de la entidad |
|
|
| `fn_list_domains` | Agregados `(domain, kind, purity, lang)` |
|
|
| `fn_uses` | uses_functions + uses_types + reverse lookup (consumed_by) |
|
|
| `fn_doctor` | Subprocess `fn doctor <sub> --json` |
|
|
| `fn_run` | Subprocess `fn run <id> [args...]` (require `--enable-run`) |
|
|
| `fn_create_function` | Escribe `.go/.py/.sh/.ts` + `.md` y corre `fn index` (require `--enable-write`) |
|
|
|
|
## Transports
|
|
|
|
- **stdio** (default) — Claude Code/Desktop nativo.
|
|
- **HTTP** opcional via `--http :7733` con basicAuth (`REGISTRY_API_TOKEN`). Bind a `127.0.0.1` salvo `--bind 0.0.0.0` explicito.
|
|
|
|
## Build
|
|
|
|
```bash
|
|
cd apps/registry_mcp
|
|
CGO_ENABLED=1 go build -tags fts5 -o registry_mcp .
|
|
```
|
|
|
|
## Instalar en Claude Code
|
|
|
|
Anadir a `.mcp.json` del repo:
|
|
|
|
```json
|
|
{
|
|
"mcpServers": {
|
|
"registry": {
|
|
"command": "/abs/path/apps/registry_mcp/registry_mcp",
|
|
"args": ["--enable-run", "--enable-write"],
|
|
"env": { "FN_REGISTRY_ROOT": "/abs/path/fn_registry" }
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
## Origen de datos
|
|
|
|
`registry.db` local. Resuelve via `FN_REGISTRY_ROOT` env, o sube directorios buscando `go.mod` desde el cwd. Read-only: abre con `?mode=ro&_query_only=1`.
|
|
|
|
## Riesgos y mitigaciones
|
|
|
|
- `fn_run` ejecuta codigo arbitrario en el host. **Off por defecto** (flag `--enable-run`).
|
|
- `fn_create_function` escribe archivos. **Off por defecto** (flag `--enable-write`).
|
|
- FTS5 quoting: el server sanitiza tokens con `-`, `.`, `:` envolviendo en comillas dobles (regla `CLAUDE.md`).
|
|
- WAL drift: si `registry.db` se regenera durante una sesion, el server reabre la conexion al detectar `SQLITE_CORRUPT` o cambio de mtime.
|
|
- Logs: TODO va a `stderr` (slog). Stdio JSON-RPC reservado para protocolo.
|
|
|
|
|
|
## Capability growth log
|
|
|
|
Una linea por bump SemVer. Bump-type segun `.claude/commands/version.md`:
|
|
- `major`: breaking observable (CLI args, schema BBDD propia, formato wire).
|
|
- `minor`: feature aditiva (nuevo panel, endpoint, opcion).
|
|
- `patch`: bugfix sin cambio observable.
|
|
|
|
- v0.1.0 (2026-05-18) — baseline.
|