Model Context Protocol (MCP): What It Is and How to Configure It
MCP is Anthropic's open standard for connecting AI models to tools, files, and databases. Learn how the client-server architecture works, which servers to use, and how to write a working MCP config for Claude Desktop and Claude Code.
For most of AI's short history, connecting a language model to an external tool meant writing custom integration code for every single tool. Want the model to read a file? Write a function. Query a database? Write a different function, in a different format, for every model you want to support. The result was a fragmented ecosystem where every AI application reinvented the same plumbing from scratch.
Model Context Protocol (MCP) is Anthropic's answer to this problem: an open standard that gives AI models a single, consistent interface to tools, files, databases, and services. You can use the BrowseryTools MCP Config Generator — free, no sign-up, everything stays in your browser — to build and validate MCP configuration files without writing JSON by hand.
What Is MCP and Why Does It Exist?
MCP stands for Model Context Protocol. It is an open protocol — published by Anthropic in late 2024 and available at modelcontextprotocol.io — that standardizes how AI models communicate with external data sources and tools. Think of it as a universal adapter: instead of a model needing a custom plugin for GitHub, a different one for your filesystem, and another for your database, MCP provides a single interface that any compliant client and server can speak.
The analogy Anthropic uses is USB-C: before USB-C, you needed a different cable for every device. MCP aims to be that universal connector for AI tool use. A tool built once as an MCP server works with any MCP-compatible client — Claude Desktop, Claude Code, and any other host that implements the protocol.
MCP Architecture: Clients, Hosts, and Servers
MCP has three components that work together:
- Host — The AI application running on the user's machine (e.g., Claude Desktop, an IDE extension). The host manages connections to one or more MCP servers and injects their capabilities into the AI context.
- Client — A protocol client embedded in the host that maintains a 1:1 connection with a single MCP server. The host spawns one client per server.
- Server — A lightweight program that exposes capabilities (tools, resources, prompts) through the MCP protocol. Servers can be local processes (running on your machine) or remote services reachable over HTTP.
When you ask Claude to "read the README in my project," the host's MCP client sends a request to the filesystem MCP server, which reads the file and returns the content. Claude never touches your filesystem directly — the server does, and it reports back through the protocol.
What MCP Servers Can Expose
MCP servers can expose three types of capabilities:
- Tools — Functions the model can call. Examples: search a database, create a GitHub issue, run a terminal command, fetch a URL.
- Resources — Data the model can read. Examples: files, database rows, API responses, documentation pages. Resources are like read-only context sources.
- Prompts — Pre-built prompt templates that users can invoke by name. Useful for exposing standardized workflows.
Common MCP Servers Worth Knowing
- filesystem — Reads and writes files on your local machine within a specified directory. The most commonly used server. Required for Claude Code to read your codebase.
- github — Searches repositories, reads files, creates issues and pull requests, fetches commit history. Uses the GitHub API with your personal access token.
- postgres / sqlite — Runs SQL queries against a database. Read-only by default in most implementations for safety.
- brave-search / fetch — Fetches URLs or runs web searches, giving the model access to current information beyond its training cutoff.
- memory — Persistent key-value storage that survives between sessions. Gives the model a memory layer it can write to and read from.
- puppeteer / playwright — Controls a headless browser. Lets the model navigate web pages, fill forms, and extract content from JavaScript-rendered sites.
Writing a Basic MCP Config JSON
MCP configuration lives in a JSON file that the host application reads at startup. For Claude Desktop on macOS, this file is at ~/Library/Application Support/Claude/claude_desktop_config.json. The structure is consistent regardless of which servers you add:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/yourname/Documents",
"/Users/yourname/Projects"
]
}
}
}Each key inside mcpServers is the name you give the server — this is the label that appears in the Claude UI. The command and args fields define how to start the server process. Most official servers are npm packages, so npx -y downloads and runs them on first use without a separate install step.
Adding Multiple Servers
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/yourname/Projects"
]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
},
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://localhost/mydb"
]
}
}
}The env field passes environment variables to the server process. Sensitive values like API keys and database credentials should go here, not hardcoded in args, so you can manage them separately and avoid accidentally committing them to version control.
Configuring MCP in Claude Code
Claude Code (the CLI tool) uses a slightly different configuration mechanism. You add MCP servers with the claude mcp add command:
# Add a local stdio server claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/dir # Add a remote HTTP server claude mcp add my-server --transport http http://localhost:8080/mcp # Add with environment variables claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=ghp_... -- npx -y @modelcontextprotocol/server-github # List all configured servers claude mcp list
Claude Code stores server configs in ~/.claude/ by default (user scope) or in.mcp.json at the project root (project scope). Project-scoped configs are useful for team repositories — commit the .mcp.json and everyone on the team gets the same server configuration automatically.
Common Configuration Mistakes
- Wrong path separator — Windows uses backslashes but JSON strings require forward slashes or escaped backslashes. Always use forward slashes in MCP configs, even on Windows.
- Missing directory permissions — The filesystem server can only access directories you explicitly list in its args. If Claude says it cannot find a file, check that the file's parent directory is in the allowed list.
- Stale server process — If a server crashes, the host may not restart it automatically. Restart Claude Desktop or run
claude mcp restart <name>in Claude Code to get a fresh connection. - Version mismatches — MCP is actively developed. If a server is behaving unexpectedly, check whether you are running the latest version with
npx -y @modelcontextprotocol/server-name@latest.
Generate Your Config with BrowseryTools
Writing MCP JSON by hand is tedious and easy to get wrong — a missing comma or a misquoted path makes the whole config fail silently. The BrowseryTools MCP Config Generator lets you select your servers, fill in the required parameters, and get a valid, formatted JSON config ready to paste into your Claude Desktop config file or .mcp.json. Everything runs in your browser and no credentials are stored.
Summary
MCP is the infrastructure layer that transforms a standalone chat model into a connected agent with access to your actual files, code, databases, and services. The protocol is open, the servers are modular, and the configuration format is straightforward JSON. Once your MCP config is in place, you get a dramatically more capable AI assistant without changing how you interact with it — the tools are just there, ready to use.
Try the Tools — 100% Free, No Sign-Up
Everything runs in your browser. No uploads. No accounts. No ads.
Explore All Tools →