Integrating MCP with Cursor and VS Code
Why Connect MCP to Your Editor
AI-powered code editors like Cursor and VS Code can use MCP to access your APIs directly from your development environment. This means you can query databases, call APIs, and fetch data without leaving your editor.
Connecting Cursor
- Open Cursor Settings
- Navigate to Features → MCP
- Click Add new MCP server
- Enter your FuzeMCP endpoint:
URL: https://api.fuzemcp.dev/mcp/your-project-id
- Add the authorization header:
Authorization: Bearer your-mcp-api-key
Connecting VS Code
VS Code supports MCP through the mcp.json configuration file:
{
"mcp": {
"servers": {
"my-api": {
"type": "https",
"url": "https://api.fuzemcp.dev/mcp/your-project-id",
"headers": {
"Authorization": "Bearer your-mcp-api-key"
}
}
}
}
}
Save this to .vscode/mcp.json in your project root.
Connecting Claude Code
Claude Code is Anthropic's terminal-based coding agent. It connects to MCP servers through the same configuration as Claude Desktop. Add this to ~/.claude/mcp.json:
{
"mcpServers": {
"my-api": {
"url": "https://api.fuzemcp.dev/mcp/your-project-id",
"type": "streamable-http",
"headers": {
"Authorization": "Bearer your-mcp-api-key"
}
}
}
}
After saving, start Claude Code with claude in your terminal. Your tools will be available automatically.
Using MCP Tools in Your Editor
Once connected, you can:
- Query data — Ask the AI to fetch records from your API
- Create records — Let the AI create resources through your API
- Debug — Inspect API responses without switching contexts
- Chain operations — The AI can make multiple API calls in sequence to complete a complex task
Advanced: Environment Variables for API Keys
Hardcoding API keys in config files is not ideal for team workflows. Most MCP clients support environment variable interpolation.
Cursor / VS Code
Use ${env:VARIABLE_NAME} to reference environment variables:
{
"mcp": {
"servers": {
"my-api": {
"url": "https://api.fuzemcp.dev/mcp/your-project-id",
"type": "https",
"headers": {
"Authorization": "Bearer ${env:MCP_TOKEN}"
}
}
}
}
}
Set MCP_TOKEN in your shell profile or .env file. The editor reads it at startup.
Claude Code / Claude Desktop
Claude Code supports shell command substitution for dynamic tokens:
{
"mcpServers": {
"my-api": {
"url": "https://api.fuzemcp.dev/mcp/your-project-id",
"type": "streamable-http",
"headers": {
"Authorization": "Bearer ${env:MCP_TOKEN}"
}
}
}
}
Using environment variables keeps your API keys out of version control and makes it easy to rotate credentials across your team.
Troubleshooting Common Issues
"Server not found" or "Connection refused" Check that your project ID is correct and that the endpoint URL matches exactly. MCP client URLs are case-sensitive.
"Unauthorized" or 401 errors Your MCP API key may have been rotated. Check your FuzeMCP project settings for the current key. Use our Config Generator to get a fresh config snippet.
Tools not appearing in the editor MCP clients refresh the tool list on connection. Disconnect and reconnect the server in your editor settings. Some editors require a restart.
Rate limit exceeded If you see 429 errors, check your plan's request limits. The free plan allows 1,000 requests/day. Upgrade your plan if you need more.
Performance Tips
- Keep your tool descriptions concise — long descriptions marginally increase response time
- For VS Code, use
type: "https"rather than"streamable-http"if you are on an older VS Code version - Cursor handles streaming responses natively, so
streamable-httpis recommended there
Example
With a product API connected, you can ask:
"Find all products with low inventory and create a report"
The AI calls your MCP tools, queries the data, and presents the results — all within your editor.
Related Posts
Get Started
Create a FuzeMCP account and connect your API to your editor in minutes.