Free

What Is MCP: Connecting Claude Code to the Outside World

Explains how MCP works and how to configure it, so Claude Code can connect to databases, GitHub, Slack, and other external systems via MCP Servers.


Claude Code has a defined scope by default: read and write local files, run terminal commands, use built-in tools. But real projects demand more — querying a database, reading Notion docs, searching Slack messages, calling internal APIs.

MCP is how you bridge that gap.

What MCP Is

MCP (Model Context Protocol) is an open protocol from Anthropic that defines how AI models communicate with external tools and data sources. Think of it as installing plugins for Claude Code — each MCP Server is a standalone service that exposes a set of tools Claude can call directly during a session.

Unlike Hooks (which trigger scripts when Claude performs an action), MCP actively extends what Claude can do: whatever you connect, Claude can operate.

How It Works

The architecture is straightforward:

Claude Code (Client)  ←→  MCP Server  ←→  External System
  1. You declare an MCP Server in your config (a local process or remote service)
  2. Claude Code connects to it on startup and receives the list of exposed tools
  3. During a session, Claude can call those tools just like it calls built-in ones (Read, Write, Bash)
  4. The MCP Server handles the request and returns the result

The whole thing is transparent to you. You see Claude say "let me check the database" and get an answer — MCP is handling the handoff in the background.

Three Types of MCP Capabilities

MCP Servers can expose three things:

Tools
Functions Claude can actively call — "query the users table," "search documents," "send a Slack message." This covers 90% of real use cases.

Resources
Structured data Claude can read as context — database schemas, API docs, config files.

Prompts
Predefined prompt templates users can invoke directly.

In practice, you'll almost always be working with Tools.

Quick Start: Add an Existing MCP Server

Using the official Filesystem MCP as an example — this server gives Claude access to parts of your file system beyond the working directory.

Install

npm install -g @modelcontextprotocol/server-filesystem

Configure

Edit ~/.claude/settings.json:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/yourname/Documents"
      ]
    }
  }
}

Verify

Restart Claude Code and try:

List all PDF files under /Users/yourname/Documents

If Claude returns results instead of saying "I can't access the file system," MCP is working.

Config Structure

{
  "mcpServers": {
    "server-name": {
      "command": "start command",
      "args": ["arg list"],
      "env": {
        "API_KEY": "xxx"
      }
    }
  }
}
  • command + args: how Claude Code launches the MCP Server process
  • The server name is just a local label — name it whatever makes sense
  • Use env for API keys and sensitive config; don't hardcode them

Where to Put the Config

MCP config can live in three places, ordered from lowest to highest priority:

Location File Use When
Global ~/.claude/settings.json Tools you want in every project
Project .claude/settings.json Tools specific to this project
Local override .claude/settings.local.json Personal config, not committed to git

For database connections and internal APIs, use project-level config and commit it with your code. Team members who clone the repo get the same MCP setup automatically.

Where to Find Existing MCP Servers

Anthropic maintains a set of official servers:

  • @modelcontextprotocol/server-filesystem — file system access
  • @modelcontextprotocol/server-github — GitHub operations (PRs, issues, code search)
  • @modelcontextprotocol/server-postgres — PostgreSQL queries
  • @modelcontextprotocol/server-slack — read and write Slack messages
  • @modelcontextprotocol/server-google-maps — maps and geolocation

The community has built many more covering Notion, Linear, Jira, and various databases.

MCP vs Hooks: Which One to Use

Hooks MCP
Triggered by Claude performing a specific action Claude actively calling a tool
Purpose Intercept or enhance existing behavior Add new capabilities
Typical use Format on save, check before commit Query a database, call an external API
Setup complexity Low Medium

They're complementary. Hooks shape how Claude works; MCP shapes what Claude can do.

What's Next

This is an introduction to MCP concepts. Upcoming articles will cover:

  • Connecting Claude Code to a real PostgreSQL database with a real schema
  • Wiring up internal tools and APIs
  • Building your own MCP Server from scratch

If you already have a system you want to connect, check the MCP Server list first — there's a good chance someone has already built what you need.