Use Your Pipelines as MCP Tools
Create a workspace MCP server and expose your deployed pipelines as tools that AI assistants, like Claude Code or Cursor, can call directly.
About This Task
MCP (Model Context Protocol) standardizes how AI applications communicate with external tools and services. In Haystack Enterprise Platform, you set up one MCP server for your workspace and choose which deployed pipelines to expose as tools. A new MCP server has no tools by default. You enable each pipeline individually in its settings. Once enabled, your AI assistant can call any of those pipelines and use the results.
For example, you can add a RAG pipeline as a tool to let your AI assistant query your internal knowledge base, or add a data processing pipeline to transform content in your development workflow.
You can brand your server with a name, description, icon, and instructions to control how your AI assistant sees and uses it.
To learn more about MCP, see Model Context Protocol.
Prerequisites
- One or more deployed pipelines in your workspace.
- The
pipelines:writepermission for the workspace. - A basic understanding of the Model Context Protocol (MCP).
Create an MCP Server
To use your pipelines as MCP tools, perform these steps:
- Create an MCP server for your workspace.
- Enable individual pipelines as tools.
1. Create a Workspace MCP Server
You create one MCP server per workspace. Creating the server does not automatically expose any pipelines — you enable each pipeline as a tool separately in the pipeline's own settings.
- In Haystack Enterprise Platform, click your profile icon and go to Settings > Workspace > MCP.
- Click Create MCP Server.
- Type a name for the MCP server.
- Optionally, provide the following information:
- The server version. This is the version of the MCP protocol. Your AI assistant sends the version number in the initial call to the server. You can leave this field blank to use the latest version.
- Website URL. This is the URL of the company that built the MCP server. You can provide your company's URL here or leave it blank.
- Icon URL. This is the URL of the custom icon for the MCP server. Use SVG or PNG format. Note that currently not all AI assistants can display custom icons.
- Instructions. Provide guidance to the AI assistant on how to use your pipeline tools effectively. The text you enter as instructions is injected into the AI assistant's prompt at the start of every session, so it applies globally to all pipeline tools. Give instructions beyond what the pipeline tool description provides, such as the order for calling pipelines, dependencies between them, or known limitations.
The workspace MCP server is now ready. You can see pipelines available as MCP tools for this workspace. Next, enable individual pipelines as tools.
2. Enable Pipelines as Tools
A pipeline must be deployed to be used as an MCP tool.
Pipelines are not added to the MCP server automatically. You enable each one explicitly in its settings. You can do it in two ways, either from the Workspace Settings page or from the Pipeline Details page.
From the Workspace Settings page
Create a workspace MCP server first. Follow the steps in Create a Workspace MCP Server. Once the MCP server is created for the workspace:
- On the Workspace Settings > MCP page, scroll down to MCP Tools. You can view all pipelines you can enable as MCP tools here.
- Click a pipeline you want to enable as a tool. You're redirected to the Pipeline Details page.
- In the MCP Tool section, turn on Use as MCP tool.
- Choose the pipeline version to use the tool. If you leave it empty, it uses the deployed version.
- Optionally, provide a custom tool name or leave the pipeline name as is. Names help the AI assistant choose the right tools. Make sure the name is unique and descriptive.
- Optionally, provide a custom tool description or leave it empty to autogenerate one. Descriptions tell the AI assistant when and how to use the tool.
- If you have an API key for the workspace, paste it into the field. If you don't have one, click Create to generate it. The key is automatically named after the pipeline with the MCP prefix, for example, MCP — my-pipeline. You can find it later in your workspace settings under API Keys.
Return to the Workspace Settings page and repeat these steps for each pipeline you want to expose. All enabled pipelines share the same workspace MCP endpoint and API key.
From the Pipeline Details page
You can enable a deployed pipeline as an MCP tool without creating a workspace MCP server. When you expose a pipeline as a tool, the workspace MCP server is created automatically behind the scenes.
- Go to Pipelines and click the pipeline you want to enable as a tool.
- On the Pipeline Details page, click Settings.
- In the MCP Tool section, turn on Use as MCP tool.
- Choose the pipeline version to use the tool. If you leave it empty, it uses the deployed version.
- Optionally, provide a custom tool name or leave the pipeline name as is. Names help the AI assistant choose the right tools. Make sure the name is unique and descriptive.
- Optionally, provide a custom tool description or leave it empty to autogenerate one. Descriptions tell the AI assistant when and how to use the tool.
- If you have an API key for the workspace, paste it into the field. If you don't have one, click Create to generate it. The key is automatically named after the pipeline with the MCP prefix, for example, MCP — my-pipeline. You can find it later in your workspace settings under API Keys.
Connect Your AI Client
You can find ready-to-use configuration snippets in the MCP server settings.
- Go to Settings > Workspace > MCP and open your MCP server.
- Find the Client Config section.
- Choose your client format:
- Cursor / VS Code: JSON configuration for
mcpServers - Claude Code: CLI command for adding the server
- Raw URL: Direct MCP endpoint URL
- Cursor / VS Code: JSON configuration for
- Click Copy to copy the configuration.
- Paste it into your AI client according to its setup instructions.
When the AI client connects, it receives the list of all tools (pipelines) available on the server and can call them as needed.
Example Configurations
Cursor / VS Code (JSON)
{
"mcpServers": {
"haystack-enterprise": {
"url": "https://api.cloud.deepset.ai/api/v2/workspaces/<your-workspace-id>/mcp",
"headers": {
"Authorization": "Bearer your-api-key"
}
}
}
}
Claude Code (CLI)
claude mcp add-json haystack-enterprise '{
"type": "http",
"url": "https://api.cloud.deepset.ai/api/v2/workspaces/your-workspace-id/mcp",
"headers": {
"Authorization": "Bearer your-api-key"
}
}'
Disable a Pipeline Tool or Delete the MCP Server
Disable a Pipeline Tool
To stop use a specific pipeline as a tool without affecting the rest of the server:
- Go to Pipelines and click the pipeline you want to remove.
- On the Pipeline Details page, click Settings.
- In the MCP Tool section, turn off Use as MCP tool.
The pipeline is immediately removed from the server. Other enabled pipelines continue to work.
Delete the MCP Server
To stop using your workspace as an MCP server entirely:
- Go to Settings > Workspace > MCP.
- Switch off Create MCP Server.
The server and all its tools are immediately removed and can no longer be used by external clients.
Troubleshooting
-
The MCP section is grayed out: You need the
pipelines:writepermission for the workspace. Contact your workspace administrator to assign the appropriate role. -
AI client can't connect: Verify your API key is correct and has the necessary permissions. Try copying the configuration snippet again from the server settings.
-
Changes aren't saving: Settings are saved automatically with a short delay. Wait a few seconds after making changes before navigating away.
Related Information
Was this page helpful?