Anthropic's command-line coding agent with native MCP support. Configure servers via project settings or the --mcp flag for terminal-based AI development workflows.
Claude Code is Anthropic's agentic coding tool that runs entirely in your terminal. Unlike GUI-based editors, Claude Code operates as a command-line interface where you describe tasks in natural language and Claude autonomously reads files, writes code, runs commands, and manages your project. It natively supports the Model Context Protocol (MCP), allowing you to extend its capabilities with external tools, file system access, GitHub integration, database connections, and any custom tooling you build.
Claude Code discovers MCP servers through configuration files and command-line flags. When you start a Claude Code session, it reads the MCP server definitions from your project's .claude/settings.json file (or the global ~/.claude/settings.json), spawns each server process, and makes their tools available throughout the session. Claude Code can then autonomously decide when to use these tools to accomplish your tasks.
The key difference from Claude Desktop is that Claude Code is designed for deep coding workflows. It already has built-in file system access and command execution, so MCP servers in Claude Code are most valuable for adding specialized capabilities like database queries, API interactions, search, and persistent memory.
There are three ways to configure MCP servers in Claude Code, each suited for different scenarios:
Create a .claude/settings.json file in your project root. This is ideal for project-specific servers that your team can share via version control:
.claude directory in your project root if it does not exist..claude/settings.json with your MCP server configurations under the mcpServers key.claude in your terminal from the project directory. Claude Code automatically detects and connects to the configured servers.For servers you want available in every project, add them to ~/.claude/settings.json. This is useful for general-purpose servers like memory or web search that are not project-specific.
For quick one-off use, pass MCP servers via the --mcp flag: claude --mcp "server-name:npx -y @modelcontextprotocol/server-name". Servers added this way are only available for that single session.
When both project-level and global settings define the same MCP server, the project-level configuration takes precedence. This lets you override global defaults for specific projects. For example, you might have a global filesystem server pointing to your home directory, but a project-level one pointing to just the project's source directory for tighter security.
Claude Code supports environment variables in MCP server configurations via the env field. These variables are passed only to the specific server process, not to Claude Code itself. For sensitive values like API tokens, you can also use a .env file in your project root - Claude Code will load these automatically, and servers can access them if they are included in the env configuration or inherited from the parent process.
Claude Code supports stdio transport (the default) where servers communicate via standard input/output. For remote servers, you can use SSE transport by specifying a url field instead of command and args. Stdio is recommended for local servers due to lower latency, while SSE enables connecting to shared team servers or cloud-hosted MCP services.
npx) is not in your terminal's PATH. Verify with which npx and ensure your shell profile loads the correct Node.js installation..claude/settings.json file. Make sure you are running Claude Code from the directory containing the .claude folder, or check that your global ~/.claude/settings.json exists and is valid JSON.env field is at the same level as command and args in the server configuration. Variables defined in env override system environment variables for that server process only.While Claude Code already has built-in file and terminal access, these MCP servers add valuable extra capabilities:
Browse our complete MCP server directory for more options.
For a detailed comparison of MCP setups across different AI clients, see our MCP Servers for Cursor, VS Code, and Claude guide. Visit our tutorials section for hands-on walkthroughs.
npx -y for servers you use frequently. Global installs skip the package resolution step: npm install -g @modelcontextprotocol/server-filesystem.htop or top if you notice slowdowns. Some MCP servers (especially database servers) can consume significant memory with large datasets.Claude Code runs with your user permissions and can already access your filesystem and execute commands. MCP servers add additional capabilities that require careful consideration:
.claude/settings.json to your .gitignore if it contains secrets.Claude Code is ideal for developers who live in the terminal and want an agentic, keyboard-driven workflow. If you prefer a graphical chat interface, try Claude Desktop. For a full IDE experience with MCP, consider Cursor or VS Code with GitHub Copilot. All clients share the same MCP server ecosystem - your server configurations are portable across clients with only minor format differences.
Config file location: .claude/settings.json or --mcp flag
Install Claude Code via npm: npm install -g @anthropic-ai/claude-code.
Create a .claude directory in your project root: mkdir -p .claude
Create .claude/settings.json with your MCP server configurations under the mcpServers key.
Run claude in your terminal from the project directory to start a session with MCP servers loaded.
Claude Code will display the connected MCP servers at startup. Verify your servers appear in the list.
Alternatively, use the --mcp flag for one-off sessions: claude --mcp "server-name:command args".
For global configuration, add servers to ~/.claude/settings.json to make them available across all projects.
Need help setting up Claude Code CLI?
Check our step-by-step IDE setup guide with troubleshooting tips.
All 60 servers in our directory work with Claude Code CLI.
Secure file operations with configurable access controls
Knowledge graph-based persistent memory system
Privacy-focused web search capabilities
File storage and document collaboration
Location services and mapping integration
Embedded SQL database operations
PostgreSQL database integration
Team communication and collaboration
Version control operations
Extract transcripts from YouTube videos
Browser automation and web scraping
Official GitHub integration with comprehensive API coverage
Find the best MCP servers for Claude Code CLI in each category.
MCP servers for secure file operations, directory management, and document processing. These servers provide sandboxed access to local and remote file systems with configurable permissions.
MCP servers for connecting AI assistants to SQL and NoSQL databases. Query, analyze, and manage your data through natural language with support for PostgreSQL, SQLite, MongoDB, Redis, and more.
MCP servers that connect AI assistants to external APIs and web services. Search the web, fetch data, interact with third-party platforms, and automate API workflows through natural language.
MCP servers for managing cloud infrastructure across AWS, Google Cloud, Azure, and platforms like Vercel, Netlify, and Cloudflare. Deploy, monitor, and manage cloud resources through AI assistants.
MCP servers for software development workflows including version control, CI/CD, code analysis, browser testing, and project management. Supercharge your development process with AI-powered tooling.
MCP servers for monitoring, observability, and data analytics. Connect AI assistants to Grafana, Datadog, and search platforms to analyze metrics, logs, and business data in real time.
MCP servers for messaging, video conferencing, and team collaboration platforms. Connect AI assistants to Slack, Discord, and Zoom for automated communication workflows.
MCP servers for CRM, e-commerce, project management, and business automation platforms. Connect AI to Shopify, Stripe, Salesforce, HubSpot, Notion, and more to streamline business operations.
Explore MCP setup guides for other AI-powered editors and clients.
Anthropic's official desktop app for Claude with built-in MCP server support. Configure servers via a JSON config file to extend Claude with file access, databases, APIs, and more.
The AI-first code editor with built-in MCP support. Configure MCP servers via .cursor/mcp.json to give Cursor's AI access to databases, APIs, file systems, and custom tools.
Visual Studio Code with GitHub Copilot supports MCP servers for extending AI capabilities. Configure servers in VS Code settings to connect Copilot to databases, APIs, and local tools.
Codeium's AI-powered IDE with MCP support. Configure MCP servers via ~/.windsurf/mcp.json to extend Windsurf's AI with custom tools, databases, and API integrations.
An autonomous AI coding agent for VS Code with MCP support. Configure MCP servers through Cline's VS Code settings to give it access to external tools and data sources.
Browse our complete directory of 60+ MCP servers, read our setup guides, and start building with the Model Context Protocol today.