Docker Just Fixed 90% of AI Coding By Releasing This

9:577 min readAI LABS12/02/2025Internet Technology · Computing/Software

Key Takeaway

Docker's new dynamic mode and Code Mode for the MCP protocol significantly enhance AI agent efficiency, security, and token management by enabling dynamic tool selection, custom tool creation, and state persistence.

Highlights

  • Docker introduced a "dynamic mode" for the MCP protocol to address scaling issues with AI agents managing numerous tools.

  • The new dynamic mode significantly reduces token usage and speeds up AI agents by dynamically selecting and providing only necessary tool definitions.

  • Docker's MCP catalog and gateway manage trusted MCP servers and autonomously provide tools, effectively solving context bloat.

  • "Code Mode" allows AI agents to write custom JavaScript tools that can call other MCP tools, enhancing security and efficiency.

  • Key benefits of Code Mode include secure sandboxed execution, improved token efficiency by abstracting multiple tool calls, and state persistence via volumes.

  • Practical examples demonstrate creating custom tools like "multi search repos" and "GitHub to Notion" to streamline workflows and manage data efficiently.

Timeline

  1. Problem with MCP Protocol Scaling

    The video begins by highlighting the evolution of the MCP protocol from handling a few local servers to hundreds with thousands of tools, creating a significant problem for AI agents. This scaling issue leads to inefficient token usage and agent performance degradation, a challenge first identified by Cloudflare and further detailed in a research paper by Claude. Docker has developed a solution, introducing a "dynamic mode" that promises to save tokens, accelerate agents, and enable new automation possibilities. This new approach aims to fix critical problems associated with the widespread use of MCPs in AI coding.

  2. Docker's Solution: Addressing Key Problems

    Docker's solution addresses three core problems: identifying trustworthy MCP servers, preventing context windows from being filled with unused tool definitions, and enabling agents to efficiently discover, configure, and use tools autonomously. The speaker emphasizes the second problem, illustrating how an agent might only use 2-3 tools out of a thousand, yet all definitions bloat the context. Anthropic also previously discussed this issue, and Docker has now implemented a practical solution. This section sets the stage for understanding the specific mechanisms Docker employs.

  3. MCP Catalog and Gateway for Trust and Management

    Docker's solution leverages its existing infrastructure, specifically the MCP catalog and MCP gateway. The MCP catalog lists verified and trusted MCP servers, making it easy for users to connect them within Docker. The MCP client (e.g., Claude code) connects only to Docker, which then centrally manages all connected MCP servers. This setup entirely solves the initial problem of trusting MCP servers by providing a curated and managed environment, ensuring that agents interact only with reliable tools.

  4. Dynamic Tool Selection and Context Window Optimization

    To enable dynamic MCP usage, Docker implemented an MCP gateway with pre-built tools that autonomously utilize servers from the catalog. This means an agent connects to just one MCP, which then intelligently determines and brings only the necessary tool definitions into the context window, preventing bloat. New tools like MCP find, add, and remove allow agents to locate and manage servers dynamically. An example demonstrates searching GitHub repos, where the LLM initially returns excessive detail, highlighting the need for further context optimization.

  5. Improving Token Efficiency with Dynamic Tool Provisioning

    This section delves into dynamic tool selection as a crucial aspect of token efficiency, referencing Claude's article on token consumption by tool definitions and intermediate results. The previous GitHub example showed how raw, detailed results unnecessarily fill the context window. Docker's MCP gateway addresses this by only providing the specific tools useful for a given session (e.g., just the 'search repo' tool instead of all 40 GitHub tools). This targeted provisioning significantly reduces the context window size, leading to substantial token savings and improved agent performance.

  6. Introducing "Code Mode" for Advanced Agent Capabilities

    The video introduces "Code Mode," a groundbreaking feature implemented by Docker, based on Cloudflare's insights into the inefficiencies of traditional MCP usage. Code Mode allows AI agents to directly write and implement code using MCP tools, providing them with "code mode tools" that operate in novel ways. Essentially, it creates a JavaScript-enabled tool capable of calling other MCP tools. This innovative approach promises to unlock new possibilities for agent automation and efficiency, moving beyond static tool definitions.

  7. Benefits of Code Mode: Security, Efficiency, and State Persistence

    Code Mode offers three significant benefits for AI agents. Firstly, it ensures complete security by running agent-generated code in a Docker sandbox, preventing any damage to the system. Secondly, it drastically improves token and tool efficiency; the model only needs to be aware of one new code mode tool, rather than all underlying tools, saving substantial context. Thirdly, it provides state persistence through volumes, allowing data to be saved between tool calls without flooding the model with large datasets, as exemplified by a data processing pipeline where only summaries or final results are sent to the model.

  8. Practical Application: Multi-Search Repos Tool

    The speaker demonstrates Code Mode by creating a "multi search repos" tool. Initially, the agent combined multiple `find GitHub repo` calls into one, but the results were returned directly to the context window. To optimize this, the speaker instructed the agent to write all results to a text file, with the model only receiving a description of the repos, not the full details. This example showcases how Code Mode can streamline repetitive tasks and manage output efficiently, although the speaker notes the current limitation of manually saving and reusing such custom tools.

  9. Practical Application: GitHub to Notion Workflow

    Building on the previous example, the speaker further demonstrates Code Mode by creating a "GitHub to Notion" tool. After connecting to the Notion MCP, the agent developed a tool to directly output GitHub search results into a Notion database, complete with fields for name, description, and date. This automation streamlines the process of organizing discovered repositories, ensuring that the model only receives minimal information (name and description) while the comprehensive data is stored externally. This highlights the power of chaining different MCPs to create complex, context-efficient workflows.

  10. Getting Started and Conclusion

    The video concludes by encouraging viewers to explore Docker's MCP catalog to discover and chain together various MCPs for creating powerful workflows, emphasizing the benefits of saving tokens and preserving AI agent performance. Getting started is straightforward: users need to update their Docker version and ensure the Docker MCP toolkit is enabled in beta features. Once enabled, the catalog and new features are active by default, allowing users to connect their clients and immediately begin leveraging these advanced capabilities.

Description

Try the Docker MCP catalog for FREE here: https://dockr.ly/44m0J5R AI coding just changed forever with the best coding AI as Claude Code gets smarter, MCP becomes dynamic, and Cursor AI workflows speed up using secure MCP tools. The future of AI coding is changing fast, and this video breaks down exactly why. With Docker’s new dynamic approach to the Model Context Protocol (MCP), agents can finally use tools the way they were meant to—lightweight, efficient, and fully autonomous. Instead of bloating your context window with hundreds of unused tools, dynamic MCP lets your agent load only what it needs, when it needs it. We explore how modern AI tools like Claude, Cursor, Docker, GitHub integrations, and even Figma MCP unlock a brand-new style of building automations. This is where vibe coding meets serious engineering: agents write clean code, execute it securely in sandboxes, persist state, and chain MCP servers together to create powerful workflows. From GitHub search pipelines to Notion database writers, your agent can now build your own custom tools on the fly—without ever touching your system directly. You’ll see real demos using GitHub MCP, dynamic tool selection, and code-mode tool creation, allowing AI to call tools inside tools while preserving your context for reasoning. If you're experimenting with AI coding tools, Docker MCP, Claude Code, or advanced automations, this is the upgrade you’ve been waiting for. Whether you're a webdev enthusiast building your first AI script or a power user connecting multiple MCP servers, this video gives you everything you need to understand how this shift will impact artificial intelligence, coding workflows, and modern agent design. And because this topic is exploding right now, it's also perfect for trending shorts, dev breakdowns, or deeper long-form tutorials. In short: dynamic MCP isn’t just an upgrade—it’s the blueprint for the future of coding with AI.

Community Posts

View all posts
Write about this video