Set Up MCP Server in Claude Code — The Quick and Simple Way

Ever found yourself battling with a command-line wizard, wishing you could just edit a file directly?

You’re not alone. While setting up MCP server in Claude Code, I discovered a much better way than the official, step-by-step approach.

If you’ve been using Claude Code for a while, you know it’s a powerful tool that works directly in your terminal, helping you with everything from writing code to managing your git workflows.

It’s designed to understand your entire codebase and assist with development tasks through natural language commands.

But when it comes to adding new tools, the default method can be a bit… rigid.

The Frustration with the Standard CLI Approach

The official way to add MCP (Model Context Protocol) server is through a command-line interface (CLI) wizard (claude mcp add).

At first glance, this seems helpful. The wizard guides you through each step of the configuration process.

However, this method quickly becomes a pain point for several reasons:

  • Mistakes are costly: A single typo often means you have to start the entire process from scratch.
  • Lack of overview: You can’t see all your configurations in one place.
  • Complex setups are a hassle: Pasting intricate configurations is difficult.
  • Minor changes are tedious: Even a small tweak requires navigating through multiple prompts again.

For developers who prefer a comprehensive view and the ability to make precise edits, this step-by-step process can feel like a step backward.

See also: Mastering the Linux Command Line — Your Complete Free Training Guide

The Better Way: Direct Configuration File Editing

Fortunately, there’s a more efficient method: directly editing the configuration file.

This is especially useful for larger setups with numerous parameters, like file paths and environment variables.

Finding the Configuration File

The first challenge is locating the file. After a bit of digging, I found it in my home directory:

/home/your_username/.claude.json

or more simply:

~/.claude.json

For those of us using Windows Subsystem for Linux (WSL), the file is conveniently located within the Linux filesystem, which simplifies the process.

A Look Inside the .claude.json File

This file holds more than just your MCP server setups. Here’s a simplified look at its structure:

{
    "numStartups": 34,
    "autoUpdaterStatus": "enabled",
    "theme": "dark-daltonized",
    "projects": {
        "/home/scott/repos/my-project": {
            "mcpServers": {}
        }
    },
    "mcpServers": {
        "server-name": {
            "command": "command-to-run-server",
            "args": ["arg1", "arg2", "..."]
        }
    }
}

The key section for our purposes is the mcpServers object. This is where all your MCP tool configurations live, with each tool having its own named entry.

Practical Examples of Direct Configuration

Let’s walk through a few real-world examples to see how easy it is to add tools this way.

A Simple Start: Sequential Thinking

One of the most straightforward examples is the official Sequential Thinking MCP Server, which helps break down complex problems into smaller steps. Here’s how you add it to your config file:

{
    "mcpServers": {
        "sequential-thinking": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@modelcontextprotocol/server-sequential-thinking"
            ]
        }
    }
}

Streamlining Your Tools with mcp-omnisearch

I used to have separate configurations for various search tools like Brave, Tavily, and Kagi.

This cluttered my config file and made managing API keys a chore. To solve this, I created mcp-omnisearch, a single MCP server that bundles multiple search and content processing tools.

Here’s the configuration:

{
    "mcpServers": {
        "mcp-omnisearch": {
            "type": "stdio",
            "command": "npx",
            "args": ["-y", "mcp-omnisearch"],
            "env": {
                "TAVILY_API_KEY": "your-tavily-key",
                "BRAVE_API_KEY": "your-brave-key",
                "KAGI_API_KEY": "your-kagi-key",
                "PERPLEXITY_API_KEY": "your-perplexity-key",
                "JINA_AI_API_KEY": "your-jina-key",
                "FIRECRAWL_API_KEY": "your-firecrawl-key"
            }
        }
    }
}

This single entry gives me access to a suite of tools for search, AI-powered answers, and content processing.

The best part? All API keys are optional, so it dramatically simplifies my setup while expanding my capabilities.

Leveling Up with mcp-sequentialthinking-tools

For those who use the standard sequential thinking tool, my enhanced version, mcp-sequentialthinking-tools, offers a nice upgrade. It not only breaks down problems but also suggests the most effective MCP tools to use at each stage.

The configuration is just as simple:

{
    "mcpServers": {
        "mcp-sequentialthinking-tools": {
            "type": "stdio",
            "command": "npx",
            "args": ["-y", "mcp-sequentialthinking-tools"]
        }
    }
}

Adding Your Own Custom Tools

If you’re developing your own MCP tools, configuring them is a similar process. You just need to point to your built JavaScript file:

{
    "mcpServers": {
        "my-custom-tool": {
            "type": "stdio",
            "command": "node",
            "args": ["/home/scott/mcp-tools/my-custom-tool/build/index.js"]
        }
    }
}

Don’t Forget to Restart!

After you’ve saved your changes to the .claude.json file, you’ll need to restart Claude Code for them to take effect.

Upon restarting, you should see a confirmation that your MCP servers have been found. You can then use the /mcp command to check their status.

Why This Method Is a Game-Changer

Editing the config file directly offers several clear advantages:

  • Full Visibility: See all your tool configurations at a glance.
  • Easy to Share and Backup: Copying your setup to a new machine is as simple as copying a file.
  • Version Control: Track changes to your configuration over time using git.
  • Effortless Edits: Make quick changes without going through the wizard.
  • Supports Complexity: Easily handle advanced setups that are cumbersome with the CLI.

My Current, Simplified Setup

After streamlining my tools, here’s what my mcpServers configuration looks like now (with the API keys removed):

{
    "mcpServers": {
        "mcp-omnisearch": {
            "type": "stdio",
            "command": "npx",
            "args": ["-y", "mcp-omnisearch"],
            "env": {
                "TAVILY_API_KEY": "",
                "BRAVE_API_KEY": "",
                "KAGI_API_KEY": "",
                "PERPLEXITY_API_KEY": "",
                "JINA_AI_API_KEY": ""
            }
        }
    }
}

That’s it. One tool to rule them all, providing powerful capabilities for web searching, document reading, and content processing through a single, clean configuration.

Final Thoughts

While the CLI wizard is the “official” path, editing the configuration file directly offers far more control and flexibility, especially for those with more complex needs or who are developing their own tools.

By embracing this direct approach, you can manage your MCP tool configurations more efficiently, saving yourself time and frustration.

If you’re a Claude Code user, I highly recommend giving this method a try. It’s a small tweak to your workflow that will make a big difference.

David Cao
David Cao

David is a Cloud & DevOps Enthusiast. He has years of experience as a Linux engineer. He had working experience in AMD, EMC. He likes Linux, Python, bash, and more. He is a technical blogger and a Software Engineer. He enjoys sharing his learning and contributing to open-source.

Articles: 548

Leave a Reply

Your email address will not be published. Required fields are marked *