can open ai realtime agents use MCP servers?
# ask-ai
l
can open ai realtime agents use MCP servers?
t
Thanks for reaching out, AG. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Yes, OpenAI real-time agents can use MCP (Model Context Protocol) servers with LiveKit. LiveKit Agents has native support for MCP, which integrates seamlessly with both OpenAI’s standard LLM models and the OpenAI Realtime API. • You can add MCP servers directly to your agent session or agent constructor using
MCPServerHTTP
or
MCPServerStdio
for various connection types. • Here’s a basic example using an agent session with MCP and OpenAI Realtime:`session = AgentSession( # other arguments like vad, stt, tts ... mcp_servers=[ mcp.MCPServerHTTP("https://your-mcp-server.com"), ], )` • Tools exposed by your MCP server are automatically available to the agent as callable tools during conversation. While formal documentation for MCP integration is still being developed, the feature is implemented and working examples are available in the sources. Sources: livekit-agents/livekit/agents/llm/mcp.py | Tool definition and use | LiveKit Docs | Using MCP with LiveKit Agents