# Run agent tool calls through pctx Code Mode and unified MCP

> Put pctx between agents and tools so MCP servers and custom tools can run through a code-oriented execution layer instead of one-off tool calls.

- Skill: `agentskillexchange/run-agent-tool-calls-through-pctx-code-mode-and-unified-mcp` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/run-agent-tool-calls-through-pctx-code-mode-and-unified-mcp`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/run-agent-tool-calls-through-pctx-code-mode-and-unified-mcp/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/run-agent-tool-calls-through-pctx-code-mode-and-unified-mcp

---


# Run agent tool calls through pctx Code Mode and unified MCP

Put pctx between agents and tools so MCP servers and custom tools can run through a code-oriented execution layer instead of one-off tool calls.

## Prerequisites

pctx CLI, Python SDK or npm package, MCP-compatible client or OpenAI Agents SDK

## Installation

Install the pctx CLI and the client library that matches your agent stack:

```bash
brew install portofcontext/tap/pctx
npm i -g @portofcontext/pctx
pip install pctx-client
```

Use the Python client when building Python agents that call pctx as an HTTP service. Use the npm package or Homebrew CLI when you want pctx available as a local command for Code Mode or MCP setup. Existing Homebrew installs can be updated separately with `brew upgrade pctx`; do not treat that as the first-install path.

Basic setup:

```bash
pctx start
pctx mcp init
```

Run pctx as the boundary between your agent and registered tools/MCP servers. Keep the MCP server list explicit, review which tools are exposed through Code Mode, and avoid giving the bridge broader filesystem or network access than the workflow needs.

## Documentation

- https://github.com/portofcontext/pctx

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/run-agent-tool-calls-through-pctx-code-mode-and-unified-mcp/)

