# Adolf kb#70 — cognee-mcp deletion fix.
#
# Base: official upstream image (do not hand-roll cognee-mcp itself).
# Patches exactly two files to fix a real bug: the `forget` MCP tool (the
# only deletion-capable tool actually exposed to agents — `delete`,
# `delete_dataset`, and `prune` exist in src/server.py but are never
# registered with @mcp.tool(), so they're unreachable dead code) never
# exposed a `data_id` parameter, and its cognee_client.forget() wrapper
# never forwarded one either — even though cognee's own /api/v1/forget
# endpoint has always supported single-item deletion via dataset+data_id.
# Net effect: agents could delete an entire dataset but never a single
# entry/fact. Verified 2026-07-07 by calling the live /api/v1/forget
# endpoint directly with data_id — entry-level delete works fine
# server-side; the MCP bridge was just never wired up to use it.
#
# See src/cognee_client.py forget() and src/server.py forget() for the
# fix. Both files are full copies of the upstream 0.5.4 source with only
# the forget-related code changed (diff against the base image at
# /app/src/{cognee_client,server}.py to see the exact delta).
FROM cognee/cognee-mcp:1.2.2

COPY src/cognee_client.py /app/src/cognee_client.py
COPY src/server.py /app/src/server.py
