Skip to content

Add pre-execution trust verification hook for MCP tool calls #2501

@vdineshk

Description

@vdineshk

Problem

When DocsGPT connects to an MCP server to execute a tool call, there is currently no framework-level hook to verify the server's trustworthiness before execution. This means a misconfigured or malicious MCP server could execute arbitrary operations without any pre-flight safety check.

As MCP adoption grows and users connect to third-party servers, this becomes an increasingly important security surface.

Proposal

Add a configurable middleware/hook point that runs before any MCP tool execution:

# Example: pluggable trust verification
class TrustVerifier(Protocol):
    async def verify(self, server_uri: str) -> TrustResult: ...

# Users bring their own verification backend
app = DocsGPT(
    trust_verifier=MyCustomVerifier()  # Pluggable
)

The hook would:

  1. Receive the MCP server URI before the tool call executes
  2. Return a pass/fail/warn result
  3. Allow the framework to block, warn, or proceed based on the result

Benefits

  • Framework-agnostic: users choose their own verification backend (local policy, external API, allowlist, etc.)
  • Opt-in: doesn't break existing workflows — only activates when configured
  • Extensible: works with any trust scoring service, SBOM validator, or local policy engine
  • Security-first: addresses the growing concern around MCP server supply chain risks

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions