MCP Catalogs
Homepctx screenshot

pctx

by portofcontext·252·Score 49

pctx is a Rust-based framework that connects AI agents to tools and MCP servers through Code Mode for secure, token-efficient workflows.

ai-llmdeveloper-toolssecurity
29
Forks
3
Open issues
this month
Last commit
2d ago
Indexed

Overview

pctx serves as an execution layer for agentic tool calls, automatically converting agent tools and MCP servers into code that runs in secure Deno sandboxes. It provides a unified interface to multiple upstream MCP servers, handling authentication and exposing tools through Code Mode, which reduces token usage by up to 98.7% for multi-step operations by replacing sequential tool calls with code execution in isolated environments.

Try asking AI

After installing, here are 5 things you can ask your AI assistant:

you:Building AI agents with reduced token consumption through Code Mode
you:Aggregating multiple MCP servers behind a single interface
you:Secure execution of LLM-generated code in isolated environments
you:What is Code Mode?
you:How does pctx ensure security?

When to choose this

Choose pctx when you need to connect AI agents to multiple MCP services through a unified interface and want to optimize token usage by executing code in a sandbox rather than making sequential tool calls.

When NOT to choose this

Avoid pctx if you need fine-grained control over tool execution, have very specific tool requirements that can't be expressed through code, or require custom sandboxing beyond what Deno provides.

Comparable tools

nexus-rsmcp-server-exampledeno-mcp-serverserver-base

Installation

# 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

For Claude Desktop:

{
  "mcpServers": {
    "pctx": {
      "command": "pctx",
      "args": ["mcp", "start", "--stdio"]
    }
  }
}

FAQ

What is Code Mode?
Code Mode replaces sequential tool calling with code execution. Instead of an agent calling tools one at a time, it writes code that executes in a sandbox, significantly reducing token usage for multi-step operations.
How does pctx ensure security?
LLM-generated code runs in an isolated Deno sandbox with restricted access to filesystem, environment, and network (beyond allowed hosts). MCP clients are authenticated in pctx so LLMs never see authentication credentials.

On Hacker News

Recent discussion from the developer community.

Compare pctx with

GitHub →

Last updated · Auto-generated from public README + GitHub signals.