1. Conduid
  2. Developer Tools
  3. Pctx
MCP server · Developer Tools

Pctx

pctx is the execution layer for agentic tool calls. It auto-converts agent tools and MCP servers into code that runs in secure sandboxes for token-efficient workflows.

85Excellent

Scored 3 days ago · breakdown

About Pctx

Pctx is an MCP server published by portofcontext in the Developer Tools category: pctx is the execution layer for agentic tool calls. It auto-converts agent tools and MCP servers into code that runs in secure sandboxes for token-efficient workflows.

The repository has 282 stars and 39 forks, with the last commit 5 days ago. Recent commit activity is the strongest signal that reported issues will get attention.

Install

From source
git clone https://github.com/portofcontext/pctx

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Pctx

Powered by Claude · Grounded in docs

I know everything about Pctx. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 4 days ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • ✓Tests presentA test suite exists in the repository.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v0.7.7v0.7.7 - 2026-10-10 · 10 Oct 2026Release Notes Added Changed Fixed MCP tool results with `isError: true` now include the server's error content in the error message instead of a bare `Tool call "<name>" failed`. Install pctx 0.7.7 Install prebuilt binaries via shell…
v0.7.6v0.7.6 - 2026-10-05 · 5 Oct 2026Release Notes Added Changed Fixed Hardened the code execution sandbox. Install pctx 0.7.6 Install prebuilt binaries via shell script curl --proto '=https' --tlsv1.2 -LsSf…
pctx_type_check_runtime-v0.2.1pctx_type_check_runtime v0.2.1 · 5 Oct 2026Chore <csr-id-71ad4a4403ff0ffd7bf2d9086a34bc46f0507816/> use noop module loader Commit Statistics <csr-read-only-do-not-edit/> 2 commits contributed to the release. 1 commit was understood as conventional. 0 issues like '(#ID)' were seen…
pctx_type_check_runtime-v0.2.0pctx_type_check_runtime v0.2.0 · 5 Oct 2026Documentation <csr-id-78beae77d3ad3eb05eabaa55ceaafffd7514acd7/> crate changelog notes for deno stack upgrade Changed Updates to `deno_core` 0.412 / `deno_ast` 0.53 (V8 150), matching `pctx_executor` 0.3 so both resolve a single V8. Commit…
v0.7.5v0.7.5 - 2026-10-05 · 5 Oct 2026Release Notes Added Changed Updated the Deno runtime stack to `deno_core 0.412`, `deno_ast 0.53.3`, and V8 150, moving Temporal support to `temporal_rs 0.2`. Fixed `pctx_executor`'s unit tests (including the concurrent V8 isolate stress…

README

Made by

NPM Version Rust Python

The open source framework to connect AI agents to tools and mcp with Code Mode

Install

# Homebrew
brew install portofcontext/tap/pctx

# cURL
curl --proto '=https' --tlsv1.2 -LsSf https://raw.githubusercontent.com/portofcontext/pctx/main/install.sh | sh

# npm
npm i -g @portofcontext/pctx

Core Functionality

pctx can be run as a stateless HTTP server for Code Mode sessions or as a unified MCP server that exposes Code Mode functionality for registered upstream MCP servers.

# Start Code Mode for Python SDK
pctx start

# Start Code Mode as a unified MCP server
pctx mcp init
pctx mcp dev

Python SDK

Use the Python SDK if building agents in Python and want to run Code Mode with custom tools and/or MCP servers. The Python SDK is an HTTP client to the pctx server.

pip install pctx-client
from pctx_client import Pctx, tool
from agents import Agent # Use any Agent SDK
from agents.run import Runner # This example is OpenAI Agents SDK

@tool
def get_weather(city: str) -> str:
    """Get weather information for a given city."""
    return f"It's always sunny in {city}!"

pctx = Pctx(tools=[get_weather]) # or with mcp: servers=[your_mcp]

tools = pctx.openai_agents_tools() # Run Code Mode with any Agent SDK
agent = Agent(
    name="GreatCoder",
    model="litellm/openrouter/openai/gpt-oss-120b",
    instructions="You run code to complete complex tasks.",
    tools=tools,
)

Links

Node SDK

Coming soon

Unified MCP

Use the unified MCP to run Code Mode with MCP servers and want to persist the authentication connections and you do not need to use agent tools (non-mcp tools).

# Initialize config for upstream mcp connections
pctx mcp init

# Add HTTP or stdio MCP servers
pctx mcp add stripe https://mcp.stripe.com
pctx mcp add memory --command "npx -y @modelcontextprotocol/server-memory"

# Start as HTTP server (dev mode with UI)
pctx mcp dev

# Or start as stdio MCP server
pctx mcp start --stdio

For complete CLI documentation, see CLI.md. For configuration options, see Configuration Guide.

What is pctx?

pctx sits between AI agents and MCP servers. It aggregates multiple upstream MCP servers, handles authentication, and exposes tools through a unified Code Mode interface. Instead of agents managing connections to individual MCP servers, they connect once to pctx.

What is Code Mode?

Code mode replaces sequential tool calling with code execution. Rather than an agent calling tools one at a time and passing results through its context window, it writes code that executes in a sandbox. Read Anthropic's overview here.

Traditional MCP flow:

  1. Agent calls getSheet(id)
  2. Server returns 1000 rows → agent's context
  3. Agent calls filterRows(criteria)
  4. Server returns 50 rows → agent's context

With Code Mode:

const sheet = await gdrive.getSheet({ sheetId: "abc" });
const orders = sheet.filter((row) => row.status === "pending");
console.log(`Found ${orders.length} orders`);

Result: 98.7% reduction in tokens (150k → 2k) for this multi-step operation.

Features

  • Code Mode interface: Tools exposed as code functions for efficient agent interaction. See Code Mode Guide.
  • Upstream MCP server aggregation: Connect to multiple MCP servers through a single interface, with persistent upstream sessions across execute_typescript calls. See Upstream MCP Servers Guide.
  • Simple config with CLI: Create the pctx.json config with a simple CLI. pctx.json manages auth, upstream MCPs, logging, and more. See Config Guide.
  • Secure authentication: Source secrets from environment variables, system keychain, and external commands. See Authentication Section in the CLI configuration docs for more details.

Security

  • LLM generated code runs in an isolated Deno sandbox that can only access the network hosts specified in the configuration file.
  • No filesystem, environment, network (beyond allowed hosts), or system access.
  • MCP clients are authenticated in pctx. LLMs can never see your auth.

Update

Depending on the installation method (Homebrew/npm/cURL) the update method is different. Run which pctx if you are unsure what you used to install it.

# Homebrew update
brew upgrade pctx

# cURL update
pctx-update

# npm update
npm upgrade -g @portofcontext/pctx

Develop

  • For core dev: install rust and jump into crates/
  • Client SDK dev: find the README in the SDK

Learn More

README fetched from the repository 4 days ago. The original is authoritative.

Questions

About Pctx

How do I install Pctx?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Pctx safe to use with an AI agent?

Its trust score is 85 out of 100 (excellent). It passes 5 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Pctx still maintained?

Yes — the latest release is v0.7.7 (10 Oct 2026), and the last commit was 5 days ago. The repository has 282 stars and 21 open issues.