← Back to project

Scrapbook: MCP Tooling & Security Design



Date: 2026-02-16T17:30:00Z

MCP Server Interface



Goal: Expose our overlay’s capabilities to external AI agents (like ChatGPT, Claude) via Model Context Protocol. This lets Antonio query his audit data through a natural interface.

MCP tools (functions) to expose:

1. `search_events(query: string) -> list<EventSummary>`

2. `get_daily_summary(date: string) -> string`
3. `get_anomalies(start_date, end_date, severity?) -> list<Anomaly>`
4. `trace_entity(entity_type: string, entity_id: string) -> list<Event>`
5. `export_report(format: "json"|"csv"|"md", params) -> file or text`

Transport: stdio (JSON‑RPC 2.0) as per MCP spec. Our Go binary will have a `mcp` subcommand that runs the server loop. Tools must be fast; heavy LLM calls are done only where needed (e.g., summary generation already cached). For `search_events`, we initially use SQLite FTS if available, else fallback to simple LIKE.


Security: Only local invocation (stdio) by trusted agent (Antonio’s ChatGPT). No network exposure. If needed, we could add token‑based auth over pipes, but trust is assumed.

---

Security, Compliance, Politics Checklist



IT approval concerns for on‑prem software:


Politics:

---


Pilot Proposal Outline (Low‑Risk)



Objective: Demonstrate value within 2 weeks of deployment on a non‑production replica of the customer’s database (or synthetic data if replica not available).

Scope:


Success criteria:

Exit clause: If installation proves too disruptive, we uninstall with one command; no residual changes to their databases.


---

MCP Tool Definitions (Detailed)



Follows JSON‑RPC method naming.

search_events




{
"jsonrpc": "2.0",
"method": "audit.search_events",
"params": { "query": "inventory theft" },
"id": 1
}


Response:


{
"jsonrpc": "2.0",
"result": {
"events": [
{
"event_id": "...",
"type": "inventory.adjustment",
"timestamp": "2026-02-15T22:30:00Z",
"entity_type": "product",
"entity_id": "123",
"snippet": "adjustment reason=THEFT, qty -50"
}
]
},
"id": 1
}


get_daily_summary



Params: `{ "date": "2026-02-16" }` → `{ "summary": "Today ..."}"

get_anomalies



Params: `{ "start_date": "...", "end_date": "...", "severity": "high" }` (severity optional)

trace_entity



Params: `{ "entity_type": "product", "entity_id": "123" }` → array of events sorted by timestamp.

export_report



Params: `{ "format": "csv", "type": "sales", "start": "...", "end": "..." }` → returns file content as base64 or stream.

All tools are read‑only; no risk of modifying source data.

---

This will be organized into Report 5.