[TIP] How to Add MCP Servers to Claude Code and Gemini CLI on Windows


Introduction

AI agents in the terminal, like Claude Code and Gemini CLI, are amazing tools. But you can make them even better by adding Model Context Protocol (MCP) servers. These servers give your AI agents new tools and fresh data to work with.

If you ask me, the context7 MCP server is an absolute essential for any developer. It connects your AI directly to the newest documentation. By using it, you guarantee your projects are fully up-to-date. This allows you and your AI model to work together to solve problems using the latest best practices and recommendations from the developer community.

While setting up context7, I noticed that each CLI tool saves its settings in a different way. In this quick guide, I will show you exactly how to register MCP servers on Windows for Claude, Gemini, and Codex.

🛠️ Claude Code: Easy Commands and Hidden Files

Claude Code makes it very simple to add an MCP server. You just need to open your terminal and run this command:

# claude mcp add <your-mcp-server>
# Commands for context7 and playwright
claude mcp add context7 -- cmd /c "npx -y @upstash/context7-mcp@latest"
claude mcp add playwright -- cmd /c "npx -- @playwright/mcp@latest"

Where are the settings saved on Windows? Even though the command is easy, it is good to know where the settings live. On Windows, Claude Code saves everything in a simple JSON file inside your user folder:

C:\Users\##USER##\.claude.json

Why is this important? If a server stops working, or you need to change an environment variable manually, you can open this file and fix it fast.

🚀 Gemini CLI: Simple Manual Setup

If you use the Gemini CLI and want to add the context7 server, the process is manual but very easy. This gives you full control over your setup.

Gemini CLI uses a settings.json file. On Windows, you can find it here:

%USERPROFILE%\.gemini\settings.json (You can also use C:\Users\##USER##\.gemini\settings.json).

How to add the server:

  1. Open the file in your code editor (like VS Code).
  2. Find the mcpServers section.
  3. Add your new server. For Context7, it looks like this:

JSON

{
"mcpServers": {
"context7": {
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp@latest"
]
}
}
}
  1. Save the file.
  2. Open your terminal, run the Gemini CLI, and type /mcp list.

If everything is correct, you will see context7 in your list. Now your Gemini CLI has access to fresh context!

🤖 Codex CLI: Direct Commands and TOML Files

Codex CLI also makes it very easy to integrate MCP tools using simple terminal commands.

To add the Context7 and Playwright server, just run:

codex mcp add context7 -- cmd /c "npx -y @upstash/context7-mcp@latest"
codex mcp add playwright -- cmd /c "npx -- @playwright/mcp@latest"

Where does Codex CLI save its configuration? Unlike Claude and Gemini, which use JSON files, Codex saves its settings in a .toml file. On Windows, you can find it here:

%USERPROFILE%\.codex\config.toml

If you ever need to edit your configuration by hand, just open that file. It is that simple!

💭 Conclusion

Adding MCP servers is the best way to upgrade your terminal assistants. Whether you use quick commands in Claude and Codex, or edit the settings.json file in Gemini, knowing where these Windows configuration files are saved will save you a lot of time.

Are you using any cool MCP servers in your daily work? Let me know in the comments below!

📚 References

If you want to learn more, here is the official MCP documentation for each tool:

Deja un comentario

Este sitio utiliza Akismet para reducir el spam. Conoce cómo se procesan los datos de tus comentarios.