Skip to content

Outbound MCP calls need audit log, redaction, and connection diagnostics #265

Description

@serge-ivo

Problem

PAGS has strong audit posture for its own MCP server, but outbound generic MCP calls are not yet first-class in observability. For an MCP-agent that can operate external apps, users and admins need to answer:

  • which MCP endpoint was called?
  • which remote tool was invoked?
  • what consent/auth path allowed or denied it?
  • did the remote call succeed, fail, timeout, or request more input?
  • were arguments/results redacted safely?

Without this, MCP agents are difficult to trust and debug.

Expected behavior

Every outbound MCP action should emit structured, redacted events suitable for user-visible history and admin diagnostics. Connection setup should also have diagnostics for auth discovery, protocol negotiation, tools/list, and failed calls.

Acceptance criteria

  • mcp_list_tools and remote tool calls log endpoint/connection id, method, remote tool name where applicable, status, duration, and failure class.
  • Logs redact secrets, bearer headers, tokens, API keys, passwords, and high-risk values by key name and value shape.
  • Denied calls are logged with the consent/auth reason before dispatch.
  • User-facing instance history can show recent outbound MCP activity.
  • Admin diagnostics can filter by user, instance, endpoint, and remote tool.
  • Connection test UI exposes actionable diagnostics without leaking credentials.
  • Tests cover successful call logging, denied call logging, redaction, and remote error logging.

Related

Code pointers

  • workers/api/src/lib/connectors/mcp.ts
  • workers/api/src/lib/events.ts
  • workers/api/src/lib/redact.ts
  • workers/api/src/routes/admin-mcp-audit.ts
  • store/console/src/tabs/SettingsTab.tsx

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions