Skip to content

v0.4.0 - Codemode API

Choose a tag to compare

@eastlondoner eastlondoner released this 16 Jan 06:14
· 8 commits to main since this release

New Features

Codemode API

A new reduced-context API for AI to interact with MCP servers via JavaScript code execution. Instead of exposing dozens of tools, codemode exposes just 2 tools that dramatically reduce context usage:

  • codemode_search - Search for MCP capabilities (tools, resources, prompts, servers) across all connected backends using regex patterns
  • codemode_execute - Execute JavaScript code in a sandboxed environment with access to the mcp.* API

Available mcp.* API

// Server discovery
mcp.listServers()

// Tool operations  
mcp.listTools(serverPattern?)
mcp.callTool(server, tool, args?)

// Resource operations
mcp.listResources(serverPattern?)
mcp.listResourceTemplates(serverPattern?)
mcp.readResource(server, uri)

// Prompt operations
mcp.listPrompts(serverPattern?)
mcp.getPrompt(server, name, args?)

// Utilities
mcp.sleep(ms)
mcp.log(...args)

Security Features

  • Sandboxed VM execution with blocked dangerous globals (process, require, eval, fetch, etc.)
  • Configurable timeout (1s - 5min, default 30s)
  • MCP call limit enforcement (default 100 calls)
  • Code length limits (100KB max)

Improvements

  • Request tracking integration for waterfall UI debugging
  • Structured logging for codemode executions
  • Comprehensive test suite (52 tests)

Bug Fixes

  • Fixed timeout timer leak in sandbox execution
  • Fixed unsafe status cast for server info
  • Added missing "resource" content type handling
  • Warning logs from API operations are now captured in results

Full Changelog

v0.3.6...v0.4.0