Skip to content

[Tracking] Code Mode support in MCPToolkit #144

Description

@sajeetharan

Overview

Tracking issue for adding first-class support for the "Code Mode" pattern described by Anthropic and Cloudflare:

Why

Two token-cost problems affect Cosmos DB MCP workloads especially hard:

  1. Tool-definition bloat — every tool schema sits in agent context up front. Grows worse as we ship the Q3 agent-retrieval tools on the roadmap.
  2. Intermediate-result bloat — every search / query result round-trips through the model. vector_search and hybrid_search results can easily be 10k+ rows.

Code Mode addresses both by letting agents write code that filters, transforms, and composes MCP calls in an execution environment before results reach the model.

Scope

MCPToolkit is an MCP server, not an agent host. Our role is to make Code-Mode clients efficient — not to own the code-execution sandbox (which is the client's responsibility, as the Anthropic post explicitly notes).

Sub-issues

Explicit non-goals

  • Do not build a code-execution sandbox into the server.
  • Do not break existing tools/list / tools/call behavior.

Community input welcome

Please 👍 sub-issues you care about, and comment here on prioritization or use cases we should support first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions