# MCP adapter `server.c` owns only the mcpc server lifecycle. Tool schemas and callbacks live under `tools/`, one source file per memory tool. Shared registration, callback context, and response helpers live under `tools/common/`. mcpc owns stdio framing, MCP initialization, dispatch, and result envelopes. The pinned mcpc API supports integer and UTF-8 string properties, but not nested or optional properties. Consequently every advertised property must be sent. Use an empty `session_id` where that filter is optional, and pass write metadata as a JSON object string in `metadata_json` (`{}` when no metadata is needed). Tool success and application errors are JSON serialized into MCP TextContent; application errors also set `isError`.