DEV Community

Mads Hansen
Mads Hansen

Posted on

MCP database observability needs more than SQL logs

When an AI answer is wrong, “check the logs” is not enough.

Which logs?

  • the chat log
  • the MCP tool call
  • the SQL query
  • the permission decision
  • the result contract
  • the final answer

Production MCP database servers need observability that connects those steps.

At minimum, I’d want every database-backed tool call to record:

  • user/workspace/tenant scope
  • tool name and schema version
  • parameters
  • approved view or table surface
  • database role
  • duration
  • rows scanned and returned
  • timeout/truncation state
  • policy decision
  • freshness
  • answer provenance

Otherwise you can see that a query ran, but not why the agent chose it or whether the answer was safe to trust.

Longer version: Observability for MCP database servers

SQL logs tell you what happened. MCP observability should tell you how the answer happened.

Top comments (0)