# MCP (Model Context Protocol) Integration

> Source: https://sukruyusufkaya.com/en/learn/claude-ustaligi/mcp-entegrasyon
> Updated: 2026-05-11T13:48:36.975Z
> Category: Claude Ustalığı
> Module: 12. Ecosystem and Certificate
**TLDR:** What is MCP and why? How to connect local/remote MCP servers to Claude. Examples with Slack, Notion, Postgres.

> **MCP = USB for LLMs**
>
> Model Context Protocol, herhangi bir LLM client'ının (Claude Code, Cursor, IDE) standart bir protokolle dış araç ve veri kaynaklarıyla konuşmasını sağlayan açık spec.

# MCP Neden Önemli?

Önceden her tool entegrasyonu özel kod gerektiriyordu. MCP'yle:

- **Bir kez yaz, her yerde çalış.** Slack MCP server'ı yazınca Claude Code, Cursor, başka client'larla aynı bağlanır.
- **Resource + tool + prompt** üç türü standartlaştırıyor.
- **Local ve remote** çalışabilir; stdio veya HTTP transport.

![MCP mimari: client (Claude Code) ↔ MCP server ↔ external service](/images/learn/claude-ustaligi/diagram-mcp.svg)

_MCP mimari görüntüsü._

### Üç tür: tools, resources, prompts

- **Tools:** Çağrılabilir fonksiyonlar (Modül 7-8 ile aynı mantık).
- **Resources:** URI ile erişilen veri kaynakları (örn. `postgres://table/users`).
- **Prompts:** Hazır prompt şablonları, kullanıcının çağırabildiği komutlar.

### Transport: stdio vs HTTP/SSE

- **stdio:** Lokal komut çalıştırma (Claude Code'un özellikle desteklediği).
- **HTTP/SSE:** Remote server (büyük ölçek için).

### Hızlı server inşası

MCP SDK (TypeScript / Python) ile basit bir server şu kadar:

```ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
const server = new McpServer({ name: "weather", version: "0.1.0" });
server.tool("get_weather", { city: z.string() }, async ({ city }) => {
  const data = await fetch(`/api/weather?city=${city}`).then(r => r.json());
  return { content: [{ type: "text", text: JSON.stringify(data) }] };
});
server.connect(stdioTransport);
```

```json
// Claude Code config (.claude/settings.json)
{
  "mcp": {
    "servers": {
      "weather": {
        "command": "node",
        "args": ["/abs/path/weather-mcp/index.js"]
      },
      "slack": {
        "command": "npx",
        "args": ["-y", "slack-mcp-server"],
        "env": { "SLACK_BOT_TOKEN": "..." }
      }
    }
  }
}
```

**Boşluk doldurma egzersizi (text):**
```text
MCP üç tür kavramla çalışır: tools, _____ ve prompts. Lokal komut için _____ transport, remote için _____ tercih edilir.
```

> ✋ Kontrol noktası: `q-1201-mc1`