Advanced 6 min read

MCP Protocol

Integration framework for external tools and data sources

Prerequisites

  • Basic Claude Code usage
  • Familiarity with APIs

What You'll Learn

  • Understand MCP architecture and concepts
  • Configure MCP servers in settings
  • Use popular servers (filesystem, PostgreSQL, GitHub)
  • Build custom MCP servers for your needs

🤖Claude CodeAI AssistantMCPModel ContextProtocol🌐External WorldAPIs, Databases, ToolsRequestResponseCallDataMCP: A standardized protocol for AI-tool communicationEnables Claude to interact with any MCP-compatible server
01/05
0:00 / 0:24

What MCP Enables

🗄️
Database Access

Query PostgreSQL, SQLite, or other databases directly from conversations

📁
File Operations

Read, write, and search files across your filesystem

🔌
API Integration

Connect to GitHub, Slack, Linear, and other services

🌐
Browser Automation

Control browsers via Puppeteer or Playwright for testing

Configuring MCP Servers

MCP servers are configured in your Claude settings. Here's an example configuration:

// ~/.claude/settings.json

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user"]
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": { "DATABASE_URL": "postgres://..." }
    }
  }
}
mcpServers

Top-level key containing all server configs

command/args

How to start the MCP server process

env

Environment variables for the server

Popular MCP Servers

Filesystem
@modelcontextprotocol/server-filesystem

Read, write, and search files

read_filewrite_filesearch_files
PostgreSQL
@modelcontextprotocol/server-postgres

Query PostgreSQL databases

querylist_tablesdescribe_table
GitHub
@modelcontextprotocol/server-github

Interact with GitHub repos

create_issuesearch_codeget_file
Puppeteer
@modelcontextprotocol/server-puppeteer

Browser automation and screenshots

navigatescreenshotclick
Slack
@modelcontextprotocol/server-slack

Send messages, search channels

post_messagesearchlist_channels
Memory
@modelcontextprotocol/server-memory

Persistent key-value storage

storeretrievelist_keys

Tools vs Resources

Tools

Actions that Claude can execute. Tools perform operations and return results.

  • Can have side effects (write files, send messages)
  • Called explicitly when needed
  • Examples: query, create_issue, post_message
📚
Resources

Data that Claude can read. Resources provide context without executing actions.

  • Read-only access to data
  • Can be loaded into context automatically
  • Examples: file contents, database schema, config

Installing MCP Servers

1
Find a server

Browse the MCP server registry or npm for @modelcontextprotocol/server-* packages

2
Add to settings

Configure the server in ~/.claude/settings.json under mcpServers

3
Restart Claude Code

Claude will connect to the new server and discover its tools and resources

⚠️ Security Considerations

  • MCP servers run with your user permissions—they can access anything you can access.
  • Only install servers from trusted sources. Review the code if possible.
  • Use environment variables for sensitive credentials—never hardcode them in settings.
  • Limit filesystem server paths to directories you want Claude to access.

💡 Pro Tips

  • 1.Start with the filesystem server—it's the most universally useful and helps Claude navigate your projects.
  • 2.Use /mcp to see which servers are connected and what tools are available.
  • 3.Combine database + filesystem servers for powerful data analysis workflows.
  • 4.Create project-specific MCP configs in .claude/settings.json for team consistency.

Master Claude Code faster

Get notified when new animated guides are released.

Subscribe to the newsletter