Connect any React application to an MCP server in three lines of code
Jun 18, 2025Dina Kozlov, Glen Maddern, Sunil Pai

Summary
This post introduces `use-mcp`, a React library for building remote MCP clients, and open-sources the AI Playground. `use-mcp` abstracts away transport protocols (Streamable HTTP, SSE), authentication (OAuth 2.1), session management, and dynamic tool discovery. It provides connection state management, retry logic with backoff, and a debug log array. The AI Playground, built with Workers AI and `use-mcp`, offers a chat interface for interacting with MCP servers and LLMs, with built-in debugging and monitoring of MCP connections and tool invocations.
More from the Artificial Intelligence Integration & Impact trail
- Introducing Clef-omni with full multimodality, plus a faster Clef and a cheaper Clef-flash
- Introducing Web Search API via AI Gateway
- Introducing Clef: our open-source decision models, and new RL fine-tuning platform
- One year later: Sovereign AI and the fight for choice
- AI Search is now generally available