★ 256 Rust MIT sse 更新 1小时前

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.

安装配置

暂未识别到可直接复制的 MCP 配置,请查看 GitHub README。后台管理员可以补充配置。

README 摘要

pctx [![Made by](https://img.shields.io/badge/MADE%20BY-Port%20of%20Context-1e40af.svg?style=for-the-badge&labelColor=0c4a6e)](https://portofcontext.com) [![NPM Version](https://img.shields.io/npm/v/%40portofcontext%2Fpctx)](https://www.npmjs.com/package/@portofcontext/pctx) [![Rust](https://img.shields.io/badge/rust-1.89%2B-green.svg)](https://www.rust-lang.org) [![Python](https://img.shields.io/pypi/v/pctx-client?color=blue)](https://pctx.readthedocs.io/en/latest/) The open source framework to connect AI agents to tools and mcp with [Code Mode](#what-is-code-mode) —   T R U S T E D   B Y   —      ## Install ```bash # 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. ```bash # 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. ```bash pip install pctx-client ``` ```python 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 - [Python SDK Quickstart and Docs](./pctx-py/README.md) - [Python API Reference](https://pctx.readthedocs.io/en/latest/) ## 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). ```bash # 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](docs/CLI.md). For configuration options, see [Configuration Guide](docs/config.md). ## 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](#what-is-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](https://www.anthropic.com/engineering/code-execution-with-mcp). **Traditional MCP flow**:...

相关 MCP

Libre Chat

Enhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, M...

★ 37614 TypeScript sse 待补充
mcp sse TypeScript

Github

GitHub's official MCP Server

★ 30243 Go sse 待补充
mcp sse Go

Fast

🚀 The fast, Pythonic way to build MCP servers and clients.

★ 25364 Python sse 待补充
mcp Python sse