LiveKit Agents
LiveKit Agents load a remote MCP server's tools in your agent code with MCPServerHTTP. A URL that ends in /mcp is treated as Streamable HTTP.
- Create an API key in the dashboard and keep it in an environment variable, for example BROWSEMCP_API_KEY.
- Add the MCP server to your AgentSession or Agent as below.
- Put the agent instructions from Get started in the Agent's instructions.
import os
from livekit.agents import AgentSession, mcp
session = AgentSession(
tools=[
mcp.MCPToolset(
id="browsemcp",
mcp_server=mcp.MCPServerHTTP(
"https://browsemcp-api.haris-299.workers.dev/mcp",
transport_type="streamable_http",
headers={"Authorization": f"Bearer {os.environ['BROWSEMCP_API_KEY']}"},
client_session_timeout_seconds=30,
),
)
],
)Good to know
- Keep client_session_timeout_seconds at 30 as shown. With LiveKit's default of 5 seconds, get_session_status and wait_for_change were cut off with “Request 'tools/call' timed out” whenever they waited longer than that for the caller.
- allowed_tools on the server narrows what the model may call.
- In Node the same server is llm.MCPServerHTTP({ url }) inside llm.MCPToolset; it requires an https address.
Checked against LiveKit Agents's documentation on 20 November 2026. Platforms change their settings; if a field has moved, their page is the authority. Run on 20 November 2026 with livekit-agents 1.8.13 against a Sightline server: the code below listed the tools and called start_session, get_session_status (waiting 25 seconds) and end_session. It was not run inside a live voice call.
Using something else? See all platforms.
Next: add the agent instructions and try a call against your own site.