
أكثر من 2500 endpoint و بحدود 1000 توكن بس.
هذا اللي سوته شركة Cloudflare بطريقة اسمها Code Mode وهي تغير شلون ال agents يستخدمون الأدوات.
شنو المشكلة؟
بروتوكول ال MCP يربط النماذج اللغوية بأدوات خارجية مثل الملفات وقواعد البيانات والأنظمة وغيرها بس بالطريقة التقليدية وصف كل tool راح يتم تحميله بال context مال النموذج من أول لحظة يشتغل بيها وكل نتيجة تمر من خلاله فكل ما تزيد ال tools يزيد الاستهلاك ويقل المكان المتبقي لل task نفسه .
شنو الحل المقترح؟
بدل ما النموذج يستدعي ال tools وحدة وحدة راح يكتب كود يستدعيها الكود يشتغل ببيئة معزولة ويرجع للنموذج بس النتيجة اللي يحتاجها.
الأرقام:
- عند شركة Cloudflare، وصف كل ال endpoints نزل من حوالي 1.17 مليون توكن إلى حوالي 1000
- عند شركة Anthropic، مثال عملي نزل من 150 ألف توكن إلى 2000، يعني وفر 98.7%
Over 2,500 Endpoints in Around 1,000 Tokens.
That is what Cloudflare achieved with an approach called Code Mode, changing how AI agents interact with tools.
What’s the problem?
The MCP protocol connects language models to external tools such as files, databases, systems, and more. However, with the traditional approach, the description of every tool is loaded into the model’s context from the very first moment it runs, and every result passes back through it. As the number of tools grows, token consumption rises and leaves less room for the actual task.
What’s the proposed solution?
Instead of calling tools one by one, the model writes code that invokes them. The code runs in an isolated environment and returns only the result the model actually needs.
The numbers:
At Cloudflare, the token cost for describing all endpoints dropped from roughly 1.17 million tokens down to around 1,000.
At Anthropic, a practical example dropped from 150,000 tokens to 2,000—a 98.7% reduction.





























