Skip to main content
This guide will help you set up a basic MCP connection using mcp-ts.

1. Install

2. Server-Side Setup (Next.js)

Create an API route at app/api/mcp/route.ts to handle MCP connections.

3. Client-Side Setup

Use the React useMcp hook in your component to connect and call tools.

4. Environment Variables

By default, mcp-ts uses in-memory storage. For persistence, add a backend like Redis:

Next Steps