تخطَّ إلى المحتوى

ربط عميل

يحتاج كل عميل إلى ثلاثة أشياء: الأمر (npx)، ووسائطه (-y @smsfabric/mcp-server)، ومتغير البيئة SMSFABRIC_API_KEY. يختلف الملف وصيغته فقط. تستخدم الأمثلة مفتاح اختبار؛ استبدله بمفتاحك.

  1. في Claude Desktop افتح Settings ← Developer وانقر Edit Config. يفتح ذلك الملف claude_desktop_config.json:

    • في macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • في Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. أضف الخادم تحت mcpServers:

    claude_desktop_config.json
    {
    "mcpServers": {
    "smsfabric": {
    "command": "npx",
    "args": ["-y", "@smsfabric/mcp-server"],
    "env": {
    "SMSFABRIC_API_KEY": "sf_test_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    }
    }
    }
    }
  3. أغلق Claude Desktop كليًا ثم افتحه مجددًا. تظهر أدوات SMSFabric تحت أيقونة الأدوات في مربع الرسالة.

يسأل Claude قبل كل استدعاء أداة. اختر Allow once لكل ما يرسل.

أضف الخادم بأمر واحد:

نافذة طرفيّة
claude mcp add smsfabric -e SMSFABRIC_API_KEY=sf_test_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -- npx -y @smsfabric/mcp-server

كل ما بعد -- هو الأمر الذي يشغّله Claude Code. افتراضيًا يضاف الخادم لك في المشروع الحالي فقط (--scope local)؛ استخدم --scope user ليتوفر في كل مشاريعك. تحقق منه بالأمر claude mcp list، أو اكتب /mcp في جلسة لترى حالته وأدواته.

لمشاركة الإعداد مع فريقك دون مشاركة المفتاح، أضفه بـ --scope project. يكتب Claude Code الملف .mcp.json في جذر المشروع؛ غيّر المفتاح إلى إشارة إلى متغير البيئة الخاص بكل شخص:

.mcp.json
{
"mcpServers": {
"smsfabric": {
"command": "npx",
"args": ["-y", "@smsfabric/mcp-server"],
"env": {
"SMSFABRIC_API_KEY": "${SMSFABRIC_API_KEY}"
}
}
}
}

أنشئ .cursor/mcp.json في مشروعك، أو ~/.cursor/mcp.json ليتوفر الخادم في كل المشاريع:

.cursor/mcp.json
{
"mcpServers": {
"smsfabric": {
"command": "npx",
"args": ["-y", "@smsfabric/mcp-server"],
"env": {
"SMSFABRIC_API_KEY": "sf_test_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}

افتح إعدادات Cursor، وابحث عن قسم MCP، وتأكد من أن smsfabric مفعّل ويعرض أدواته. تتوفر الأدوات للوكيل في المحادثة.

يقرأ VS Code (مع GitHub Copilot في وضع الوكيل) الملف .vscode/mcp.json. المفتاح الأعلى فيه servers وليس mcpServers. استخدم مدخلًا (input) ليطلب VS Code المفتاح مرة واحدة ويحفظه بأمان بدل كتابته في الملف:

.vscode/mcp.json
{
"inputs": [
{
"type": "promptString",
"id": "smsfabric-api-key",
"description": "SMSFabric API key (sf_test_… or sf_live_…)",
"password": true
}
],
"servers": {
"smsfabric": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@smsfabric/mcp-server"],
"env": {
"SMSFABRIC_API_KEY": "${input:smsfabric-api-key}"
}
}
}
}

انقر Start فوق إدخال الخادم في الملف، وأدخل المفتاح عند الطلب، ثم اختر الأدوات من قائمة أدوات وضع الوكيل في المحادثة.

افتح إعدادات MCP في Windsurf وعدّل الإعدادات الخام، أو افتح ~/.codeium/windsurf/mcp_config.json مباشرة:

mcp_config.json
{
"mcpServers": {
"smsfabric": {
"command": "npx",
"args": ["-y", "@smsfabric/mcp-server"],
"env": {
"SMSFABRIC_API_KEY": "sf_test_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}

حدّث قائمة الخوادم في إعدادات MCP في Windsurf ليشغّل الخادم.

أي عميل يتحدث MCP عبر stdio يستطيع تشغيل الخادم. أعطه:

الإعداد القيمة
وسيلة النقل stdio
الأمر npx (أو smsfabric-mcp بعد التثبيت العام)
الوسائط -y و@smsfabric/mcp-server (لا شيء مع smsfabric-mcp)
البيئة SMSFABRIC_API_KEY، وSMSFABRIC_BASE_URL إذا لم تستخدم الواجهة الافتراضية

يكتب الخادم رسائل البروتوكول في stdout وتشخيصاته الخاصة في stderr. ولا يدعم وسائل النقل HTTP أو SSE.