Model Context Protocol
Learn what the Model Context Protocol (MCP) is, how it can improve your workflows, and how to use it in Haystack Enterprise Platform.
What Is the Model Context Protocol?
The Model Context Protocol (MCP) is a way to let AI systems, like large language models (LLMs), connect to the outside world. With MCP, AI can access the newest information, trigger actions, or interact with other systems. Instead of building a custom connection for every app, database, or API, MCP provides a universal way to do this.
MCP acts like a universal adapter. It defines a common protocol, or a standard, for how AI applications communicate with external tools and data sources. Just as USB-C standardizes how devices connect, MCP standardizes how AI connects to external capabilities. For Haystack Enterprise Platform, this means you can connect pipelines to a wide range of tools and services with the same interface.
MCP defines how an AI assistant requests data from tools and how those tools respond. When a tool supports MCP, you can use it across any compatible client, such as Cursor, Claude Desktop, or your own custom agent.
Key Concepts
MCP uses a client-server architecture with three key components:
- MCP Host: The AI assistant the user interacts with, like Claude Desktop or VS Code. The host manages the overall workflow and launches one MCP client for each server it connects to.
- MCP Client: The component that manages communication between the host and the server. It is usually part of the host application.
- MCP Server: A program that offers capabilities, like tools, resources, or prompts, to the client or host. It can run locally or remotely. In Haystack Enterprise Platform, it is a workspace for which you create an MCP server with pipelines as tools.
The host coordinates the entire process. It creates one MCP client to communicate with each MCP server.
The Workflow
Here's how a typical interaction works. Let's use the example of Claude Code as the host and a Haystack Platform workspace as the MCP server:
- The user asks Claude Code a question that requires an external tool, in this case a pipeline.
- Claude Code forwards the query to its MCP client, which is its internal component.
- The client starts a session with the workspace MCP server.
- They exchange information about available tools and capabilities.
- The client sends a tool call, the server returns the result, and the client passes the response back to Claude Code.
- Claude Code then formats it into natural language for the user.
Benefits of MCP
- Vendor-agnostic integration: MCP handles the communication protocol, so you can focus on building rather than writing custom integration code.
- Flexible tool access: Access a growing ecosystem of MCP-compatible tools, including database connections, web search capabilities, file system operations, API integrations, and custom business tools.
- Enhanced AI capabilities: Give your AI models access to real-time data and tools, enabling them to answer questions with current information, perform actions on external systems, access specialized data sources, and execute complex workflows.
- Future-proof architecture: As more tools adopt MCP, your pipelines automatically gain access to new capabilities without code changes.
MCP in Haystack Enterprise Platform
Haystack Enterprise Platform supports MCP in two main ways: by providing agents that can use external MCP servers and by providing a way to use Haystack Platform pipelines as MCP tools.
Using External MCP Servers
You can connect your Agent components to external MCP servers to access third-party tools and data sources. This is useful when you need to integrate with services that provide MCP-compatible APIs.
Using Pipelines as MCP Tools
You can use your deployed pipelines as MCP tools, making them available to AI coding assistants like Cursor, VS Code, or Claude Code. In Haystack Enterprise Platform, this works at the workspace level: you create one MCP server for your workspace, then individually enable each pipeline as its tool. A pipeline is not available as a tool until you explicitly turn it on in the pipeline's settings.
When an AI client connects to your workspace's MCP endpoint, it discovers all the pipelines you enabled and can call them as tools. Each tool can have its own name, description, and instructions to help the AI assistant understand when and how to use it.
This means you can mix and match pipelines within a single MCP server — for example, a RAG pipeline for knowledge retrieval, a data processing pipeline for transformation tasks, and a summarization pipeline for document analysis — all accessible through one endpoint.
Example Use Cases
- Documentation assistant: Enable a RAG pipeline that searches your internal documentation
- Code review helper: Use a pipeline that analyzes code patterns and suggests improvements
- Data processing tool: Make data transformation pipelines available for development workflows
- Knowledge search: Provide access to company knowledge bases through search pipelines
For instructions on setting this up, see Use Your Pipelines as MCP Tools.
Related Information
Was this page helpful?