free-ai-lab free-ai-lab

MCP Configuration Guide

Tutorial

Setup for Claude Desktop / Cursor / VS Code + common error troubleshooting.

Prerequisites

  • Claude Desktop / Cursor / VS Code installed
  • Required runtime for the server you are installing (most need Node.js or Python, some require extra dependencies)
  • Have API credentials ready (e.g., GitHub token) — you will need them during configuration

Claude Desktop

Graphic workflow:

  1. Open Claude Desktop → Settings
  2. Go to Developer → click Edit Config
  3. Add your server under the mcpServers section in claude_desktop_config.json:
{ "mcpServers": { "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "your-token" } } } }

Save the file and restart Claude Desktop. Your new tool will appear in the tool list on the left sidebar. Always refer to the server's README for the exact command and arguments.

Cursor

  1. Open the command palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Search and select Cursor Settings > MCP
  3. Click Add New MCP Server, choose the transport type (stdio or SSE), and fill in the command/arguments

VS Code

  1. Install the MCP Client extension (or use Copilot/extensions that ship with built-in MCP support)
  2. Configure mcpServers in extension settings using the same JSON format as Claude Desktop
  3. Reload the VS Code window for changes to take effect

UI layouts can change between client versions — always refer to official documentation for the exact steps; the command/JSON structure always follows the server's README.

Troubleshooting Common Errors

Error Cause Fix
command not foundNode/Python runtime not installed or not in PATHInstall the runtime and restart the client
401 / 403Invalid or expired API credentialsRegenerate the token and double-check your environment configuration
Connection refusedIncorrect SSE server address or the service is not runningVerify the URL + port and confirm the server is online
Tool not foundConfiguration changes loaded because the client wasn't restartedRestart the client application completely after saving the config

Security Notes

  • Tokens are stored only in your local config file — never commit the file to Git (remember to add .gitignore)
  • Only install servers from trusted, high-star projects — unvetted servers could exfiltrate your data
  • Grant high-permission servers only when absolutely necessary