Hacker News new | ask | show | jobs
Show HN: Pctx – OSS to build efficient AI agents with Code Mode (github.com)
1 points by pmkelly4444 210 days ago
Hey HN! I built pctx, a framework that lets AI agents execute code directly instead of making tool calls to save on tokens on MCP.

I've been working on code generation in Rust for 2 years, mostly fighting with OpenAPI specs that are either missing or incorrect. MCP's self-documenting nature made this a fun project to tackle since the servers describe their own capabilities accurately. I could focus on building execution sandboxes instead of wrestling with bad specs. After seeing how Cloudflare and Anthropic's Code Mode implementations reduced tokens, I decided to build an open-source version with a focus on correctness and local-first design.

pctx prioritizes reliability (TypeScript validation pre execution) and DevEx (no dependencies, 100% local, built-in MCP auth)

Technical details: - Two locked-down Deno sandboxes: - TypeScript compilation/validation (pre-execution) - Execution with MCP network access only - Compiles to a single binary, no dependencies - Built-in TypeScript code generator and MCP auth utilities - Uses the official rmcp client/server within the execution runtime

Coming soon: - Automatic authentication of the pctx server - Python and TypeScript SDKs for using natively in agent frameworks - Anything else people want - One-click cloud deployment (see website)

GitHub: https://github.com/portofcontext/pctx Website: https://portofcontext.com

Would love your feedback on this. Thanks!