SightlineDocs
Sign in

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.

  1. Create an API key in the dashboard and keep it in an environment variable, for example BROWSEMCP_API_KEY.
  2. Add the MCP server to your AgentSession or Agent as below.
  3. Put the agent instructions from Get started in the Agent's instructions.
Python
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

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.