{"id":18395852,"url":"https://github.com/deepset-ai/hayhooks","last_synced_at":"2026-08-27T23:38:54.357Z","repository":{"id":214173824,"uuid":"734975513","full_name":"deepset-ai/hayhooks","owner":"deepset-ai","description":"Easily deploy Haystack pipelines as REST APIs and MCP Tools.","archived":false,"fork":false,"pushed_at":"2026-08-26T15:36:11.000Z","size":25102,"stargazers_count":150,"open_issues_count":13,"forks_count":39,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-08-26T15:53:16.884Z","etag":null,"topics":["ai","api","api-rest","haystack","llm","mcp","mcp-server","mcp-tools","rest"],"latest_commit_sha":null,"homepage":"https://deepset-ai.github.io/hayhooks/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepset-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING_DOCS.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null}},"created_at":"2023-12-23T08:03:58.000Z","updated_at":"2026-08-22T13:40:34.000Z","dependencies_parsed_at":"2026-08-26T15:52:06.792Z","dependency_job_id":null,"html_url":"https://github.com/deepset-ai/hayhooks","commit_stats":null,"previous_names":["masci/hayhooks","deepset-ai/hayhooks"],"tags_count":63,"template":false,"template_full_name":null,"purl":"pkg:github/deepset-ai/hayhooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fhayhooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fhayhooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fhayhooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fhayhooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepset-ai","download_url":"https://codeload.github.com/deepset-ai/hayhooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fhayhooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36947769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-22T15:14:58.755Z","status":"online","status_checked_at":"2026-08-27T02:00:07.166Z","response_time":96,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","api","api-rest","haystack","llm","mcp","mcp-server","mcp-tools","rest"],"created_at":"2024-11-06T02:12:10.080Z","updated_at":"2026-08-27T23:38:54.346Z","avatar_url":"https://github.com/deepset-ai.png","language":"Python","funding_links":[],"categories":["📚 Projects (2474 total)"],"sub_categories":["MCP Servers"],"readme":"# Hayhooks\n\n**Hayhooks** makes it easy to deploy and serve [Haystack](https://haystack.deepset.ai/) [Pipelines](https://docs.haystack.deepset.ai/docs/pipelines) and [Agents](https://docs.haystack.deepset.ai/docs/agents).\n\nWith Hayhooks, you can:\n\n- 📦 **Deploy your Haystack pipelines and agents as REST APIs** with maximum flexibility and minimal boilerplate code.\n- 🛠️ **Expose your Haystack pipelines and agents over the MCP protocol**, making them available as tools in AI dev environments like [Cursor](https://cursor.com) or [Claude Desktop](https://claude.ai/download). Under the hood, Hayhooks runs as an [MCP Server](https://modelcontextprotocol.io/docs/concepts/architecture), exposing each pipeline and agent as an [MCP Tool](https://modelcontextprotocol.io/docs/concepts/tools).\n- 🤝 **Expose your Haystack pipelines and agents over the [A2A protocol](https://a2a-protocol.org)** (`pip install \"hayhooks[a2a]\"`), so other agents can discover them through auto-generated agent cards and delegate tasks to them via `hayhooks a2a run`.\n- 💬 **Integrate your Haystack pipelines and agents with [Open WebUI](https://openwebui.com)** as OpenAI-compatible chat completion backends with streaming support.\n- 🖥️ **Embed a [Chainlit](https://chainlit.io/) chat UI** directly in Hayhooks with `pip install \"hayhooks[chainlit]\"` and `hayhooks run --with-chainlit` -- zero-configuration frontend with streaming, pipeline selection, and custom UI widgets.\n- 🕹️ **Control Hayhooks core API endpoints through chat** - deploy, undeploy, list, or run Haystack pipelines and agents by chatting with [Claude Desktop](https://claude.ai/download), [Cursor](https://cursor.com), or any other MCP client.\n- 📈 **Trace Hayhooks lifecycle actions with OpenTelemetry** (`pip install \"hayhooks[tracing]\"`) for deploy/run/undeploy visibility across REST and MCP, with a `/dashboard` UI via `hayhooks run --with-tracing-dashboard` (backed by a local live trace buffer).\n\n[![PyPI - Version](https://img.shields.io/pypi/v/hayhooks.svg)](https://pypi.org/project/hayhooks)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hayhooks.svg)](https://pypi.org/project/hayhooks)\n[![Docker image release](https://github.com/deepset-ai/hayhooks/actions/workflows/docker.yml/badge.svg)](https://github.com/deepset-ai/hayhooks/actions/workflows/docker.yml)\n[![Tests](https://github.com/deepset-ai/hayhooks/actions/workflows/tests.yml/badge.svg)](https://github.com/deepset-ai/hayhooks/actions/workflows/tests.yml)\n\n## Documentation\n\n\u003e 📚 **For detailed guides, examples, and API reference, check out our [comprehensive documentation](https://deepset-ai.github.io/hayhooks/).**\n\n## Quick Start\n\n### 1. Install Hayhooks\n\n```bash\n# Install Hayhooks\npip install hayhooks\n```\n\n### 2. Start Hayhooks\n\n```bash\nhayhooks run\n```\n\n### 3. Create a simple agent\n\nCreate a minimal agent wrapper with streaming chat support and a simple HTTP POST API:\n\n```python\nfrom typing import AsyncGenerator\nfrom haystack.components.agents import Agent\nfrom haystack.dataclasses import ChatMessage\nfrom haystack.tools import Tool\nfrom haystack.components.generators.chat import OpenAIChatGenerator\nfrom hayhooks import BasePipelineWrapper, async_streaming_generator\n\n\n# Define a Haystack Tool that provides weather information for a given location.\ndef weather_function(location):\n    return f\"The weather in {location} is sunny.\"\n\nweather_tool = Tool(\n    name=\"weather_tool\",\n    description=\"Provides weather information for a given location.\",\n    parameters={\n        \"type\": \"object\",\n        \"properties\": {\"location\": {\"type\": \"string\"}},\n        \"required\": [\"location\"],\n    },\n    function=weather_function,\n)\n\nclass PipelineWrapper(BasePipelineWrapper):\n    def setup(self) -\u003e None:\n        self.agent = Agent(\n            chat_generator=OpenAIChatGenerator(model=\"gpt-4o-mini\"),\n            system_prompt=\"You're a helpful agent\",\n            tools=[weather_tool],\n        )\n\n    # This will create a POST /my_agent/run endpoint\n    # `question` will be the input argument and will be auto-validated by a Pydantic model\n    async def run_api_async(self, question: str) -\u003e str:\n        result = await self.agent.run_async(messages=[ChatMessage.from_user(question)])\n        return result[\"last_message\"].text\n\n    # This will create an OpenAI-compatible /chat/completions endpoint\n    async def run_chat_completion_async(\n        self, model: str, messages: list[dict], body: dict\n    ) -\u003e AsyncGenerator[str, None]:\n        chat_messages = [\n            ChatMessage.from_openai_dict_format(message) for message in messages\n        ]\n\n        return async_streaming_generator(\n            pipeline=self.agent,\n            pipeline_run_args={\n                \"messages\": chat_messages,\n            },\n        )\n```\n\nSave as `my_agent_dir/pipeline_wrapper.py`.\n\n### 4. Deploy it\n\n```bash\nhayhooks pipeline deploy-files -n my_agent ./my_agent_dir\n```\n\n### 5. Run it\n\nCall the HTTP POST API (`/my_agent/run`):\n\n```bash\ncurl -X POST http://localhost:1416/my_agent/run \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"question\": \"What can you do?\"}'\n```\n\nCall the OpenAI-compatible chat completion API (streaming enabled):\n\n```bash\ncurl -X POST http://localhost:1416/chat/completions \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"model\": \"my_agent\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"What can you do?\"}]\n  }'\n```\n\nOr chat with it in the [embedded Chainlit UI](docs/features/chainlit-integration.md) (`hayhooks run --with-chainlit`) or [integrate it with Open WebUI](docs/features/openwebui-integration.md)!\n\n## Key Features\n\n### 🚀 Easy Deployment\n\n- Deploy Haystack pipelines and agents as REST APIs with minimal setup\n- Support for both YAML-based and wrapper-based pipeline deployment\n- Automatic OpenAI-compatible endpoint generation\n\n### 🌐 Multiple Integration Options\n\n- **MCP Protocol**: Expose pipelines as MCP tools for use in AI development environments\n- **A2A Protocol**: Expose pipelines as A2A agents that other agents can discover and delegate tasks to\n- **Chainlit UI**: Embedded chat frontend with streaming, pipeline selection, and custom UI widgets\n- **Open WebUI Integration**: Use Hayhooks as a backend for Open WebUI with streaming support\n- **OpenAI Compatibility**: Seamless integration with OpenAI-compatible tools and frameworks\n\n### 🔧 Developer Friendly\n\n- CLI for easy pipeline management\n- Flexible configuration options\n- Comprehensive logging and debugging support\n- OpenTelemetry-ready tracing hooks built on Haystack tracing APIs\n- Custom route and middleware support\n\n### 📁 File Upload Support\n\n- Built-in support for handling file uploads in pipelines\n- Perfect for RAG systems and document processing\n\n## Next Steps\n\n- [Quick Start Guide](docs/getting-started/quick-start.md) - Get started with Hayhooks\n- [Installation](docs/getting-started/installation.md) - Install Hayhooks and dependencies\n- [Configuration](docs/getting-started/configuration.md) - Configure Hayhooks for your needs\n- [Tracing Dashboard Frontend](dashboard/README.md) - Local dashboard setup and frontend development commands\n- [Examples](docs/examples/overview.md) - Explore example implementations\n\n## Community \u0026 Support\n\n- **GitHub**: [deepset-ai/hayhooks](https://github.com/deepset-ai/hayhooks)\n- **Issues**: [GitHub Issues](https://github.com/deepset-ai/hayhooks/issues)\n- **Documentation**: [Full Documentation](https://deepset-ai.github.io/hayhooks/)\n\nHayhooks is actively maintained by the [deepset](https://deepset.ai/) team.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepset-ai%2Fhayhooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepset-ai%2Fhayhooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepset-ai%2Fhayhooks/lists"}