Lesson 02 · 11 dk okuma

MCP server entegrasyonu

Model Context Protocol, local vs remote MCP, popüler server'lar, elicitation flow.

MCP (Model Context Protocol) = Claude’un dış sistemlere standart bir protokolle bağlanma yolu. Slack, Postgres, Chrome DevTools, GitHub ve daha fazlasına aynı sözleşme ile.

Tanım

MCP server bir process’tir; stdin/stdout veya HTTP üzerinden Claude’la konuşur. Sunduğu:

  • Tools — Claude’un çağırabileceği fonksiyonlar
  • Resources — okunabilir veri (DB tabloları, dosyalar)
  • Prompts — hazır prompt template’leri

Bağlama

.mcp.json (repo) veya ~/.mcp.json (kullanıcı):

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgres://..."]
    },
    "slack": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-slack"],
      "env": { "SLACK_BOT_TOKEN": "xoxb-..." }
    },
    "chrome-devtools": {
      "command": "npx",
      "args": ["-y", "chrome-devtools-mcp"]
    }
  }
}

Session başında Claude otomatik bağlanır. Tool listesinde MCP tool’ları mcp__<server>__<tool> ismiyle gözükür.

Elicitation

MCP server kullanıcıdan ek bilgi isteyebilir:

  • Sunucu request gönderir → Claude Elicitation hook’unu tetikler
  • Kullanıcı yanıt verir → ElicitationResult hook tetiklenir

Bu zincir denied/auto-approve mantığı kurmak için ideal.

En çok kullanılanlar

  • chrome-devtools — browser automation, console messages
  • postgres — DB tablo listeleme + readonly query
  • slack — kanal listele, mesaj gönder
  • github — issue/PR yönetimi
  • filesystem — sandbox dışı dosya erişimi

Tool izolasyonu

settings.json’da:

{
  "permissions": {
    "allow": ["mcp__postgres__*"],
    "deny":  ["mcp__filesystem__write*"]
  }
}

Sıradaki

Agent teams — experimental, çoklu agent koordinasyonu.