About MCP Haystack Demo
MCP Haystack Demo is a Haystack integration for pipelines that need tools from remote MCP servers. It connects over SSE and discovers available tools dynamically, with a Google Maps example.
Key features
- 01SSE connections to remote MCP servers
- 02Dynamic tool discovery and loading
- 03Haystack pipeline integration
- 04Google Maps example
Use cases
- 01Adding remote MCP tools to a Haystack pipeline
- 02Trying Google Maps MCP tools in a demo
MCP support
It connects to remote MCP servers over SSE and loads their tools for use as a Haystack Toolset.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
docker run -i --rm -e GOOGLE_MAPS_API_KEY supercorp/supergatewayGOOGLE_MAPS_API_KEYSecretLocal servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Haystack Demo
A Haystack integration connecting to MCP servers with a focus on Google Maps API integration.
Overview
This project implements MCPServer, a Haystack Toolset that connects to remote MCP servers and dynamically loads available tools. The implementation is based on the recently added Toolset abstraction in Haystack (https://github.com/deepset-ai/haystack/pull/9161).
Features
- Connect to remote MCP servers using SSE (Server-Sent Events)
- Dynamically discover and load available tools
- Seamless integration with Haystack pipelines
Installation
Use uv to install the dependencies.
Quick Start
Check the demo notebook for a complete example connecting to a Google Maps MCP server.
Running the Google Maps MCP Server
docker run -it --rm -p 8000:8000 -e GOOGLE_MAPS_API_KEY=$GOOGLE_MAPS_API_KEY supercorp/supergateway \
--stdio "npx -y @modelcontextprotocol/server-google-maps" \
--port 8000
Connecting to the Server
from haystack.tools import MCPServer, SSEServerInfo
from haystack.components.tools import ToolInvoker
# Create server info
server_info = SSEServerInfo(
base_url="http://localhost:8000",
)
# Create the MCP server toolset
mcp_server = MCPServer(server_info=server_info)
# Use the toolset with a ToolInvoker or ChatGenerator component
invoker = ToolInvoker(tools=mcp_server)
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.