How to Connect MCP Servers to Claude Code & Cursor Step-by-Step
Connecting an MCP server to your favorite AI assistant takes less than two minutes. Here is the step-by-step setup guide for both Claude Code CLI and Cursor IDE.
- Updated 18 September 2026
- Step-by-Step Tutorial
- Claude Code & Cursor
Method 1
Overview: Stdio vs HTTP SSE MCP Connections
MCP servers connect via either local stdio (command line process spawned by the client) or remote HTTP + Server-Sent Events (SSE). HTTP SSE is preferred for team environments because it provides central authentication and shared state.
Method 2
Connecting MCP to Claude Code
Claude Code supports adding MCP servers via its built-in CLI commands or file configs.
Command Line Setup
claude mcp add --transport http contextsbase https://app.contextsbase.com/api/v1/mcp \
--header "Authorization: Bearer mcp_live_your_token_here"Verify the connection by launching Claude Code and executing claude mcp list.
Method 3
Connecting MCP to Cursor IDE
Cursor supports HTTP and Stdio MCP servers natively through its settings pane.
- Open Cursor Settings (Cmd + , on macOS, Ctrl + , on Windows/Linux).
- Navigate to Features -> MCP Servers.
- Click + Add New MCP Server.
- Set Transport Type to SSE or Stdio.
- Paste your configuration or HTTP endpoint.
{
"mcpServers": {
"contextsbase": {
"url": "https://app.contextsbase.com/api/v1/mcp",
"headers": {
"Authorization": "Bearer mcp_live_your_token_here"
}
}
}
}Method 4
Connecting ContextsBase over MCP
ContextsBase gives your agents persistent memory, feature specs, data models, and business rules over MCP. Create a free project in ContextsBase, generate an MCP token, and paste the command or JSON snippet above.
Method 5
Troubleshooting Common MCP Issues
- 401 Unauthorized: Check that your Authorization header includes 'Bearer ' followed by your token.
- Connection Refused: Ensure local stdio paths are valid absolute file paths.
- Tools Not Appearing: Restart the Claude Code CLI session or reload Cursor window after adding a new MCP server.
Where is the Cursor MCP configuration file located?
In Cursor, open Settings (Cmd+, or Ctrl+,) -> Features -> MCP, or edit ~/.cursor/mcp.json.
How do I list installed MCP servers in Claude Code?
Run `claude mcp list` in your terminal to see active tools, transport modes, and status.
Ready to connect ContextsBase?
Create a free project and get your MCP token instantly.
- Free for one project
- Bring your own agent