LiveKit Agents loads remote MCP servers with MCPServerHTTP. A URL that ends in /mcp uses streamable HTTP. Pass the agent credential in headers.
import os
from livekit.agents import Agent, mcp
class GnesiVoice(Agent):
def __init__(self) -> None:
super().__init__(
instructions=(
"You can read and send this person's Gnesi conversations. "
"If a message body is empty, Shield is holding it. Say so and wait."
),
tools=[
mcp.MCPToolset(
id="gnesi",
mcp_server=mcp.MCPServerHTTP(
"https://api.gnesi.io/api/mcp",
headers={"Authorization": f"Bearer {os.environ['GNESI_CREDENTIAL']}"},
),
)
],
)Set GNESI_CREDENTIAL in the worker environment. The LiveKit Builder can store the same URL and header as an MCP server secret.
There is no push when mail arrives during a call. Ask the model to call gnesi_list_conversations with needs_you, or open the conversation stream from your own worker. The stream does not include the message body.