Skip to content

bug(mcp): MCP tool operations are not logged to request_logs table #68

Open

Description

@savioruz

Describe the bug

MCP tool operations (add_memory, search_memory, list_memories, update_memory, delete_memory) are not recorded in the request_logs table, while HTTP API requests (via the web dashboard) are.

This means the "Requests" page in the web UI (crates/memayu-web/src/pages/requests.rs) shows no entries when memories are written/read through the MCP server — only HTTP API calls are visible.

Steps to reproduce

  1. Start memayu serve and connect an MCP client (e.g. an stdio MCP client pointing at the memayu mcp transport).
  2. Call any MCP tool (e.g. add_memory).
  3. Open the web UI → Requests page, or query the request_logs table directly.
  4. Observe: no rows for the MCP operation.

Expected behavior

MCP tool calls should be logged to request_logs (e.g. method = MCP, path = mcp/<tool_name>, with status + latency + auth) just like HTTP API requests, so the audit log / Requests page is complete regardless of access path.

Root cause (source inspection on main, v0.1.0 line)

  • crates/memayu-api/src/transport/routes.rs calls request_log_insert(...) after HTTP responses.
  • crates/memayu-mcp/src/tools/*.rs (add_memory.rs, search_memory.rs, etc.) call backend.add_memory() / backend.search_memory() directly and never call request_log_insert.
  • The memayu-mcp crate has zero references to request_log.

Suggested fix

Add request_log_insert calls (or a shared MCP transport middleware/wrapper) in the MCP tool handlers, mirroring the HTTP API's logging. Use a synthetic method/path like MCP / mcp/<tool_name> so the Requests page can distinguish the transport.

Environment

  • memayu v0.1.0 (aarch64-unknown-linux-gnu release binary)
  • Local Candle embedder (dim 384)
  • Reproduced on Raspberry Pi 4 + macOS client

Context

Activity

  1. added
    bugSomething isn't working
    mcpMCP server tools
    priority-mediumMedium priority — important but not blocking
    self-hostedRelates to self-hosted / local-first usage
    on Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmcpMCP server toolspriority-mediumMedium priority — important but not blockingself-hostedRelates to self-hosted / local-first usage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions