Codemode icon

Codemode

32

Enables Large Language Models to interact with Model Context Protocol (MCP) servers by writing and executing TypeScript/JavaScript code through a local HTTP proxy.

About

This tool implements Cloudflare's "Code Mode" workflow, fundamentally shifting how Large Language Models (LLMs) interact with external systems. Instead of directly calling multiple specialized tools, LLMs are given a single `execute_code` tool. They then write standard TypeScript/JavaScript code, leveraging their strong code-generation abilities, to make HTTP requests to a local proxy. This proxy transparently forwards these requests to your Model Context Protocol (MCP) servers, allowing LLMs to orchestrate complex operations, chain calls, and process results within a familiar programming paradigm, all while operating within a secure Deno sandbox.

Key Features

  • Executes LLM-generated TypeScript/JavaScript code in a Deno sandbox
  • Provides a local HTTP proxy for unified MCP server access
  • Enables complex tool orchestration and chaining via programmatic logic
  • Offers comprehensive tool discovery with detailed schema information
  • Ensures secure code execution with network-only access and timeouts
  • 32 GitHub stars

Use Cases

  • Allowing LLMs to perform multi-step operations on MCP servers by writing sequential code
  • Facilitating dynamic data processing and conditional logic based on MCP server outputs within an LLM workflow
  • Providing a simplified, code-centric interface for LLMs to manage and interact with various MCP-compatible services