Skip to content

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

@vdineshk

Description

@vdineshk

Problem

When a Langflow agent calls an MCP tool, there's no framework-level hook to verify the server's trustworthiness before execution. This creates a gap where malicious or misconfigured MCP servers can execute arbitrary operations without any trust validation.

Related: #9118 covers tool approval, but that's user-initiated. This proposal adds a programmable middleware layer for automated trust checks.

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
flow = Flow(
    trust_verifier=MyCustomVerifier()  # Pluggable
)

The hook should:

  1. Run before any MCP tool call is dispatched
  2. Receive the server URI, tool name, and parameters
  3. Return allow/deny/warn with optional metadata
  4. Be opt-in with zero overhead when not configured

Benefits

  • Framework-agnostic: Users choose their own verification backend (local policy, external API, OWASP-aligned checks)
  • Opt-in: Doesn't break existing workflows
  • Extensible: Works with any trust scoring service or local policy engine
  • Security: Addresses OWASP MCP Top 10 risks around unverified server trust

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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