Pi 4 min read

MCP Connects the Tools. Codemode Coordinates the Work.

Key takeaways

  • MCP connects AI applications to tools, while the workflow needs separate design.
  • Codemode lets a model express repeated tool calls and conditional steps in code.
  • Filtering intermediate results can reduce model input without reducing external tool calls.
  • A sandbox limits code execution, but tool permissions and recovery from failures need separate controls.

Ask an AI agent to summarize unresolved support tickets, and giving it access to your support system is only the beginning. It still needs to retrieve customer details, group related issues, and decide what deserves space in the summary. That work between tool calls is the useful lens for understanding Pi, MCP, and Codemode.

A connection is only the beginning

MCP provides a common protocol for connecting AI applications to external tools and data. It gives applications a consistent way to work with tools that would otherwise have different interfaces.

The workflow still needs a plan.

Take that support request. The agent needs to:

  1. Fetch unresolved tickets.
  2. Look up the customers behind them.
  3. Group tickets about the same issue.
  4. Produce a summary for the support team.

MCP can connect the tools needed for those steps. Something still has to decide their order, which results matter, and when another lookup is necessary.

That makes “Does it support MCP?” an incomplete question when evaluating an agent. The next question is how it turns those connections into finished work.

Codemode moves repetitive steps into code

Here, Codemode means an approach in which the model writes code to compose tool calls. JavaScript loops and conditionals describe which operations to run and under what conditions.

In a conversational sequence of tool calls, the model might fetch the ticket list, inspect it, request customer details, read those results, and choose its next action. The model stays involved throughout.

With Codemode, the model can write a program that loops through the tickets, retrieves customer details, and keeps only the relevant fields. The execution environment handles that routine sequence. The model receives the prepared results.

The key decision is where judgment belongs. A predictable lookup can run in code. An ambiguous complaint or an unusual exception may still need the model to interpret it.

This approach works best when those boundaries are clear. Encoding a procedure is straightforward once you know what the procedure should be.

Less data can matter more than fewer calls

Imagine 10 support tickets, each attached to a long customer history. The final summary may need only the customer’s account tier, the ticket topic, and the latest resolution status.

Passing every history back to the model gives it a lot to read for very little useful information. Code can extract the necessary fields before returning the results.

That can reduce model input. The number of external lookups may stay exactly the same.

The distinction matters when assessing performance. Wrapping calls in a program does not automatically make the underlying systems respond faster. Rate limits still apply. A step that depends on an earlier result still has to wait.

Independent customer lookups, however, can run concurrently. Code can make that scheduling explicit.

The interesting part is the control over what reaches the model. Tool design becomes partly a question of information design: which details does the model actually need to make its next decision?

For Pi, the architecture and the permissions both matter

If Pi adopted MCP alongside a code execution environment, those choices could fit together naturally. MCP would provide the connections, and Codemode would let the model coordinate the connected tools.

An agent can adopt a connection standard while taking a different approach to how calls are organized. That architectural possibility alone establishes nothing about whether Pi has changed its position or what motivated any decision.

The implementation also needs boundaries.

A sandbox restricts the environment where code runs. The permissions of the tools available inside it remain a separate concern. Whether a program can read customer records or modify them must be decided explicitly. Execution time and the amount of returned data also need limits.

Failures add another complication. If the third step fails, the first two steps are not automatically undone. For workflows that change data, retries need to avoid applying the same change twice.

For Pi or any other agent, MCP support tells you how tools connect; the workflow tells you how work gets done. Codemode offers a way to hand predictable repetition and intermediate data processing to code. The consequential design choice is deciding exactly where the model needs to think again.

Pi MCP Codemode

Comments

    Loading comments...