واجهة ابني للمطوّرين والوكلاء الذكية — Ebnii API

حساب ابني (Ebnii) هو خادم MCP: مساعد مثل ChatGPT أو Claude — أو وكيلك الخاص — يستطيع، بإذنك، أن يعرض مواقعك ويقرأ ملفاتها وينشئ مواقع جديدة ويرسل تعليمات بناء وينشرها. الحماية عبر OAuth 2.1 مع PKCE، والنقل JSON-RPC 2.0 عبر HTTP.

نسخة تجريبية خاصة (private beta)
نقاط الاكتشاف والتسجيل والتوكن عامة الآن، أما خادم MCP نفسه فيُفعَّل لكل حساب على حدة أثناء التجربة؛ حساب غير مفعَّل يتلقى 404 connector_not_enabled. اطلب الوصول من صفحة الدعم واذكر «MCP»، أو راسلنا على [email protected].

الملفات القابلة للقراءة آلياً

النقاط

الطريقةالمسارالوظيفةoperationId
GET/.well-known/oauth-authorization-serverبيانات خادم التفويض (RFC 8414)getAuthorizationServerMetadata
GET/.well-known/oauth-protected-resourceبيانات المورد المحمي: من يصدر التوكنات وما الصلاحيات (RFC 9728)getProtectedResourceMetadata
POST/api/mcp-oauth/registerتسجيل عميل ديناميكي بلا سرّ (RFC 7591)registerClient
GET/mcp-oauth/authorizeصفحة الموافقة — يفتحها المستخدم في المتصفحauthorize
POST/api/mcp-oauth/tokenتبديل كود التفويض أو تجديد التوكنexchangeToken
POST/api/mcpخادم MCP للحساب: initialize · tools/list · tools/call · pingmcpCall
GET/api/mcp/toolsكتالوج الأدوات بلا توكن، بصيغة تعريفات دوالlistTools
GET/openapi.jsonمواصفة OpenAPI 3.1 لكل ما سبقgetOpenApi
GET/llms.txtفهرس الموقع للوكلاء مع إرشادات «متى تستخدم ابني»getLlmsTxt

الخادم: https://ebnii.com. مورد MCP (الـ audience في RFC 8707): https://ebnii.com/api/mcp. إصدارات البروتوكول المدعومة: 2025-11-252025-06-182025-03-26.

المصادقة: OAuth 2.1 + PKCE

عملاء عامّون فقط (بلا client secret)، PKCE بطريقة S256 إلزامي، وتسجيل العملاء ديناميكي ولا يخزّن شيئاً: الـ client_id توكن موقّع يحمل عناوين الإرجاع. كل تفويض يمرّ بموافقة صاحب الحساب على صفحة ابني.

1) الاكتشاف

curl -sS https://ebnii.com/.well-known/oauth-authorization-server
curl -sS https://ebnii.com/.well-known/oauth-protected-resource

2) تسجيل العميل

curl -sS -X POST https://ebnii.com/api/mcp-oauth/register \
  -H 'content-type: application/json' \
  -d '{"redirect_uris":["https://example.com/oauth/callback"],"client_name":"My agent"}'
# → 201 { "client_id": "…", "token_endpoint_auth_method": "none", … }

3) الموافقة (في متصفح المستخدم)

https://ebnii.com/mcp-oauth/authorize
  ?response_type=code
  &client_id=CLIENT_ID
  &redirect_uri=https://example.com/oauth/callback
  &code_challenge=BASE64URL(SHA256(code_verifier))
  &code_challenge_method=S256
  &resource=https://ebnii.com/api/mcp
  &scope=sites:read%20sites:write
  &state=RANDOM

4) التوكن

curl -sS -X POST https://ebnii.com/api/mcp-oauth/token \
  -d grant_type=authorization_code -d client_id=CLIENT_ID \
  -d code=CODE -d redirect_uri=https://example.com/oauth/callback \
  -d code_verifier=CODE_VERIFIER -d resource=https://ebnii.com/api/mcp
# → { "access_token": "…", "token_type": "Bearer", "expires_in": 3600,
#     "refresh_token": "…", "scope": "sites:read sites:write" }

التوكن صالح ساعة، وتوكن التجديد 30 يوماً (grant_type=refresh_token). فصل الموصّل من لوحة التحكم يُبطل كل التوكنات فوراً.

الصلاحيات (scopes)

الصلاحيةماذا تتيح
sites:readList the account's websites, read a site's pages and source files, and see the plan and remaining credits.
sites:writeCreate websites, send build instructions to Ebnii's agent, check build status and publish sites live. Spends the account's credits.

حقل scope في ردّ التوكن يخبرك بما مُنح فعلاً: إذا أطفأ صاحب الحساب «السماح بالكتابة» تحصل على sites:read فقط ولا تظهر أدوات الكتابة في tools/list أصلاً.

الاستدعاء

# initialize
curl -sS -X POST https://ebnii.com/api/mcp -H 'authorization: Bearer ACCESS_TOKEN' -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"my-agent","version":"1.0.0"}}}'

# tools/list
curl -sS -X POST https://ebnii.com/api/mcp -H 'authorization: Bearer ACCESS_TOKEN' -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'

# tools/call
curl -sS -X POST https://ebnii.com/api/mcp -H 'authorization: Bearer ACCESS_TOKEN' -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"list_sites","arguments":{"limit":20}}}'

طلب واحد أو دفعة حتى 20 طلباً في مصفوفة. البناء (create_site و build_site) يعود فوراً ويستمر على خوادم ابني — تابعه بـ get_build_status. الحد الأقصى لكل نداء 300 ثانية.

الأدوات

هذه القائمة تُولَّد من الكتالوج الحيّ نفسه الذي يردّ به tools/list، فلا يمكن أن تختلف عنه.

list_sitessites:readList websites
List every website on this Ebnii account, newest first: id, name, address, whether it is published, and when it last changed. Start here — every other tool takes a site_id from this list.
  • limit integer — Max sites to return, 1–100 (default 50).
get_sitesites:readGet one website
Full detail for one website: its pages, preview and live addresses, whether it has changes not yet published, and any outstanding build warnings (for example a contact form that does not deliver anywhere). Read this before suggesting changes.
  • site_id string, required — Site id from list_sites.
read_filesites:readRead a source file
Read one source file of a website. Use get_site first to see which files exist. Read-only: to CHANGE a site, describe the change to build_site rather than editing code.
  • site_id string, required — Site id from list_sites.
  • path string, required — File path exactly as listed by get_site, e.g. src/pages/Home.tsx
get_accountsites:readAccount and credits
The person's plan and remaining credit balance. Check this before starting a build so you can tell them what it will cost and whether they can afford it.
create_sitesites:writeCreate a website
Create a NEW website from a plain-language description and start building it. Describe the business and what the site needs — Ebnii's agent designs and writes it, in Arabic, right-to-left. Returns a build id immediately; poll get_build_status. Costs credits.
  • prompt string, required — What to build, in plain language. Arabic is preferred since the site will be Arabic. Include the business type, the sections wanted, and any real details (phone, address, hours) so the agent does not invent them.
  • name string — Optional name for the project. Ebnii picks one if omitted.
build_sitesites:writeChange a website
Send a build instruction to an existing website's Ebnii agent — for example 'أضف قسم آراء العملاء' or 'اربط نموذج التواصل بواتساب'. This is how a site is CHANGED; describe the outcome, not the code. Returns a build id immediately and keeps running server-side; poll get_build_status. Costs credits.
  • site_id string, required — Site id from list_sites.
  • instruction string, required — What to change, in plain language. Arabic preferred. Be specific about the outcome wanted.
get_build_statussites:writeCheck a build
Whether a build is still running, finished, or failed — with what the agent changed and what it cost. Poll this after create_site or build_site. Builds usually take 2–10 minutes.
  • site_id string, required — Site id from list_sites.
publish_sitesites:writePublish a website
Put a website online at its public address and return the link. Runs Ebnii's security check first and refuses with a reason if it fails. Ask the person before publishing — this makes the site visible to everyone.
  • site_id string, required — Site id from list_sites.
تعليمات الخادم كما يراها المساعد (initialize → instructions)

This server is an Ebnii account — an Arabic-first website builder. You can list the person's websites, create new ones from a description, send build instructions to Ebnii's own AI agent, and publish sites live. Websites are built by DESCRIBING what is wanted in plain language via build_site or create_site — you do not write the code yourself. Ebnii's agent writes it, and every site is Arabic and right-to-left by default. Builds take minutes, not seconds. build_site and create_site return a build id immediately and keep running on Ebnii's servers even after this call returns; poll get_build_status until it reports done. Never assume a build failed because the tool returned before it finished. Building costs the account's credits. Call get_account first if the person may be low, and tell them what a build will cost before you start one.

الأخطاء والحدود

كل خطأ خارج JSON-RPC يعود بصيغة JSON واحدة؛ وأخطاء JSON-RPC تعود بكائن error القياسي داخل الرد.

{ "error": { "code": "not_found", "message": "…", "hint": "…", "docs": "https://ebnii.com/docs", "status": 404 } }

{ "jsonrpc": "2.0", "id": null, "error": { "code": -32001, "message": "Authentication required" } }
HTTPالمعنى
401توكن مفقود أو منتهٍ أو مُلغى. الرأس WWW-Authenticate يشير إلى بيانات المورد المحمي.
404 connector_not_enabledالموصّل غير مفعَّل لهذا الحساب.
413الجسم أكبر من 1MB.
429تجاوز الحد: 120 طلباً في الدقيقة لكل IP، و240 في الدقيقة لكل حساب.
-32700 / -32600 / -32601 / -32602خطأ تحليل · طلب غير صالح · طريقة غير موجودة · معاملات غير صالحة (JSON-RPC).

مساعدة

سؤال أو طلب وصول أو بلاغ أمني: صفحة الدعم أو [email protected]. اقرأ أيضاً عن ابني، وشروط الاستخدام، وسياسة الخصوصية.