🌐 What is the Model Context Protocol (MCP)
MCP is a open standard created by Anthropic to connect language models to external tools. Think of it as a "universal outlet" — any tool that implements the protocol can be plugged into Claude Code.
🔌 Why MCP changes everything
Before MCP, Claude Code could only access what was in the local filesystem. With MCP, it can:
- →Query a PostgreSQL database to understand the schema before writing code
- →Read GitHub issues and PRs to get context for a task
- →Browse web pages to research documentation
- →Send Slack messages when an automated task is complete
🔗 Configuring MCP Servers
MCP servers are configured in the settings.json in the key mcpServers. Each server needs a command to initialize and optionally arguments and environment variables.
MCP server configuration in settings.json
{
"mcpServers": {
// Servidor filesystem (oficial Anthropic)
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/projetos"]
},
// Servidor GitHub
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_..."
}
},
// Servidor PostgreSQL
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_URL": "postgresql://user:pass@localhost/db"
}
}
}
}
Choose the MCP server
Search in github.com/modelcontextprotocol/servers
# Servidores oficiais disponíveis:
@modelcontextprotocol/server-filesystem
@modelcontextprotocol/server-github
@modelcontextprotocol/server-postgres
@modelcontextprotocol/server-sqlite
@modelcontextprotocol/server-slack
@modelcontextprotocol/server-puppeteer
Add to settings.json
In the key mcpServers of the configuration file
# Editar settings.json
nano ~/.claude/settings.json
# ou via /config no REPL
Restart and verify
Claude Code starts the servers in the next session
claude
# No REPL verificar servidores ativos:
/mcp
# Output esperado:
✓ filesystem: connected
✓ github: connected
🛠️ MCP Ecosystem — Popular Tools
The official repository already has dozens of servers. The community is growing quickly — new servers appear every week.
📁 Filesystem
Access to the file system beyond the current directory
Useful for: monorepos, cross-project access
🐙 GitHub
Read/create issues, PRs, comments, commits
Useful for: automated code review, issue triage
🐘 PostgreSQL / SQLite
SQL queries, explore the schema, analyze data
Useful for: generating migrations, debugging queries
🤖 Puppeteer
Browse the web, take screenshots, interact with pages
Useful for: scraping, E2E tests, docs research
💬 Slack
Read channel history, send messages
Useful for: automated reports, notifications
🗺️ Google Maps / APIs
Community servers for external APIs
Useful for: projects with third-party integrations
✓ Trusted MCPs
- ✓Official servers for
@modelcontextprotocol - ✓Servers with audited open-source code
- ✓Community MCPs with lots of stars and active issues
✗ Evaluate carefully
- ✗Third-party MCPs without public source code
- ✗Servers that request full system access
- ✗MCPs that require production credentials
📁 Create and open a project
Claude Code works in the context of current directory. Opening the correct project is step zero before any task.
Open an existing project
# Navegar para o projeto e iniciar Claude Code
cd ~/projetos/meu-app
claude
# Claude imediatamente entende o contexto do diretório
# Lê package.json, CLAUDE.md, .claude/settings.json
# Gerar CLAUDE.md se não existir
# Dentro do REPL:
/init
# Claude analisa o projeto e gera rascunho do CLAUDE.md
Create a project from scratch
# Criar estrutura de projeto
mkdir ~/projetos/novo-projeto
cd ~/projetos/novo-projeto
git init
# Criar settings de projeto
mkdir .claude
cat > .claude/settings.json <<EOF
{
"permissions": {
"allow": ["Read(**)", "Write(**)", "Edit(**)", "Bash(npm *)"]
}
}
EOF
# Iniciar Claude Code e gerar CLAUDE.md
claude
> /init
> Crie um projeto Node.js + TypeScript com estrutura básica
💡 Recommended structure for new projects
meu-projeto/
├── .claude/
│ └── settings.json ← permissões do projeto (versionar)
├── CLAUDE.md ← instruções para o Claude (versionar)
├── src/ ← código-fonte
├── tests/ ← testes
├── .gitignore
└── package.json
🔄 First real workflow: from zero to commit
See the complete development cycle with Claude Code. This example creates a Simple REST API from scratch, with tests, and makes the first commit.
Define the scope
> Crie uma API REST em Express + TypeScript com um endpoint GET /health
que retorna { status: "ok", timestamp: ISO8601 }. Inclua um teste
básico com Vitest.
Claude creates the files (with confirmation)
# Claude mostra o plano e pede aprovação:
Vou criar: src/app.ts, src/routes/health.ts,
tests/health.test.ts, package.json
Continuar? [y/n] y
Run tests
> Instale as dependências e rode os testes
# Claude executa:
npm install
npm test
✓ health endpoint returns 200 (3ms)
Review and commit
> Revise os arquivos criados e faça um commit inicial
# Claude mostra diff → você revisa → aprova
git add .
git commit -m "feat: adicionar endpoint GET /health"
📊 Development loop with Claude Code
🚀 Next Steps: The Journey Continues
With installation, authentication, settings, and MCP configured, you have the complete base. The following learning paths explore each capability in greater depth.
Track 3: Skills
Create reusable skills. Skills are "macro commands" that encapsulate complex workflows and are available in any project.
Track 4: Automation
Hooks, triggers, pipelines, and workflows. Automate repetitive dev tasks with Claude as the orchestrator.
Track 5: Projects
Real end-to-end projects. From planning to delivery with Claude Code as your development partner.
💡 You completed Track 2!
Your environment is ready. You installed and authenticated, configured permissions, and connected MCP tools. Now it’s about using them consistently—the more you use them, the more productive you become.
Recommended next step: go to Track 3 (Skills) to create your first reusable skills.
✅ Module 2.4 Summary — and Track 2
Next Track:
Track 3 — Skills: create reusable capabilities that turn complex workflows into a single command. Claude Code’s superpower.