Skip to content

Feature Request: Runtime Verification for MCP Pipelines in Haystack #12024

Description

@Correctover

Background

I have analyzed security patterns across 53+ MCP server implementations and found recurring vulnerabilities: command injection, missing auth, path traversal, SSRF, and credential leakage. Many MCP servers expose tools without input/output validation.

Haystack has integrated MCP via Hayhooks (deepset-ai/hayhooks) which runs as an MCP Server exposing pipelines as tools. The typed Pipeline architecture is excellent for data flow validation, but MCP tool execution lacks a runtime verification layer.

Problem Statement

When Haystack pipelines are exposed as MCP tools via Hayhooks:

  • Tool inputs from external MCP clients are not verified against pipeline parameter constraints before execution
  • Pipeline outputs sent back to MCP clients are not validated
  • There is no middleware to enforce security policies on MCP pipeline invocations

This creates risk for enterprise deployments where Haystack pipelines are publicly accessible via MCP.

Proposed Solution

A runtime verification middleware for MCP pipeline execution:

  1. Define verification rules per pipeline (input validation, output sanitization, execution constraints)
  2. Hook into Hayhooks MCP server to intercept tool calls before/after pipeline execution
  3. Log violations and optionally reject non-compliant invocations

Integration points:

  • A Hayhooks middleware wrapping pipeline execution
  • A custom Haystack Component for MCP security validation
  • Integration with Haystack's existing Pipeline.connect() validation at runtime

Implementation Effort

Minimal — adapter layer connecting verification rules to Haystack's pipeline abstraction.

I have published runtime verification on npm (correctover) and would contribute a PR.

Questions

  1. Is runtime security for MCP-exposed pipelines on the roadmap?
  2. What is the preferred extension point in Hayhooks for this?

Thank you for the excellent framework.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priority, leave it in the backlog

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions