TL;DR: MCP (Model Context Protocol) הוא תקן פתוח של Anthropic מ-2024 לחיבור AI agents לכלים. במקום integrations ידני, MCP מגדיר interface אחיד. שרתי MCP פופולריים: filesystem, github, postgres, slack, linear, figma. Claude Code תומך נטיב; Cursor הוסיף ב-2026.
למה MCP חשוב
לפני MCP, חיבור AI לכלי (נניח Slack) דרש: function לקבל request, תרגום ל-Slack API, עיבוד תשובה, החזרה. שוב ושוב לכל כלי. לא reusable.
MCP פתרה: תקן אחיד שכל AI יכול לדבר עם כל כלי. תוצאה: עשרות שרתי MCP פלאג-and-play.
איך זה עובד
AI Agent (Claude Code / Cursor)
↓
MCP Client (built-in)
↓ (stdio / HTTP)
MCP Server
↓
External Tool/API
ה-server "מציג" tools. ה-AI רואה רשימה, קורא ל-tool עם פרמטרים. ה-server מחזיר תוצאה. הכל JSON-RPC.
שרתי MCP מובילים
- filesystem - קריאה/כתיבה ל-files (לקודבייס גדולים מ-context)
- github - pull requests, issues, commits
- postgres - SELECT queries (safe: אסור UPDATE/DELETE)
- slack - קריאת threads
- linear / jira - ניהול tasks
- figma - design context, Figma → React
- brave-search / fetch - חיפוש באינטרנט
התקנה ב-Claude Code
// ~/.config/claude-code/config.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/project"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..." }
}
}
}
בניית MCP server מותאם
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new Server(
{ name: "internal-monitoring", version: "1.0.0" },
{ capabilities: { tools: {} } }
);
server.setRequestHandler("tools/list", async () => ({
tools: [{
name: "get_metric",
description: "Get metric value for a service",
inputSchema: {
type: "object",
properties: {
service: { type: "string" },
metric: { type: "string", enum: ["latency_p95", "error_rate"] }
},
required: ["service", "metric"]
}
}]
}));
server.setRequestHandler("tools/call", async (request) => {
const { name, arguments: args } = request.params;
if (name === "get_metric") {
const result = await fetchFromInternalMonitoring(args);
return { content: [{ type: "text", text: JSON.stringify(result) }] };
}
throw new Error("Unknown tool");
});
const transport = new StdioServerTransport();
await server.connect(transport);
שימושים אמיתיים
- דיבוג production: error log → MCP filesystem → MCP postgres → MCP slack → פתרון
- סקירת PR: MCP github → MCP filesystem → MCP linear → הגיב
- Onboarding: משימות Linear + PRs טמפלייט + Slack threads, הכל דרך MCP
אבטחה
שימו לב: MCP servers רצים עם ההרשאות שלכם. Least privilege: read-only credentials, scoped tokens, audit logs.
