salla-custom-code-mcp
This server manages a Salla store's custom CSS and JavaScript in the theme editor's Advanced customization section.
Read the store's current custom CSS for a theme version.
Replace the entire custom CSS with a complete new stylesheet, backed up locally first.
Read the store's current custom JavaScript for a theme version.
Replace the entire custom JavaScript with a complete new script, backed up locally first.
Turn custom JavaScript on or off without changing the code.
Target a specific theme version or use the configured default, with merchant confirmation required before changes.
Provides tools for managing a Salla store's custom CSS and JavaScript in the theme editor's advanced customization, including reading, replacing, backing up, verifying, and toggling custom code via Salla admin endpoints.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@salla-custom-code-mcp show me the current custom CSS on my Salla store"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
salla-custom-code-mcp
خادم MCP محلي صغير يضيف أدوات CSS و JavaScript المخصص لمتجر سلة، أي ما تجده في محرر الثيم ← التخصيص المتقدم. هذه الأدوات غير موجودة في MCP سلة الرسمي (mcp.salla.dev).
A tiny local MCP server that adds custom CSS / JS tools for a Salla store (theme editor → Advanced customization), which Salla's hosted MCP does not expose.
الأدوات
الأداة | الوظيفة |
| قراءة الـ CSS المخصص |
| استبدال الـ CSS كاملاً (مع نسخة احتياطية قبل الحفظ، وتحقق بعده) |
| قراءة الـ JavaScript المخصص |
| استبدال الـ JavaScript كاملاً (مع نسخة احتياطية وتحقق) |
| تشغيل الـ JavaScript المخصص أو إيقافه |
Related MCP server: Chrome DevTools MCP Server
طريقة العمل
ليس في API سلة العام endpoint للكود المخصص. لذلك يستدعي الخادم نفس الـ endpoints التي تستخدمها لوحة التاجر:
api.salla.dev/admin/v2/design/custom/cssapi.salla.dev/admin/v2/design/custom/jsapi.salla.dev/admin/v2/design/custom/js/toggle
الطلبات تُرسَل من داخل تبويب
s.salla.saمسجّل الدخول في ملف Chromium مخصص، عن طريق Chrome DevTools Protocol. رمز الدخول لا يخرج من المتصفح ولا يُحفظ في أي ملف.إذا لم يكن المتصفح يعمل، يفتحه الخادم تلقائياً.
حماية من الخطأ: إذا كان الحساب المسجّل لمتجر غير
SALLA_STORE_ID، يرفض الخادم الطلب ولا يغيّر شيئاً.قبل كل حفظ تُنسخ النسخة السابقة إلى
~/.config/salla-custom-code/backups/<profile>/.
⚠️ هذه endpoints داخلية وغير موثّقة، وقد تغيّرها سلة في أي وقت. الحفظ يظهر مباشرة في المتجر إذا كانت النسخة منشورة.
المتطلبات
Node.js 22 أو أحدث (يحتاج
fetchوWebSocketالمدمجين).Chromium أو Chrome. الافتراضي هو Chromium الخاص بـ Playwright في
~/.cache/ms-playwright/chromium-1248/chrome-linux64/chrome، ويمكن تغييره بـSALLA_CHROME.
التثبيت
git clone https://github.com/dfsf2151/salla-custom-code-mcp.git
cd salla-custom-code-mcp
npm installسجّله في Claude Code:
claude mcp add salla-mystore-code -s user \
-e SALLA_STORE_ID=<رقم المتجر> \
-e SALLA_VERSION_ID=<رقم نسخة الثيم> \
-e SALLA_PROFILE=mystore \
-- node /path/to/salla-custom-code-mcp/server.mjsرقم المتجر: تجده في
store_context_getمن MCP سلة الرسمي.رقم نسخة الثيم: تجده في
theme_versions_list، وهو النسخة التي عليهاis_default.
تسجيل الدخول أول مرة
عند أول استدعاء لأي أداة، يفتح الخادم نافذة Chromium (ملفها
~/.config/salla-custom-code/profile-<SALLA_PROFILE>).سجّل الدخول فيها إلى لوحة سلة بحساب المتجر.
اترك النافذة مفتوحة.
جلسة اللوحة تنتهي بعد أسبوعين تقريباً. عندها سجّل الدخول مرة أخرى في نفس النافذة.
متغيرات البيئة
المتغير | الافتراضي | الوصف |
| — | رقم المتجر المسموح به (حماية) |
| — | نسخة الثيم الافتراضية |
|
| اسم ملف المتصفح والنسخ الاحتياطية، مفيد لأكثر من متجر |
|
| منفذ DevTools. استخدم منفذاً مختلفاً لكل متجر |
| Chromium الخاص بـ Playwright | مسار المتصفح |
سكربتات الاختبار
# قراءة فقط
SALLA_STORE_ID=... SALLA_VERSION_ID=... node scripts/smoke.mjs
# اختبار الحفظ بدون تغيير: يقرأ الـ CSS ويحفظه كما هو
SALLA_STORE_ID=... SALLA_VERSION_ID=... node scripts/noop-save.mjsscripts/cdp.mjs أداة تصحيح لمراقبة طلبات اللوحة: navigate URL أو eval JS أو watch SECONDS أو shot FILE.png.
scripts/upload-images.mjs يرفع صوراً من جهازك إلى منتج، عن طريق جلسة اللوحة نفسها. أول صورة تصبح الصورة الرئيسية، وإذا كان للمنتج صور من قبل، فاستخدم SORT_OFFSET حتى تأتي الصور الجديدة بعدها:
node scripts/upload-images.mjs <رقم المنتج> "<النص البديل>" main.webp 2.webp 3.webpAvailable Tools
5 toolscustom_css_getC
Read the store's custom CSS (theme editor → Advanced customization → CSS) for store 123456789.
Inputs: version_id.
custom_css_updateA
Replace the store's entire custom CSS. Changes are live on the published version as soon as they are saved. Always read the current CSS first and pass the full new stylesheet (not a fragment). The previous CSS is backed up locally before saving. Show the merchant the change and get their OK before calling.
Inputs: css (required), version_id.
custom_js_getA
Read the store's custom JavaScript for store 123456789. Whether it is enabled is the version's custom_js_enabled flag in the Salla MCP's theme_versions_list.
Inputs: version_id.
custom_js_toggleA
Turn the store's custom JavaScript on or off without changing the code. Get the merchant's OK first.
Inputs: enabled (required), version_id.
custom_js_updateA
Replace the store's entire custom JavaScript. Runs on every storefront page once saved (if custom JS is enabled). Always read the current JS first and pass the full new script. The previous JS is backed up locally before saving. Show the merchant the change and get their OK before calling.
Inputs: js (required), version_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a clearly distinct resource and action: CSS read/update, JS read/update, and JS enable/disable. There is no meaningful overlap between custom_css_update and custom_js_toggle or any other pair.
All tools follow the same snake_case pattern custom_{css|js}_{get|update|toggle}. The convention is predictable and easy to map to the underlying resources.
Five tools is well-scoped for managing custom CSS and JavaScript. Each tool earns its place by covering a distinct operation without unnecessary surface area.
The surface covers reading and replacing both CSS and JS, plus toggling JS, which is the core workflow. Minor gaps exist around backup/restore visibility or an explicit reset operation, but agents can work around them by passing empty or full content.
Maintenance
Related MCP Connectors
Run your Salla store from any AI app: orders, sales, stock, products, prices and store design.
Lets your AI build and edit websites in Xodia, a visual website builder for real code (Vite, React, Tailwind CSS or plain HTML in your own git repo): read and write site files, create pages and CMS collections, run typecheck, design and link checks, take screenshots, manage forms and translations, and pick up change requests the user sends from the visual editor. Sign in once with your Xodia account (OAuth). Free plan, no card needed. Setup: https://xodia.ai/ai/mcp
Hosted Shopify MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Read your Kukie.io sites, make previewed changes to banners and settings, and start scans.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Chromium browser instances through Puppeteer for inspecting dev builds, capturing screenshots, and automating UI interactions. Features permission-gated tools for secure browser navigation, DOM manipulation, and JavaScript evaluation.10 npm1MIT
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive Chrome browser debugging capabilities including DOM inspection, network monitoring, console logs, JavaScript execution, breakpoint debugging, and screenshot capture for AI-assisted frontend development.5MIT
- FlicenseAqualityDmaintenanceEnables style verification and CSS inspection through Chrome DevTools Protocol, using JSON specs to check computed styles, find elements, and interact with pages.12-
- FlicenseNot gradedqualityBmaintenanceEnables browser automation through a persistent Chrome instance exposed via HTTP, including navigation, screenshots, clicks, typing, multi-tab and multi-profile management, proxy switching, login state export, and AI-driven task execution.-