واجهة ابني للمطوّرين والوكلاء الذكية — Ebnii API
حساب ابني (Ebnii) هو خادم MCP: مساعد مثل ChatGPT أو Claude — أو وكيلك الخاص — يستطيع، بإذنك، أن يعرض مواقعك ويقرأ ملفاتها وينشئ مواقع جديدة ويرسل تعليمات بناء وينشرها. الحماية عبر OAuth 2.1 مع PKCE، والنقل JSON-RPC 2.0 عبر HTTP.
404 connector_not_enabled. اطلب الوصول من صفحة الدعم واذكر «MCP»، أو راسلنا على [email protected].الملفات القابلة للقراءة آلياً
- https://ebnii.com/openapi.json — مواصفة OpenAPI 3.1 بكل العمليات والمخططات والصلاحيات.
- https://ebnii.com/api/mcp/tools — كتالوج الأدوات بصيغة تعريفات دوال (function calling) بلا توكن.
- https://ebnii.com/llms.txt — فهرس الصفحات وإرشادات متى تستخدم ابني.
- /.well-known/oauth-authorization-server و /.well-known/oauth-protected-resource.
- أي صفحة عامة على ebnii.com تُقرأ كـ Markdown: أرسل
Accept: text/markdown؛ صفحة غير موجودة تعيد 404 بنص Markdown أيضاً. - /sitemap.xml و /robots.txt.
النقاط
| الطريقة | المسار | الوظيفة | 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 · ping | mcpCall |
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-resource2) تسجيل العميل
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=RANDOM4) التوكن
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:read | List the account's websites, read a site's pages and source files, and see the plan and remaining credits. |
sites:write | Create 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 websiteslimitinteger — Max sites to return, 1–100 (default 50).
get_sitesites:readGet one websitesite_idstring, required — Site id from list_sites.
read_filesites:readRead a source filesite_idstring, required — Site id from list_sites.pathstring, required — File path exactly as listed by get_site, e.g. src/pages/Home.tsx
get_accountsites:readAccount and creditscreate_sitesites:writeCreate a websitepromptstring, 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.namestring — Optional name for the project. Ebnii picks one if omitted.
build_sitesites:writeChange a websitesite_idstring, required — Site id from list_sites.instructionstring, required — What to change, in plain language. Arabic preferred. Be specific about the outcome wanted.
get_build_statussites:writeCheck a buildsite_idstring, required — Site id from list_sites.
publish_sitesites:writePublish a websitesite_idstring, 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]. اقرأ أيضاً عن ابني، وشروط الاستخدام، وسياسة الخصوصية.