Lesson 3

MCP Fundamentals

Model Context Protocol

🔌 MCP (Model Context Protocol) — an open protocol for connecting AI models to external systems. It's like USB for AI: a standard interface for integrating with databases, APIs, file systems.

How MCP Works
Claude Code
MCP Server
External System

MCP Server translates Claude's requests into commands for external systems

Database Query Example
UserClaudeShow tables in DB
ClaudeMCP Serverlist_tables()
MCP ServerPostgreSQLSELECT * FROM information_schema...
PostgreSQLMCP Server[users, orders, products]
MCP ServerClaudeResult: 3 tables
ClaudeUserThe database has 3 tables: users, orders, products
Popular MCP Servers

filesystem

File system access: read, write, search files

read_filewrite_filelist_directorysearch_files

postgres

Work with PostgreSQL database: queries, schema, data

querylist_tablesdescribe_tableinsertupdate

github

GitHub integration: issues, PRs, commits, actions

create_issuelist_prsget_filecreate_branch

brave-search

Web search via Brave Search API

searchsearch_newssearch_images
How to Configure MCP
// ~/.claude/settings.json
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "DATABASE_URL": "postgresql://user:pass@localhost/mydb"
      }
    },
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
    }
  }
}

Add configuration to ~/.claude/settings.json and restart Claude Code

💡 Benefits of MCP

🔒 Security

Data stays local. Claude doesn't see passwords directly — only query results.

🔌 Extensibility

You can write your own MCP server for any system — APIs, databases, IoT devices.

📦 Reusability

One MCP server works with any AI client that supports the protocol.

🚀 Performance

Server runs locally — no network latency for local resources.

Key Insight

MCP turns Claude Code into a universal interface to any system. Instead of writing integrations for each AI, you write one MCP server — and it works everywhere.

Lesson Quiz

1 of 1

1.What does MCP stand for in the context of Claude Code?

This lesson is part of a structured LLM course.

My Learning Path