MCP Haystack Demo

by oryx1729

133 downloads
Not rated
GitHub

About

Demo for using MCP Servers in a Haystack Pipeline

Details

Author
oryx1729
Downloads
133
Categories
Media

- Connect to remote MCP servers using SSE (Server-Sent Events)
- Dynamically discover and load available tools from the MCP server
- Seamless integration with Haystack pipelines

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Haystack Demo
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install dependencies with uv, then start a Google Maps MCP server using Docker and connect via the MCPServer class. See the provided demo notebook for a complete example. Use ToolInvoker or ChatGenerator with the loaded toolset.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp haystack demo": {
            "mcp-haystack-google-maps": {
                "command": "docker",
                "args": [
                    "run",
                    "-it",
                    "--rm",
                    "-p",
                    "8000:8000",
                    "-e",
                    "GOOGLE_MAPS_API_KEY=$GOOGLE_MAPS_API_KEY",
                    "supercorp/supergateway",
                    "\\"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-haystack-google-maps": {
        "command": "docker",
        "args": [
            "run",
            "-it",
            "--rm",
            "-p",
            "8000:8000",
            "-e",
            "GOOGLE_MAPS_API_KEY=$GOOGLE_MAPS_API_KEY",
            "supercorp/supergateway",
            "\\"
        ]
    }
}

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

```python
from haystack.tools import MCPServer, SSEServerInfo
from haystack.components.tools import ToolInvoker

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.