Skip to content
TrustedSkillsbeta
Developer

Install an MCP Server in Claude Code on Mac: CLI & Manual Methods

Install an MCP server for Claude Code on Mac using the CLI or manual config editing. Covers global vs project scope, NVM path fixes, and how to verify tools are loading correctly.

Last updated 27 September 2026

⚡ Quick Answer

Run claude mcp add --scope user memory -- npx -y @modelcontextprotocol/server-memory. Claude Code saves it in ~/.claude.json. For a server the whole team shares, use --scope project, which writes .mcp.json in your project root. If Claude Code can't find npx because you use nvm, use the full path from which npx.

💡 Installing a skill from TrustedSkills? Most listings here are SKILL.md skills, not MCP servers, and they need no MCP config at all. One command installs one — see install a skill in Claude Code. This guide covers MCP servers.

The CLI is the quickest way to add an MCP server to Claude Code on a Mac. It writes the config for you. Editing .mcp.json by hand is useful when you want to review exactly what a project shares with the team.

Prerequisites

  • Node.js installed, for servers that run with npx. Check with node --version
  • Claude Code: curl -fsSL https://claude.ai/install.sh | bash (or brew install --cask claude-code)

Method 1: CLI (Recommended)

# User scope — available in every project, stored in ~/.claude.json
claude mcp add --scope user memory -- npx -y @modelcontextprotocol/server-memory

# Project scope — written to .mcp.json in the current project
claude mcp add --scope project memory -- npx -y @modelcontextprotocol/server-memory

# With an env variable (API key, etc.)
claude mcp add --scope user brave-search -e BRAVE_API_KEY=yourkey -- npx -y @brave/brave-search-mcp-server

# See what's configured
claude mcp list

# Remove something
claude mcp remove memory

If you leave out --scope, Claude Code uses the local scope: only you, only in the current project.

Method 2: Edit .mcp.json by Hand

For a project server, create .mcp.json in your project root:

code .mcp.json   # opens it in VS Code
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"]
    }
  }
}

Do not hand-edit ~/.claude.json. Claude Code keeps its own state in that file. Use the CLI for user-scoped servers.

The nvm Problem on Mac

nvm sets up Node.js in your shell start-up files. If Claude Code starts from somewhere that does not load them, it may not find the npx that nvm manages.

# Find the full path to npx
which npx
# /Users/yourname/.nvm/versions/node/v20.11.0/bin/npx
{
  "mcpServers": {
    "memory": {
      "command": "/Users/yourname/.nvm/versions/node/v20.11.0/bin/npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"]
    }
  }
}

This path includes the Node.js version. Update it when you change versions with nvm.

Verify It Worked

claude mcp list       # lists configured servers
claude mcp get memory # shows one server and checks that it connects
claude                # start a session
/mcp                  # inside Claude Code: shows each server and its status

Frequently Asked Questions

CLI vs manual editing — which should I use?

Use the CLI for most additions. It writes valid JSON to the right file. Edit .mcp.json by hand when you want to review exactly what the project shares.

How do I add an API key to an MCP server on Mac?

With the CLI: claude mcp add my-server -e API_KEY=abc123 -- npx -y @package/name. In .mcp.json, add an "env" block and use a ${API_KEY} reference instead of the real key.

How do I know a server loaded successfully?

Run claude mcp get <name>. It shows the server and checks the connection. Inside a session, type /mcp to see each server and its status.

TT

TrustedSkills Team

The TrustedSkills team maintains the TrustedSkills index of AI agent skills. The index records where each skill comes from and how to install it. It does not review or audit skill code.