PTENES
MODULE 2.4

🔌 MCP and your first project

Model Context Protocol: connect Claude to external tools, configure MCP servers, create your first real project, and run a complete workflow from scratch to commit.

6
Topics
45
Minutes
Basic
Level
Hands-on
Type
1

🌐 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.

Claude Code MCP client Filesystem read/write files PostgreSQL query the database GitHub PRs, issues, commits Slack messages, channels Puppeteer browser automation JSON-RPC over stdio / SSE · open protocol · dozens of servers

🔌 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
2

🔗 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"
      }
    }
  }
}
1

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
2

Add to settings.json

In the key mcpServers of the configuration file

# Editar settings.json
nano ~/.claude/settings.json
# ou via /config no REPL
3

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
3

🛠️ 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
4

📁 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
5

🔄 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.

1

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.
2

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
3

Run tests

> Instale as dependências e rode os testes

# Claude executa:
npm install
npm test
✓ health endpoint returns 200  (3ms)
4

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

💬
1. Describe
what you want
🤖
2. Claude plans
and writes the code
👀
3. You review
the generated diff
✅
4. Approve
and commit
6

🚀 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.

💡 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

✓
MCP is the standard protocol for connecting Claude to external tools
✓
mcpServers in settings.json configures any MCP server in minutes
✓
Dozens of servers official and community-maintained options available now
✓
Complete loop: describe → Claude creates → you review → approve → commit
✓
CLAUDE.md + settings.json + MCP = complete professional environment

Next Track:

Track 3 — Skills: create reusable capabilities that turn complex workflows into a single command. Claude Code’s superpower.