Skip to content

Improve HTTP MCP server observability - #318

Merged
MacondoExpress merged 8 commits into
2.xfrom
improve-ergonomics-and-observability
Aug 17, 2026
Merged

Improve HTTP MCP server observability#318
MacondoExpress merged 8 commits into
2.xfrom
improve-ergonomics-and-observability

Conversation

@MacondoExpress

Copy link
Copy Markdown
Contributor

Adds structured logging for HTTP-mode diagnosis: request correlation, completion lines, middleware rejections, and tool lifecycle. Sanitizes Bolt URIs via neo4j_target while keeping raw connection keys denylisted.

Highlights:

  • Server-generated request_id and per-request request completed log (status, duration, auth type, headers)
  • rejectRequest helper with stable reason codes on all middleware rejections
  • Tool call start/complete wrapper with duration and success flag
  • Initialize verification success/failure logs; guard blocks and tool-filter debug logs
  • Neo4j error neo4j_error_code on database and tool error paths
  • Aura db_id inferred from Bolt hostname (*.databases.neo4j.io / neo4j-dev.io)
  • SafeBoltTarget in logger; log as neo4j_target (visible), not bolt_uri (redacted)
  • Startup log harmonized to listen_url; url added to denylist
  • Included observability fields in log (read-only, tools filter, auth type)

@MacondoExpress
MacondoExpress requested a review from a team as a code owner July 29, 2026 11:03
Comment thread cmd/neo4j-mcp/neo4j-mcp Outdated
Comment thread internal/logger/logger.go
Liam-Doodson
Liam-Doodson previously approved these changes Aug 13, 2026
@MacondoExpress

Copy link
Copy Markdown
Contributor Author

Sorry @Liam-Doodson,
My bad, but after testing one last time, I wanted to add some others logs and I've included a proper log for the the timeout case just added, plus other bits.
Can I ask a quick review 🥺 ?
The changes:

  • Added request started logs with the MCP method, making initialize, tools/list, and tools/call distinguishable.
  • Changed tool-start logs from INFO to DEBUG.
  • Tool failures and policy blocks now use WARNING; unexpected internal errors remain ERROR.
  • Removed raw Cypher queries from logs.
  • Added clear timeout warnings with the affected method, phase, duration, and tool name when available.

@MacondoExpress
MacondoExpress merged commit 88362fb into 2.x Aug 17, 2026
20 of 22 checks passed
@MacondoExpress
MacondoExpress deleted the improve-ergonomics-and-observability branch August 17, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants