mcp.codemode.cc github

EDU AI LAB: MCP codemode — new way how LLM can exec code inside MCP srv (Contrast & Compare 3 old ways)

We all see emerging Agentic Infra as replacement of IaC (Infrastruture as Code) — 4 principles here are universal, I select observablity as area where we work with very large, comples, interconected, timed data structures, ideal use to demonstrate pros and cons of diferent aproaches + plus every AI project need observability so may you will learn something usefull by the way too.

The four harness patterns — Agent Skills + CLI, MCP LLM, MCP codemode, ZTA

HEAD 2 HEAD — 4 principles

Blueprint detailing how an AI agent harness connects to the Arize Phoenix observability platform. It maps the end-to-end execution flow, telemetry tracking spans, and architectural characteristics across four AI Harness patterns:

01

Agent Skills + CLI

Invocation of pre-defined agent skills through a terminal interface and shell binaries.

Pros

  • Rapid Prototyping: Directly leverages standard OS binaries, custom CLI scripts, and existing terminal tools without custom protocol wrappers.
  • Standardized System Telemetry: Phoenix natively captures process exit codes, stdout/stderr streams, and low-level system logs.

Cons

  • Brittle Parsing: Reliant on parsing unstructured text output, which frequently breaks downstream reasoning loops.
  • Expanded Attack Surface: Unrestricted command-line access carries significant command injection and sandbox-escape risks.
02

MCP LLM

Standard Model Context Protocol exposing JSON-RPC tool definitions into the LLM context window.

Pros

  • Native Semantic Awareness: Tools are embedded directly into model context, allowing fluid multi-turn planning and dynamic schema discovery.
  • Fine-Grained Prompt Observability: Phoenix tracks complete prompt/response cycles, token usage, tool invocation latency, and protocol metadata.

Cons

  • Heavy Context Overhead: Loading extensive MCP tool schemas directly into prompts rapidly exhausts available context space.
  • Compounding Costs: High latency and token consumption across multi-step agent reasoning chains.
03

MCP codemode

Sandboxed Python execution on an MCP server returning processed prompt, code, and response data.

Pros

  • Token Efficiency: Processes and filters large datasets in-memory on the server, returning only curated summary data to the agent rather than raw context.
  • Granular Traceability: Phoenix records execution flow, variable states, code performance benchmarks, and runtime exceptions.

Cons

  • Runtime Sandboxing Complexity: Requires strict isolation boundaries (such as a restricted Python subset) to prevent unauthorized execution.
  • Dynamic Debugging Friction: Code execution failures require robust runtime recovery paths to prevent the harness from stalling.
04

ZTA – Zero Token Architecture

Deterministic orchestration using a Python SDK or direct API calls, reporting final status back to the agent.

Pros

  • Maximum Cost & Speed Efficiency: Payload movement occurs entirely outside the LLM context, virtually eliminating token overhead and latency bottlenecks.
  • Deterministic Policy Governance: Strict API schemas provide tight compliance, predictable auditing, and deterministic security controls.

Cons

  • Zero Adaptive Reasoning: Inflexible handling of novel edge cases; changes require programmatic code updates rather than dynamic agent adaptation.
  • Higher Engineering Burden: Demands custom SDK and API pipeline maintenance rather than generic declarative agent prompts.

Part of EDU AI LAB — “Local AI is not CHEAP!”

EDU AI LABlocalai.isnot.cheap github

Hey!!! Local AI is not CHEAP at ALL! — every AI token carries a cost. Metering and billing internal teams by the token is essential: it creates accountability against wasteful compute loops and directly amortizes the infrastructure, pipeline, and staffing investments. This lab contrasts & compares agentic-infra approaches on that shared stack.

Related project

Inspirations

MCP Explained Simply — What It Is and Why It Exists
Making Agents Useful: MCP, Tool Calling, and Sandboxed Execution
Code Mode: Why AI Agents Are Ditching Tool Calls for Code
Monty: the ultrafast Python interpreter by Agents for Agents — Samuel Colvin, Pydantic
Code Mode: Let the Code do the Talking — Sunil Pai, Cloudflare
Stop Burning LLM Tokens on Routine Tasks! Introducing Zero Token Architecture (ZTA)
ZTA: Zero Token Architecture — Kelsey Hightower | PlatformCon 2026

Code Mode design ‘deep dive’

Code Mode: Why AI Agents Are Ditching Tool Calls for Code