#Connect MCP Server to Copilotkit UI
1 messages · Page 1 of 1 (latest)
@lyric ice To connect your FastMCP server to CopilotKit UI:
In your React chat page, call
useCopilotChat().setMcpServers([{ endpoint: "YOUR_FASTMCP_URL" }])
Create/update your Next.js API route (e.g., app/api/copilotkit/route.ts) to use CopilotRuntime with a createMCPClient that connects to your FastMCP server.
Make sure your FastMCP client implements the MCPClient interface and includes a tools() method that returns your available tools.
Docs for MCP setup: https://docs.copilotkit.ai/direct-to-llm/guides/model-context-protocol?cli=do-it-manually
thanks for the help @mental bane