mcpField
M
MCP Haystack Demo

MCP Haystack Demo

Local
github.com/oryx1729Media & Design0Updated 79w ago

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

  1. 01SSE connections to remote MCP servers
  2. 02Dynamic tool discovery and loading
  3. 03Haystack pipeline integration
  4. 04Google Maps example

Use cases

  1. 01Adding remote MCP tools to a Haystack pipeline
  2. 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.

mcp.json · Universal config
{
"mcpServers": {
"haystack-google-maps": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GOOGLE_MAPS_API_KEY",
"supercorp/supergateway"
],
"env": {
"GOOGLE_MAPS_API_KEY": "<GOOGLE_MAPS_API_KEY>"
}
}
}
}
Run commanddocker run -i --rm -e GOOGLE_MAPS_API_KEY supercorp/supergateway
Environment variables to set
GOOGLE_MAPS_API_KEYSecret

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
ocisupercorp/supergateway

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP 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

Markdown supported

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.