Code librariesReviewed · universal-tool-calling-protocol

UTCP Code Mode

UTCP Code Mode lets AI agent developers combine tool calls in code, but its Python safeguards do not match the documentation. It includes TypeScript and Python libraries, a shell CLI and an MCP bridge, with tool discovery and generated interface descriptions.

Researched 13 Nov 2026

In short.

UTCP Code Mode is a toolkit for AI agent developers who want to combine tool calls in code, but its Python safeguards do not match the documentation. The TypeScript client uses isolated-vm, while the supplied Python implementation executes restricted code in threads within the host process despite claims of separate processes and forcible termination. Other adoption issues include Node.js requirements that conflict with package declarations, inconsistent API documentation and error results that wrappers can label successful. Combining operations could reduce intermediate data sent to a model, but actual speed, savings and security are not established. Nothing was executed.

Researched and written by an AI model and checked by a second AI model. How it works

Scope is the complete supplied default-branch repository snapshot at revision e5fdc319bfae1ceec57e7bce37048337635ffb51: TypeScript and Python libraries, CLI and MCP bridge, documentation, skill file, tests, development scripts, configurations, manifests, lockfiles and ignore files, together with the root MPL-2.0 license and CLI MIT notice. Linked pages, benchmark repositories, dependency implementations and published package contents are excluded. No code, installations, examples, tests, OAuth flows or external API calls were executed. Runtime compatibility, security, integration behavior, performance and operating costs remain unverified.

The overview

identity

UTCP Code Mode extends the Universal Tool Calling Protocol so registered tools can be called as functions from generated code. The repository contains the @utcp/code-mode TypeScript library, the code-mode Python package imported as utcp_code_mode, @utcp/code-mode-cli and @utcp/code-mode-mcp. Original source: [https://github.com/universal-tool-calling-protocol/code-mode].

The CLI serves agents with shell access; the MCP bridge exposes the execution engine to Model Context Protocol clients. These integrations connect an existing agent to tools; they do not supply an AI model.

assessment

The clearest fit is controlled automation where an agent needs several related API operations and can return a compact result. The source provides concrete execution, discovery, logging and integration code, but installation and production reliability remain unverified.

The TypeScript implementation includes isolate memory limits and cleanup logic. The Python implementation requires more caution: its README describes separate-process execution, while its source uses a thread executor in the host process. The Python README also expressly limits suitability to cooperative generated code and excludes hostile code and production multi-tenant use.

users

Developers embedding tool orchestration into an application can use the libraries directly. Teams whose agents already have shell access can use the CLI; users of MCP clients can configure the bridge. Python developers have a separate client implementation with different execution behavior.

Beginners can delegate configuration drafting to an agent, as the CLI documentation suggests, but still need an appropriate runtime, service credentials and an understanding of what the registered tools can change. Interactive OAuth also requires the user to authorize access in a browser.

capabilities

Both libraries expose registered tools through names such as manual.tool, generate interface descriptions from tool schemas, provide interface lookup and collect execution output. This supports combining service results, filtering records and returning summaries within one code execution.

The CLI implements search, list, info, keys, run, login and validate commands. Its bundled utcp-cli skill documents configuration and usage. HTTP, MCP, CLI, text, file and dotenv plugins are imported by the CLI and bridge.

The MCP implementation exposes register_manual, deregister_manual, search_tools, list_tools, get_required_keys_for_tool, tools_info and call_tool_chain. It can forward native MCP content blocks alongside a text response containing other results and logs.

Using it

requirements

The JavaScript package manifests declare Node.js 18 or newer, but their lockfiles resolve isolated-vm versions declaring Node.js 22 or newer. Node.js 22 is therefore the minimum that satisfies those captured dependency declarations; successful installation on a particular system is unverified. isolated-vm is a native addon, and the CLI README identifies Windows C++ build tooling as a prerequisite when needed.

Direct TypeScript integration requires the @utcp/sdk and isolated-vm peer dependencies plus the transport plugins your tools use. Plugins register through imports. Python declares Python 3.10 or newer, pydantic, utcp, typing-extensions and RestrictedPython; its documentation calls for additional MCP or CLI plugins for those transports.

External services may require accounts, tokens, network access or local executables. For example, the documented GitHub MCP configuration uses Docker. Requirements depend on the tools you register.

mechanism

A UTCP manual describes a tool provider and its available operations. The client registers these descriptions, makes tools discoverable and constructs callable functions for execution. Search narrows the descriptions shown to an agent; the execution context itself receives all registered tools.

The TypeScript client creates an isolated V8 context and bridges tool calls back to the host. Calls block from the snippet's perspective while the host performs asynchronous work; adding await does not itself make these calls parallel. The source API is callToolChain(code, timeout, memoryLimit), with defaults of 30000 milliseconds and 128 MB, returning result and logs.

Despite the TypeScript execution label, supplied snippets go directly to V8 compileScript without TypeScript transpilation. JavaScript-compatible syntax is the supported path visible in this source; generated interface text does not type-check execution.

Python compiles a normal function through RestrictedPython and runs it in a ThreadPoolExecutor. The outer call_tool_chain is asynchronous, but tools inside the snippet are synchronous functions. Its timeout argument is in seconds, defaulting to 30.

setup

For direct JavaScript integration, install the engine and its peer dependencies, import the required transport plugin, create CodeModeUtcpClient and register a manual. For Python, the documented installation is pip install code-mode; manual dictionaries are converted through CallTemplateSerializer before registration.

The documented CLI entry is npx -y @utcp/code-mode-cli prompt. Configure providers in .utcp_config.json, validate the configuration, discover the actual tool interfaces and supply code through run. --config selects another configuration file. Keep the working directory consistent during OAuth: login state and token metadata are stored there, and the login command resolves its dotenv path against that directory.

For MCP, configure the client to launch npx @utcp/code-mode-mcp and set UTCP_CONFIG_FILE to the configuration path. For reproducibility, verify and pin the package version instead of assuming an unpinned download matches this repository snapshot.

The bridge's development registration script builds both packages, replaces the installed engine's dist directory with the local build and removes and re-adds a user-scoped Claude Code MCP entry. The unregister script reinstalls the registry engine. These scripts make persistent development-environment changes.

example

The CLI documentation illustrates an Open Library provider loaded from its OpenAPI description. After confirming the discovered tool name and inputs, the example snippet is: const r = await openlibrary.read_search_json_search_json_get({ q: 'tolkien', limit: 3 }); return (r.docs || []).map(b => b.title);

Passed to the CLI run command, this requests matching books and returns their title fields instead of the complete service response. This is an unexecuted illustration; actual titles, service availability and the currently generated tool name are unknown.

Assessment & evidence

limitations

Python's asyncio timeout does not forcibly terminate a running thread, and the executor context waits for running work during shutdown. The documented process termination is absent from this implementation. README examples using await inside Python snippets also conflict with the synchronous function wrapper.

The TypeScript library README describes an options object, consoleOutput and getToolInterfaces, while the implementation uses positional timeout and memory arguments, logs and getAllToolsTypeScriptInterfaces. The bridge README names tool_info, but its implementation registers tools_info. Follow the source contract for the exact installed version.

Caught execution errors can return result: null with error logs. Both wrappers can then report success: true because the engine returned normally. A null result can also be legitimate, so neither that value nor the wrapper's success flag alone establishes successful execution.

The TypeScript timeout releases the isolate's wait through a promise race; it does not cancel the underlying host request or reverse completed actions. Consequently, a timed-out write may still complete, and retrying it could duplicate changes. The bridge's default 200000-character text truncation also does not cap separately forwarded MCP content blocks.

The bundled CLI transport can execute arbitrary local commands through registered manuals. Sandbox restrictions therefore do not describe the permissions of connected tools. OAuth access tokens are written to .env, with refresh tokens and pending login information stored in local JSON files. No encryption or explicit restrictive file modes are shown. Redirect URLs require matching OAuth state, while bare authorization codes bypass that comparison; automatic refresh is not implemented in the supplied OAuth module.

CLI automation needs additional care: prompt and help print plain text despite the documented all-JSON claim. Validation reports valid: false without explicitly setting a failing exit status. The configuration reader falls back to an empty object after missing or malformed input, so an empty configuration can mask the absence of intended providers.

reasoning

The potential benefit follows from keeping intermediate processing in code: an agent can request several operations and receive only the final calculation or summary. This could reduce model interactions and intermediate context, depending on how the surrounding agent is built.

One code execution still performs the underlying service calls, and the supplied bridge functions block sequentially. Fewer model turns therefore do not establish fewer API requests or faster elapsed execution. The architecture is most promising when intermediate data processing is substantial; its advantage for short tasks remains unknown.

alternatives

Within this repository, choose direct library integration when your application owns execution, the CLI when the agent works through a shell, or the MCP bridge when the client requires MCP tools. The wrappers use the published TypeScript engine dependency; the Python package has a separate implementation and should not be assumed equivalent.

For an agent using only a few operations, retaining individual tool calls or a fixed application function is a reasonable comparison because it avoids generating an execution program for each task. The supplied evidence provides no measured comparison establishing which approach wins for a particular workload. Linked research and competing implementations are not assessed.

evidence

Implementation evidence includes both execution clients, the CLI configuration, naming, OAuth and validation modules, and the MCP server. Package manifests and lockfiles establish declared dependencies and their inconsistencies; README claims are distinguishable from these implementation details.

The TypeScript test source covers direct-call fixtures, result handling, logging, timeouts, hung tools and memory-limit failures. Python tests use a mocked base client and cover interfaces, execution, imports and error handling. These are test definitions without execution results. Passing builds, live authentication, external integrations, hostile-code resistance and performance remain unverified.

Access & freshness

costs

The supplied material specifies no subscription or hosted execution price. Total operating cost is unknown and depends on local compute, the agent's model provider and connected services. The README offers enterprise consultation without a stated price.

The README claims annual savings based on an external Python benchmark and assumed usage and token prices. That study's contents are outside the supplied scope. These claims do not establish savings, latency or token use for this implementation or your workload.

rights

The repository license and TypeScript and Python package declarations specify MPL-2.0. It permits use and modification, including commercial use, with redistribution obligations for covered source files and notices. Distribution of covered executable software also requires making its covered source available and explaining how recipients can obtain it.

The CLI directory has a specific MIT license permitting reuse and redistribution subject to retaining its copyright and permission notice. The MCP bridge's package metadata declares MIT, but no separate bridge license text is supplied alongside the repository-level MPL license; confirm the applicable terms before redistributing that component. Dependencies retain their own licenses. The supplied licenses disclaim warranties.

freshness

The supplied repository snapshot is revision e5fdc319bfae1ceec57e7bce37048337635ffb51, captured on 13 November 2026 at 23:42:40 UTC. This is the capture time, not an established release or last-maintenance date. Frozen source: [https://github.com/universal-tool-calling-protocol/code-mode/tree/e5fdc319bfae1ceec57e7bce37048337635ffb51].

Version identifiers differ within the snapshot. The TypeScript manifest says 1.2.13 while its lockfile says 1.2.12. The CLI manifest says 0.1.2 and names the utcp executable, while its lockfile says 0.1.0 and names code-mode. Python's project metadata says 1.1.0 while __version__ says 1.0.0. The bridge manifest says 1.2.1 while its MCP server identifies itself as 1.0.0. Current registry releases and subsequent changes are unknown.

actions

Start with a trusted provider offering read-only operations and a pinned package version. Verify its runtime requirements and actual API signatures. After configuration validation, inspect the valid field, expected provider names and tool counts; after execution, inspect logs as well as the returned result.

Before enabling writes, establish service-level timeouts, duplicate-request handling and recovery behavior. Protect local credential files, keep OAuth commands in the same working directory and prefer the full redirect URL so state can be checked. Restrict the registered tools to the permissions the task needs.

For Python, resolve the execution and timeout discrepancies before relying on isolation or cancellation. For either language, compare a representative workflow with individual tool calls and measure correctness, latency, model usage and service charges. Those outcomes are currently unknown.

Evidence for this report

.gitignoreselected · checked 2026-11-13
LICENSEnotice · checked 2026-11-13
README.mdselected · checked 2026-11-13
code-mode-cli/.gitignoreselected · checked 2026-11-13
code-mode-cli/LICENSEnotice · checked 2026-11-13
code-mode-cli/README.mdselected · checked 2026-11-13
code-mode-cli/SKILL.mdselected · checked 2026-11-13
code-mode-cli/index.tsselected · checked 2026-11-13
code-mode-cli/package-lock.jsonselected · checked 2026-11-13
code-mode-cli/package.jsonselected · checked 2026-11-13
code-mode-cli/src/config.tsselected · checked 2026-11-13
code-mode-cli/src/names.tsselected · checked 2026-11-13
code-mode-cli/src/oauth.tsselected · checked 2026-11-13
code-mode-cli/src/validate.tsselected · checked 2026-11-13
code-mode-cli/tsconfig.jsonselected · checked 2026-11-13
code-mode-mcp/.gitignoreselected · checked 2026-11-13
code-mode-mcp/.utcp_config.jsonselected · checked 2026-11-13
code-mode-mcp/README.mdselected · checked 2026-11-13
code-mode-mcp/example.envselected · checked 2026-11-13
code-mode-mcp/index.tsselected · checked 2026-11-13
code-mode-mcp/package-lock.jsonselected · checked 2026-11-13
code-mode-mcp/package.jsonselected · checked 2026-11-13
code-mode-mcp/scripts/dev-register.mjsselected · checked 2026-11-13
code-mode-mcp/scripts/dev-unregister.mjsselected · checked 2026-11-13
code-mode-mcp/tsconfig.jsonselected · checked 2026-11-13
python-library/.gitignoreselected · checked 2026-11-13
python-library/README.mdselected · checked 2026-11-13
python-library/pyproject.tomlselected · checked 2026-11-13
python-library/src/utcp_code_mode/__init__.pyselected · checked 2026-11-13
typescript-library/.gitignoreselected · checked 2026-11-13
typescript-library/README.mdselected · checked 2026-11-13
typescript-library/jest.config.cjsselected · checked 2026-11-13
typescript-library/package-lock.jsonselected · checked 2026-11-13
typescript-library/package.jsonselected · checked 2026-11-13
typescript-library/src/index.tsselected · checked 2026-11-13
typescript-library/tsconfig.jsonselected · checked 2026-11-13
typescript-library/tsup.config.tsselected · checked 2026-11-13