Open History to see the last commit
1---
2id: mcp-connecting
3title: Connecting AI Clients
4---
5
6The TanStack CLI MCP server runs locally via stdio (default) or HTTP/SSE.
7
8## Claude Desktop
9
10Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
11
12```json
13{
14 "mcpServers": {
15 "tanstack": {
16 "command": "npx",
17 "args": ["@tanstack/cli", "mcp"]
18 }
19 }
20}
21```
22
23**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
24
25Restart Claude Desktop after editing.
26
27## Claude Code
28
29```bash
30claude mcp add tanstack -- npx @tanstack/cli mcp
31```
32
33## Cursor
34
35Add to your Cursor MCP config:
36
37```json
38{
39 "mcpServers": {
40 "tanstack": {
41 "command": "npx",
42 "args": ["@tanstack/cli", "mcp"]
43 }
44 }
45}
46```
47
48## VS Code (Copilot)
49
50Add to `.vscode/mcp.json` or VS Code settings:
51
52```json
53{
54 "servers": {
55 "tanstack": {
56 "command": "npx",
57 "args": ["@tanstack/cli", "mcp"]
58 }
59 }
60}
61```
62
63## Other MCP Clients
64
65For any MCP client supporting stdio transport:
66
67- **Command:** `npx`
68- **Args:** `["@tanstack/cli", "mcp"]`
69
70Or with global install:
71
72- **Command:** `tanstack`
73- **Args:** `["mcp"]`
74
75## HTTP/SSE Mode
76
77For clients preferring HTTP:
78
79```bash
80tanstack mcp --sse
81```
82
83Connect to `http://localhost:8080/sse`.
84
85## MCP Inspector
86
87Test the server interactively:
88
89```bash
90npx @modelcontextprotocol/inspector -- npx @tanstack/cli mcp
91```
92
93## Verifying Connection
94
95After connecting, ask your AI assistant:
96
97> "List all available TanStack libraries"
98
99You should see output from `tanstack_list_libraries` showing Query, Router, Table, and other libraries.