Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .changeset/mcp-tools-port.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
'@livekit/agents': patch
---

feat(mcp): add MCP (Model Context Protocol) server integration

Ports MCP tool support from `livekit-agents` (Python). Tools exposed by an
MCP server are fetched on activity start and merged into the agent's tool
context. Both stdio and HTTP transports (SSE + streamable HTTP) are supported.

```ts
const session = new voice.AgentSession({
mcpServers: [new llm.MCPServerHTTP({ url: 'http://localhost:8000/sse' })],
// ...
});
```

`@modelcontextprotocol/sdk` is an optional peer dependency: install it with
`pnpm add @modelcontextprotocol/sdk` to use this feature.
6 changes: 6 additions & 0 deletions agents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@
},
"peerDependencies": {
"@livekit/rtc-node": "catalog:",
"@modelcontextprotocol/sdk": "^1.25.0",
"zod": "^3.25.76 || ^4.1.8"
},
"peerDependenciesMeta": {
"@modelcontextprotocol/sdk": {
"optional": true
}
}
}
14 changes: 14 additions & 0 deletions agents/src/llm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,17 @@ export {
type AvailabilityChangedEvent,
type FallbackAdapterOptions,
} from './fallback_adapter.js';

export {
MCPServer,
MCPServerHTTP,
MCPServerStdio,
type MCPHTTPTransportType,
type MCPServerHTTPOptions,
type MCPServerOptions,
type MCPServerStdioOptions,
type MCPToolCallResult,
type MCPToolContent,
type MCPToolResultContext,
type MCPToolResultResolver,
} from './mcp.js';
Loading
Loading