| id | connecting |
|---|---|
| title | Connecting |
The TanStack MCP Server is available at https://tanstack.com/api/mcp and uses the Streamable HTTP transport.
There are two ways to authenticate with the TanStack MCP server:
MCP clients that support OAuth can authenticate automatically. Just use the server URL and your client will open a browser window to authorize access:
https://tanstack.com/api/mcp
No API key needed. Your client handles the OAuth flow automatically.
For clients that don't support OAuth, or if you prefer manual key management:
- Sign in to your TanStack account
- Go to Integrations
- Click "New Key" and give it a descriptive name
- Copy the key immediately (you won't see it again)
Note
Replace YOUR_API_KEY in the examples below with your actual API key.
Claude Desktop supports OAuth authentication. Add to your config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"tanstack": {
"url": "https://tanstack.com/api/mcp"
}
}
}Restart Claude Desktop. On first use, a browser window will open to authorize access.
Using an API key instead
{
"mcpServers": {
"tanstack": {
"command": "npx",
"args": ["mcp-remote", "https://tanstack.com/api/mcp"],
"env": {
"MCP_HEADERS": "Authorization: Bearer YOUR_API_KEY"
}
}
}
}claude mcp add --transport http tanstack https://tanstack.com/api/mcpOn first use, a browser window will open to authorize access.
Using an API key instead
claude mcp add --transport http tanstack https://tanstack.com/api/mcp --header "Authorization: Bearer YOUR_API_KEY"Add to your Cursor MCP configuration:
{
"mcpServers": {
"tanstack": {
"url": "https://tanstack.com/api/mcp"
}
}
}Using an API key instead
{
"mcpServers": {
"tanstack": {
"command": "npx",
"args": ["mcp-remote", "https://tanstack.com/api/mcp"],
"env": {
"MCP_HEADERS": "Authorization: Bearer YOUR_API_KEY"
}
}
}
}Add to your VS Code settings or .vscode/mcp.json:
{
"servers": {
"tanstack": {
"url": "https://tanstack.com/api/mcp"
}
}
}Using an API key instead
{
"servers": {
"tanstack": {
"type": "http",
"url": "https://tanstack.com/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Add to your OpenCode MCP configuration in ~/.config/opencode/config.json:
{
"mcp": {
"servers": {
"tanstack": {
"type": "remote",
"url": "https://tanstack.com/api/mcp"
}
}
}
}After adding the config, run the auth flow manually the first time:
npx mcp-remote https://tanstack.com/api/mcp authThis opens a browser to authorize access. After that, OpenCode will connect automatically.
Using an API key instead
{
"mcp": {
"servers": {
"tanstack": {
"type": "remote",
"url": "https://tanstack.com/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
}Add to your Windsurf MCP configuration:
{
"mcpServers": {
"tanstack": {
"serverUrl": "https://tanstack.com/api/mcp"
}
}
}Using an API key instead
{
"mcpServers": {
"tanstack": {
"serverUrl": "https://tanstack.com/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Use the MCP Inspector to test the server interactively:
npx @modelcontextprotocol/inspector https://tanstack.com/api/mcpUsing an API key instead
npx @modelcontextprotocol/inspector https://tanstack.com/api/mcp --header "Authorization: Bearer YOUR_API_KEY"For custom integrations, the server accepts standard MCP requests via HTTP:
- Endpoint:
https://tanstack.com/api/mcp - Transport: Streamable HTTP (stateless)
- Methods: POST (for requests), GET (for server-sent events), DELETE (for session cleanup)
- Authentication: OAuth 2.1 (recommended) or Bearer token via Authorization header
The server supports OAuth 2.1 with PKCE for secure authentication:
- Discover endpoints via
/.well-known/oauth-authorization-server - Redirect user to
/oauth/authorizewith PKCE challenge - Exchange authorization code at
/oauth/token - Use the access token as a Bearer token
Example request using curl with an API key:
curl -X POST https://tanstack.com/api/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'API requests are rate-limited to protect the service:
- Authenticated requests: 60 requests per minute
- Rate limit headers are included in responses (
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset)
After connecting, ask your AI assistant to list TanStack libraries:
"Use the TanStack MCP to list all available libraries"
You should see a list of all TanStack libraries with their versions and descriptions.