The Deska blog

Setting Up MCP Servers for Claude Code

A technical guide on setting up MCP servers for Claude Code to extend agent capabilities with local and remote data sources.

· 10 min read

Claude Code represents a shift in how developers interact with large language models by moving the interface directly into the terminal. However, the true utility of this tool emerges when you begin setting up MCP servers for Claude Code. The Model Context Protocol (MCP) serves as an open standard that allows AI agents to access specific data sources and tools that are not part of their core training data. By configuring these servers, you grant Claude the ability to read your local filesystem, interact with databases, or fetch real-time information from external APIs.

Understanding the Role of MCP in Claude Code

The Model Context Protocol acts as a bridge. While Claude Code has built-in capabilities to edit files and run shell commands, it remains sandboxed from many specialized data environments. MCP servers solve this by providing a structured way for the agent to query external systems. When you connect an MCP server, you are essentially giving Claude a new set of "eyes" and "hands" for specific tasks.

This architecture is beneficial for several reasons. It maintains security by ensuring the agent only accesses what the server exposes. It also allows for modularity. You can swap servers or update them without changing your core agent configuration. For developers working on complex stacks, this means Claude can suddenly understand your Jira tickets, your Slack history, or your PostgreSQL schema.

Core Prerequisites for MCP Configuration

Before you begin the setup process, ensure your environment is ready for both the agent and the protocol. You will need a functioning installation of Claude Code, which typically requires a Node.js environment.

  • Node.js version 18 or higher is generally recommended.
  • A valid Anthropic API key.
  • The mcp-get utility or a similar package manager for MCP servers.
  • A terminal emulator with support for interactive sessions.

Once these basics are in place, the process involves defining where your servers live and how Claude should execute them.

Step by Step Guide to Setting Up MCP Servers for Claude Code

The configuration for MCP servers in Claude Code is handled through a JSON file. This file tells the agent which commands to run to start the server and what environment variables are necessary for authentication.

Identifying the Configuration File

Claude Code looks for its configuration in a specific directory depending on your operating system. Usually, this is found in your home directory under a hidden folder. You should look for a file named claude_desktop_config.json or a specific claude-code.json file. Even though Claude Code is a CLI tool, it often shares the MCP configuration logic with the desktop version of the Claude interface.

Adding a Local Server

If you have a local script that you want Claude to use, you must define it in the mcpServers object. For instance, if you have a Python script that acts as an MCP server for your internal documentation, your configuration would look like this:

{
  "mcpServers": {
    "my-internal-docs": {
      "command": "python",
      "args": ["/path/to/your/mcp-server.py"],
      "env": {
        "API_KEY": "your-secret-value"
      }
    }
  }
}

Using Pre-built Servers

Many developers prefer using community-maintained servers. The MCP ecosystem includes ready-made servers for Google Drive, GitHub, and Slack. To use these, you often point the command to npx followed by the package name of the server. This ensures that the server runs without requiring a manual global installation on your machine.

Managing Multiple Agent Environments in Deska

While running Claude Code in a standard terminal is effective, managing multiple agents and their respective MCP contexts can become cluttered. This is where Deska provides a different approach to the developer workflow. Instead of a single terminal window, you can use an infinite canvas to organize your work.

In Deska, you can run Claude Code, Codex CLI, and OpenCode side by side as individual panels. This layout allows you to monitor how different agents respond to the same MCP server configurations. For example, you might have one terminal panel running Claude with access to your database MCP, while another terminal runs a different agent focused on frontend files.

Deska is a free desktop app available for Mac, Windows, and Linux. It is built as a local-first environment, meaning your code, files, and agent sessions stay on your machine. This aligns well with the security goals of MCP, as the data flow remains within your local network as much as possible.

Comparing Claude Code with Other AI Workspaces

The developer tool landscape is expanding rapidly. Tools like Cursor, Windsurf, and Deska all offer ways to integrate AI into the coding process, but they differ in approach.

FeatureClaude Code (CLI)Traditional AI IDEsDeska
InterfaceTerminal OnlyCode CentricInfinite Canvas
MCP SupportNativeVaries by PluginThrough Panels
Data PrivacyLocal FilesystemCloud or LocalLocal-first
Multi-AgentSequentialLimitedSide-by-side

Traditional AI IDEs focus heavily on the editor itself. They provide excellent autocompletion and inline refactoring. Claude Code focuses on the power of the command line and agentic autonomy. Deska acts as a workspace manager that lets you combine these tools. You can use the Monaco code editor within a Deska panel while running Claude Code in an adjacent terminal panel, giving you the best of both worlds.

Troubleshooting Common MCP Issues

Setting up MCP servers for Claude Code is not always seamless. Here are common hurdles and how to address them:

  1. Permission Denied: Ensure the user running the terminal has execution rights for the server script or binary.
  2. Path Errors: Always use absolute paths in your JSON configuration. Relative paths often resolve to the wrong directory when the agent starts the server process.
  3. Node Version Mismatch: If an MCP server uses modern JavaScript features, make sure your global node version matches the requirements.
  4. Environment Variables: Some servers require specific keys like GITHUB_TOKEN. If these are missing from the env block in your config, the server will fail to initialize.

If you encounter persistent issues with terminal sessions, the Ask Deska assistant can help you manage your workspace. You can ask it to open specific panels or check the status of your current sessions, which helps when debugging complex multi-agent setups.

Advanced MCP Patterns for Enterprise Teams

For teams working at scale, setting up MCP servers for Claude Code might involve centralized data sources. You can host an MCP server on a secure internal server and have the agent connect via a secure proxy. This allows a team to share a common "context" about their infrastructure without every developer needing to maintain their own local database of documentation.

When working with these sensitive connections, the mobile app functionality in Deska becomes useful. You can monitor long-running agent tasks from your phone through a secure relay. The devices pair directly, which means no ports are exposed to the public internet. This is a secure way to keep an eye on a Claude Code session that is performing a large-scale refactor using an MCP server.

FAQ: Setting Up MCP Servers for Claude Code

How to add Google Drive to Claude Code via MCP?

To add Google Drive, you must configure a server that uses the Google Workspace API. You will need to create credentials in the Google Cloud Console, download the JSON key, and then reference a community-built Google Drive MCP server in your Claude configuration file, passing the credentials as environment variables.

Why is my MCP server not showing up in Claude Code?

This usually occurs due to a syntax error in the claude_desktop_config.json file or an incorrect path to the server executable. Verify that your JSON is valid and that the command listed in the config can be run manually in your terminal. Check the logs in the terminal where you started Claude Code for any initialization errors.

Can I run multiple MCP servers at once?

Yes, the mcpServers object in the configuration file can contain multiple entries. Claude Code will initialize all listed servers upon startup, allowing the agent to pull context from various sources like GitHub, Slack, and your local filesystem simultaneously.

Get Started with a Better Workspace

Setting up MCP servers for Claude Code is the first step toward a more integrated AI development experience. By giving your agent the right tools, you reduce the manual work of copying and pasting context. If you want a workspace that lets you visualize these agents and their output on an infinite canvas, try Deska. You can download the app for free and begin running your favorite coding agents side by side. Whether you are using your own API keys or a managed plan, Deska provides the flexibility to build your ideal AI-powered development environment.

💡 Ideas+🐛 BugsSuggest a feature or report a bug