Im getting the following error when i try to conne...
# ask-ai
h
Im getting the following error when i try to connect to my mcp server in my livekit agent. MCP servers configured with URL ERROR livekit.agents - failed to list tools from MCP server MCPServerHTTP(url=url, transport=sse) Our mcp uses the streamable http transport type
t
Thanks for reaching out, Ahmed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding about the “failed to list tools from MCP server” error when your agent connects to the MCP URL using streamable HTTP (SSE). To help diagnose and fix this, please check or provide the following: 1. Reachability • Can the agent host reach the URL? From the agent environment run:
Copy code
curl -I https://orch-api-dev.assembly-industries.com/v0/mcp-tools/stream
and share the HTTP status and any TLS errors. 1. SSE behavior • Does the endpoint return an SSE stream with header
Content-Type: text/event-stream
? Test with:
Copy code
curl -N -H "Accept: text/event-stream" https://orch-api-dev.assembly-industries.com/v0/mcp-tools/stream
If the stream does not start or you see an error, the MCP server’s SSE implementation may be the cause. 1. Authentication / headers • Does the MCP endpoint require auth or custom headers? LiveKit agents do not support custom headers for MCP requests. If your endpoint requires headers or auth, confirm how the agent is authenticating (if at all). 1. Server logs • Check the MCP server logs for incoming requests from the agent and any errors during response generation or SSE framing. 1. Response format • Ensure the server emits events and payloads that follow the MCP streamable HTTP format (events properly framed). If possible, paste a short sample of the first few SSE events returned. If you share the curl outputs (status, headers, first SSE events) and whether the endpoint requires auth, I’ll suggest the next precise steps to get your agent listing tools successfully. Sources: Tool definition and use | LiveKit docs
h
can you share documentation links or github repo examples where i can see how to setup my mcp server?
t
You’re asking for documentation and repo examples to set up an MCP server for use with LiveKit agents. Below are the most relevant resources: • LiveKit Docs MCP Server guide: https://docs.livekit.io/home/get-started/mcp-server/ • LiveKit docs MCP index (llms.txt): https://docs.livekit.io/llms.txt • Tool definition & MCP agent info: https://docs.livekit.io/agents/build/tools GitHub examples: • Python agent starter: https://github.com/livekit-examples/agent-starter-python • Node.js agent starter: https://github.com/livekit-examples/agent-starter-node • MCP agent example (Python): https://github.com/livekit-examples/python-agents-examples/tree/main/mcp If you’d like, tell me which example you’re using (Python or Node) and share your MCP endpoint behavior (curl output or first SSE events). I’ll point out the exact parts to match to the examples and troubleshoot the “failed to list tools” error. Sources: LiveKit Docs MCP Server | LiveKit docs | Tool definition and use | LiveKit docs