Docs
CodeRabbit
Cloudflare
Railway
OpenRouter
AG Grid
Clerk
WorkOS
SerpAPI
Netlify
Electric
Unkey
Sentry
Prisma
CodeRabbit
Cloudflare
Railway
OpenRouter
AG Grid
Clerk
WorkOS
SerpAPI
Netlify
Electric
Unkey
Sentry
Prisma
Class References
Function References
Interface References
Type Alias References
Variable References

MCPConnectionPolicy

Type Alias: MCPConnectionPolicy

ts
type MCPConnectionPolicy = "close" | "keep-alive";
type MCPConnectionPolicy = "close" | "keep-alive";

Defined in: packages/ai/src/activities/chat/mcp/types.ts:27

Controls what happens to MCP connections when the chat run ends.

  • 'close' (default) — chat() closes each connection when the run ends (after the agent loop completes and the stream is drained), so tools can still execute throughout the run.
  • 'keep-alive'chat() never closes the connections; the caller owns their lifecycle (e.g. keep them warm across requests).