---
title: "إعداد MCP لـ Claude Code: مسار الملف والمفتاح ومثال · DotsAgent"
description: "أضف خوادم MCP إلى Claude Code من Anthropic: موقع ملف الإعداد، والمفتاح الأعلى مستوى والتنسيق، ودعم OAuth للخوادم البعيدة، وإعداد نموذجي."
url: https://dotsagent.io/ar/mcp/clients/claude-code
---

Anthropic

# أضف خوادم MCP إلى Claude Code

يحمّل Claude Code الخوادم عبر الأمر claude mcp add أو من ملف .mcp.json في جذر المستودع.

- **macOS**: `~/.claude.json`
- **Windows**: `~/.claude.json`
- **Linux**: `~/.claude.json`
- **ملف المشروع**: `.mcp.json`
- **المفتاح الأعلى مستوى**: `mcpServers`
- **التنسيق**: json
- **OAuth للخوادم البعيدة**: 

## إعداد نموذجي

يضيف هذا المثال خادم GitHub المستضاف وPlaywright كخادم محلي، بالتنسيق الذي يتوقعه هذا العميل.

`.mcp.json`

```
{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/"
    },
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}
```

`shell`

```
claude mcp add --transport http --scope project github https://api.githubcopilot.com/mcp/
claude mcp add --scope project playwright -- npx @playwright/mcp@latest
```

## ملاحظات وسلوكيات خاصة

- تُخزَّن الإعدادات ذات النطاق المحلي، وهو الافتراضي، ونطاق المستخدم في ~/.claude.json؛ أما إعدادات نطاق المشروع فتوجد في .mcp.json.
- يجب أن يتضمن كل إدخال يحتوي على url أيضًا type مثل http؛ فوجود url وحده خطأ.
- تُوسَّع قيم الملف من ${VAR} و${VAR:-default}.
- شغّل /mcp في جلسة لتسجيل الدخول إلى خوادم OAuth. ولتطبيقات OAuth المسجّلة مسبقًا، مرّر --client-id و--client-secret و--callback-port.

[أنشئ إعدادًا لـ Claude Code →](https://dotsagent.io/ar/mcp/config#client=claude-code)

## عملاء آخرون

[Claude Desktop](https://dotsagent.io/ar/mcp/clients/claude-desktop)

[Cursor](https://dotsagent.io/ar/mcp/clients/cursor)

[VS Code (GitHub Copilot)](https://dotsagent.io/ar/mcp/clients/vscode-copilot)

[Windsurf / Devin Desktop](https://dotsagent.io/ar/mcp/clients/windsurf)

[Zed](https://dotsagent.io/ar/mcp/clients/zed)

[OpenAI Codex CLI](https://dotsagent.io/ar/mcp/clients/codex-cli)

[Gemini CLI](https://dotsagent.io/ar/mcp/clients/gemini-cli)

[ChatGPT](https://dotsagent.io/ar/mcp/clients/chatgpt)

[OpenClaw](https://dotsagent.io/ar/mcp/clients/openclaw)

[Cline](https://dotsagent.io/ar/mcp/clients/cline)

[Continue](https://dotsagent.io/ar/mcp/clients/continue)

[JetBrains AI Assistant](https://dotsagent.io/ar/mcp/clients/jetbrains-ai)

## المصادر

1. [code.claude.com](https://code.claude.com/docs/en/mcp)/docs/en/mcp

مرجع مستقل لمطوّري وكلاء الذكاء الاصطناعي. لا تربطنا أي علاقة بأي من المورّدين المذكورين هنا.

© 2026 DotsAgent · تم التحقق من المعلومات في 1 أكتوبر 2026
