PTENES
Skip to content
MODULE 3.2

🚀 Your First MCPs

Hands-on: configure MCP servers in settings.json, connect Filesystem, Git, and SQLite, test that everything works, and solve the most common problems. By the end, you’ll have 3 MCPs running in your Claude Code.

6
Topics
~45
Minutes
M3.1
Prerequisite
Practical
Type
Progress:0%0 of 6
1

⚙️ Configuring settings.json

It all starts in the file ~/.claude/settings.json (global configuration) or .claude/settings.json (per project). That's where you declare each MCP server that Claude Code should start. The structure is simple: inside the key mcpServers, each entry has a name, the command to start the server, and optional settings such as arguments and environment variables.

~/.claude/settings.json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/projetos"]
    },
    "git": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-git"]
    },
    "sqlite": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-sqlite", "--db", "/tmp/test.db"]
    }
  }
}

Caution

O npx -y downloads the package on the spot if it doesn't exist. The first run may take a while. If you prefer, install it globally with npm i -g @modelcontextprotocol/server-filesystem and use the absolute path in the command.

In one sentence: settings.json is where you declare each MCP server that Claude Code will start.

2

📁 MCP Filesystem

The MCP Filesystem is the "hello world" of MCP servers. It exposes file operations as tools: read_file, write_file, list_directory, search_files, and more. The command’s final argument is the allowed root directory: the server only accesses files inside it (basic sandboxing).

In practice, Claude Code already has built-in access to files. MCP Filesystem is useful when you want to grant access to a directory outside from the project, or when you’re using another MCP client that doesn’t have native file access.

terminal
# Testar standalone (fora do Claude Code)
npx -y @modelcontextprotocol/server-filesystem /home/user/projetos

In one sentence: MCP Filesystem provides controlled access to files via tools like read_file and write_file.

3

🔀 MCP Git

The MCP Git exposes version control operations as tools: git_status, git_diff, git_commit, git_log, git_branch. The agent can version code, create branches, and make commits without you manually typing any git commands.

The configuration is identical to the others: a block in the mcpServers. No special arguments are needed; the server detects the repository from the working directory.

git_status git_diff git_commit Ready! What changed? Change details Commit everything

In one sentence: MCP Git gives the agent version control capabilities: status, diff, commit, branch, all via tools.

4

🗃️ SQLite MCP

The MCP SQLite gives the agent access to SQLite databases via SQL. The tools include read_query (SELECT), write_query (INSERT/UPDATE/DELETE), list_tables, e describe_table. You point it to the .db file, and the agent does the rest.

settings.json (sqlite)
"sqlite": {
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-sqlite", "--db", "/path/to/database.db"]
}

Tip: read-only mode

If you only want the agent to query (without modifying data), pass --read-only in the args. This prevents any INSERT/UPDATE/DELETE, protecting your data from accidental actions.

In one sentence: MCP SQLite turns the agent into a data analyst that runs SQL queries on demand.

5

🧪 Testing Tools in Practice

After configuring, you need to verify. In Claude Code, type /mcp to see the connected servers and their tools. If a server appears with "connected" status and lists its tools, it's working. If it doesn't appear, something went wrong with the config.

Test it with a simple request: “list the files in my project” (uses Filesystem), “what’s the git status?” (uses Git), “how many tables are in the database?” (uses SQLite). If the agent uses the tool and returns a result, it’s ready.

within Claude Code
# Ver servers conectados e tools disponiveis
/mcp

# Testar pedindo ao agente:
"Liste os arquivos em /home/user/projetos"
"Qual o git status deste repositorio?"
"Quantas tabelas existem no banco /tmp/test.db?"

In one sentence: use /mcp to check the connection and ask simple questions to test each tool.

6

🔧 Connection Troubleshooting

90% of MCP problems fall into one of these categories: (1) the command isn't in the PATH, (2) the JSON in settings.json is malformed, (3) an environment variable is missing, (4) the server crashes on startup (missing dependency). The debugging process is always the same: check the server's stderr.

checklist-debug.txt
MCP nao conecta? Cheque nesta ordem:
[ ] JSON valido? (virgula sobrando, aspas faltando)
[ ] Comando existe? (which npx, which node)
[ ] Pacote instalado? (npx -y baixa, mas pode falhar offline)
[ ] Variaveis de ambiente? (env no settings ou no shell)
[ ] Testar standalone: rode o comando no terminal
[ ] Logs: Claude Code mostra stderr do server nos logs

Most common mistake

Invalid JSON in settings.json. A comma after the last item, a missing quotation mark, a misplaced bracket. Use cat ~/.claude/settings.json | python3 -m json.tool to validate. If there's an error, the problem is syntax.

In one sentence: MCP debugging = validate JSON, check PATH, test the standalone server, read stderr.

🧾 Module Summary

✓
settings.json — where you declare each MCP server.
✓
Filesystem, Git, SQLite — the 3 basic MCPs to get started.
✓
/mcp — command to check the connection and tools.
✓
Debug = JSON + PATH + stderr — a roadmap for solving any problem.

Next module:

3.3 — Productivity MCPs: Slack, Calendar, Gmail, Notion.