When working with AI assistants like Claude, you may need to set up Model Context Protocol (MCP) servers to extend the capabilities of your AI tools. However, the configuration can vary significantly between different platforms. In this article, I'll break down how to configure MCP servers across Claude Desktop, VS Code, and Cursor, highlighting the key differences and providing practical examples.
What Are MCP Servers?
Model Context Protocol (MCP) servers allow AI assistants to interact with external systems and tools. They act as intermediaries that enable AI models to access data, execute code, or perform actions outside their default capabilities.
Configuration Differences Between Platforms
While Claude Desktop, Cursor, and VS Code all support MCP servers, the syntax and capabilities differ between them.
VS Code Configuration
In VS Code, MCP servers need to be configured with this specific format:
{
"mcp": {
"servers": {
// Your servers configuration goes here
}
}
}
Claude Desktop and Cursor Configuration
For Claude Desktop and Cursor, the format is slightly different:
{
"mcpServers": {
// Your servers configuration goes here
}
}
Remote Servers: Platform Limitations
One important distinction is how different platforms handle remote servers. While Cursor supports remote servers through SSE (Server-Sent Events), Claude Desktop has limitations.
For example, this configuration works in Cursor but not in Claude Desktop:
{
"mcpServers": {
"photos": {
"transport": "sse",
"url": "http://localhost:3001/sse",
"env": {
"TRANSPORT": "sse"
}
}
}
}
Solutions for Claude Desktop
If you're using Claude Desktop, you have several alternatives to work around these limitations:
1. Local Command Execution via stdio
The most straightforward way to get MCP servers working in Claude Desktop is to execute them locally using stdio:
{
"mcpServers": {
"photos": {
"command": "node",
"args": [
"/path/to/your/server.js"
]
}
}
}
2. Using NPM Packages
Another option is to create and publish an NPM package, then invoke it with npx
:
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": ""
}
}
}
}
3. Docker Containers
For more complex setups, you can use Docker containers (requires Docker to be installed):
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": ""
}
}
}
}
Best Practices
Based on the available options, here are some recommendations:
For cross-platform compatibility: If you need your configuration to work across all platforms, stick with the local command execution approach.
For simplicity: Using published NPM packages with
npx
offers a clean solution if you don't want to manage local server files.For isolation and dependencies: Docker containers provide the best isolation and dependency management but require Docker to be installed.
Conclusion
Understanding the differences in MCP server configurations across platforms is crucial for effectively extending your AI assistants' capabilities. While Claude Desktop has some limitations regarding remote servers, multiple workarounds are available through local execution, NPM packages, or Docker containers.
By selecting the right approach for your specific needs, you can ensure your MCP servers work consistently across Claude Desktop, VS Code, and Cursor, enhancing your AI-assisted development workflow.
Disclaimer: AI was used to reformat this article and correct errors