General8 min read

MCP Server Setup: Install, Configure, and Connect to Claude Code

mcpsetupintegrationsconfiguration

Why MCP Servers Change What Claude Code Can Do

Out of the box, Claude Code works with your local filesystem, runs commands, and talks to the Claude API. That covers a lot. But the moment you want it to touch your GitHub issues, check your PostgreSQL schema, or post a Slack message, you hit a wall. MCP servers are the key to that wall.

MCP stands for Model Context Protocol. It is the same interface Claude Code uses internally for its built-in tools. Third-party developers have built MCP servers for GitHub, for databases, for Slack, for AWS, for Shopify — a growing list. Once you configure a server, its capabilities appear in Claude Code's tool list as if they were native features.

The setup process is not complicated, but it has enough steps that people get stuck. This guide covers the full path from installation to a working connection.

What You Need Before Starting

Node.js installed and npm available. Most MCP servers distribute as npm packages. You do not need Docker or any heavy infrastructure — the servers run as local processes that Claude Code communicates with over stdio.

You also need whatever credentials the service requires. A GitHub personal access token for the GitHub MCP server. A Shopify Admin API key for the Shopify server. The credentials go in your configuration, not hardcoded anywhere public.

Installing Your First MCP Server

Start with the GitHub server — it is the most universally useful and the setup is straightforward. Install it globally via npm:

npm install -g @anthropic-ai/mcp-server-github

You can also install it locally in a project if you prefer to keep it contained. The global install works fine for most use cases.

You need a GitHub token with the appropriate scopes. For read-only access to repos and issues, repo:status and read:user are enough. For full control — creating issues, commenting, managing PRs — you need repo full control. Generate the token in GitHub Settings > Developer Settings > Personal Access Tokens.

The Configuration File

Claude Code looks for .mcp.json in your project root. If you want MCP servers available across all projects, you can also create a global one — the path depends on your OS, but Claude Code will tell you where it looks if you run it without a project-level config present.

Create .mcp.json in your project root:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["@anthropic-ai/mcp-server-github"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Some people worry about putting tokens in config files. For personal projects on your own machine, this is fine. For team environments, use environment variables instead of hardcoding tokens:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["@anthropic-ai/mcp-server-github"],
      "env": {
        "GITHUB_TOKEN": "${GITHUB_TOKEN}"
      }
    }
  }
}

Claude Code expands environment variables from the config. You set GITHUB_TOKEN in your shell profile or export it before starting a session.

Restart and Verify

Start a new Claude Code session. Run claude --tools or just ask Claude Code what tools are available. If the GitHub MCP server is connected, you will see new tools prefixed with github_ or similar — the exact names depend on what the server exposes.

If the tools do not appear, run with --debug to see discovery logs. The debug output shows whether Claude Code found the config, whether it successfully started the MCP server process, and what went wrong if the connection failed.

Installing Other MCP Servers

The pattern is the same for any MCP server: install the npm package, add the config entry, restart the session. Here are the common ones worth knowing about:

Filesystem — gives Claude Code controlled access to files outside your project directory. Useful when you need it to read configuration files or assets that live elsewhere:

npm install -g @anthropic-ai/mcp-server-filesystem

PostgreSQL — connects to your database so Claude Code can read schema, run queries, and understand your data model. The server needs a connection string with appropriate database permissions:

npm install -g @modelcontextprotocol/server-postgres

Slack — post messages, search history, manage channels. Useful for building workflows that involve team communication. Requires a Slack app with the right OAuth scopes.

The MCP server ecosystem is growing fast. New servers appear regularly. The general setup pattern stays consistent even as the specific servers change.

Debugging Common Problems

The most common issue: the server process starts but the tools do not appear. Run claude --debug and look for lines about MCP discovery. If the config file is not being read, the debug output will say so — usually because the file is malformed JSON or named incorrectly.

A second common issue: the server starts but fails when you try to use a tool. This is usually a credentials problem — a token expired, a connection string is wrong, the permissions are insufficient. The error message from the server will tell you what went wrong if you read past the initial failure.

A third issue: a server works in one project but not another. Check which .mcp.json is in effect. Claude Code uses project-level config if it exists, otherwise falls back to the global config. If you added the server to the wrong one, it will not be available where you need it.

Security Considerations

MCP servers run as local processes with whatever permissions your user has. A GitHub MCP server can read and write to your repos if the token has those permissions. A database MCP server can run any query your connection string allows. This is powerful and dangerous in equal measure.

Before connecting a new MCP server, ask what it can do with the credentials you give it. A server that only needs read access should not get a token with write permissions. A server that needs a database connection should connect to a role with minimal privileges, not your database admin account.

For team environments, document which MCP servers are approved for use and what credentials they require. The power of MCP servers to connect Claude Code to real systems makes them useful, but also makes misconfiguration a real risk.

Get Started with Claude Code

Start building with Claude Code today. Free to download, powerful enough for production.