# Manticore MCP Server (GIA)

This document describes the MCP server wired for task + memory operations in GIA.

## Server entrypoint

- Django management command: `python manage.py mcp_manticore_server`
- Python module: `core.mcp.server`
- Tool handlers: `core.mcp.tools`

## Rust worker frontend (optional)

For low-overhead direct Manticore operations, a Rust stdio MCP worker is included:

- Project: `rust/manticore-mcp-worker`
- Build: `make mcp-rust-build`
- Binary: `rust/manticore-mcp-worker/target/release/manticore-mcp-worker`
- VS Code server name: `manticore-rust-worker` (disabled by default in `/code/xf/.vscode/mcp.json`)

This worker exposes fast table/status/query/maintenance operations and can be enabled when you want a minimal MCP process in front of Manticore.

## VS Code wiring

Workspace config is in `/code/xf/.vscode/mcp.json`:

- Server name: `manticore`
- Launch method: `podman exec -i ur_gia /venv/bin/python manage.py mcp_manticore_server`
- Forced env:
  - `MEMORY_SEARCH_BACKEND=manticore`

`MANTICORE_HTTP_URL` is inherited from container environment so each deployment can set the correct reachable address.

This allows MCP tool calls from VS Code to run against the live GIA container without requiring local Django dependencies.

## Implemented MCP tools

- `manticore.status`
- `manticore.query`
- `manticore.reindex`
- `memory.list`
- `memory.propose`
- `memory.pending`
- `memory.review`
- `memory.suggest_from_messages`
- `tasks.list`
- `tasks.search`
- `tasks.get`
- `tasks.events`
- `tasks.create_note`
- `tasks.link_artifact`
- `wiki.create_article`
- `wiki.update_article`
- `wiki.list`
- `wiki.get`
- `project.get_guidelines`
- `project.get_layout`
- `project.get_runbook`
- `docs.append_run_note`

`docs.append_run_note` appends markdown notes to `/tmp/gia-mcp-run-notes.md` by default (or a project path you pass explicitly).

All MCP tool invocations are audit-logged in `core_mcptoolauditlog` (`MCPToolAuditLog` model).

## Runtime notes

1. Ensure GIA services are running (`make run`).
2. Start Manticore container:
   - `./utilities/memory/manage_manticore_container.sh up`
3. Optional initial index:
   - `podman exec ur_gia /venv/bin/python manage.py memory_search_reindex --user-id <id> --statuses active`
4. In VS Code, approve/enabled the workspace MCP server when prompted.
