Repository navigation
Description
Problem
The extension library can run an MCP server from an npm package inside the task container ("Local package (npm)"), but not one published on PyPI and normally started with uvx. Many MCP servers are Python-only, so they cannot be added at all. A user asked for a custom Dockerfile for the agent image specifically to add such a tool (Serena).
docs/docs/features/agent-extensions.md says: "PyPI packages (uvx) are not supported yet: the agent image ships Node but no Python runtime for them." That reason is out of date: Dockerfile.agent already ships uv, uvx, the system python3 and a uv-managed Python 3.12 (added for Mistral Vibe). What is missing is the PyPI path through the library, the worker-side install and the launch.
Wanted: "Local package (PyPI)" servers
A second ecosystem for local package servers, with the same guarantees the npm kind gives.
Library contract
kind: "package"acceptsecosystem: "pypi"next to"npm"(packages/shared/src/extensionPackages.ts), withpackage, an exactversion, an optional executable (console script),args,envandsecretEnv, and the common controls (tools, capability, repositories, agents, autoApply).- Exact versions only. Ranges, tags, direct URLs, VCS references, local paths and extras that pull from elsewhere are rejected.
- Public PyPI only. No private indexes, no index credentials.
- No free-form command, shell, host path or extra mount, as for npm.
Check, pinning and integrity
- Check looks the exact version up on PyPI and shows the resolved version, its hash and the console script that will run. Nothing is downloaded or executed in Settings.
- Saving stores the registry's hash with the item; a client-sent value is replaced. The whole dependency set is resolved to exact versions with hashes when the item is saved or first installed, and later installs must reproduce those hashes or be refused.
- ProPR never updates a version on its own; an update is an explicit edit that creates a new library revision.
Install and launch
- Follow the npm design in
packages/core/src/extensions/(packageRegistry.ts,packageCache.ts,extensionPackageLibrary.ts,extensionRunResolution.ts): the worker installs once per pinned package and hash into the worker-owned cache, never at task start and never in the task workspace. - Install wheels only, with hash checking and no source builds, so no package build code runs at install time. A package or dependency that has no compatible wheel is reported as unsupported, with the package named.
- The install can reach PyPI's index and file hosts and nothing else, through the same kind of allowlisting proxy the npm install uses. Public hosts must resolve to public addresses.
- The server runs inside the task container next to the agent, through the existing stdio bridge, with a Python interpreter the agent image already ships. If the worker image needs
uvto do the install, add it there, pinned like the other tools. - Works for every agent runtime that supports extensions (Claude, Codex, Antigravity, OpenCode 2.x, Vibe, Pi), in open and restricted network mode.
- The refused-variable list gains the Python equivalents (
PYTHONPATH,PYTHONHOME,PYTHONSTARTUP,PIP_*,UV_*,VIRTUAL_ENV).
UI, events and docs
- Add server › Server type offers Local package (PyPI) with the same form as npm (
propr-ui/src/pages/SettingsPage/extensions/). - The
extensions.resolvedtask event lists these servers inpackageswithecosystem: "pypi". - Regenerate the OpenAPI document and
@propr/clienttypes. - Update
docs/docs/features/agent-extensions.md: document the PyPI kind, remove the outdated "no Python runtime" sentence and take PyPI packages out of "Out of scope". Private indexes, source builds, Docker-image servers and free-form commands stay out of scope.
Out of scope
A custom Dockerfile or custom build steps for the agent image. That is deferred until the runtime abstraction epic (#3774) lands, so it can be designed once for local and remote runtimes.
Acceptance criteria
- A pure-Python MCP server pinned to an exact PyPI version can be added in Settings, passes Check, and its tools are callable by the agent in an issue task.
- A range, tag, URL or VCS reference is rejected by the form and by the API.
- An install whose artifacts do not match the stored hashes is refused and the task reports why.
- An install never contacts a host other than PyPI's.
- A package that needs a source build is refused with a message naming it.
- Existing npm package servers behave exactly as before.
disable-mcpsanddisable-extensionslabels, the per-run limit of 8 servers and write-capability gating apply to PyPI servers too.
Tests: contract validation, registry lookup and hash pinning with a fake index, install refusal on hash mismatch and on a disallowed host, launch-config generation per agent runtime, a UI test for the PyPI form, and one end-to-end run of a small pinned PyPI MCP server.
Activity
propr-dev commentedon Dec 1, 2026
🤖 AI processing has started for this issue using codex agent with gpt-6.2-sol model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
codexgpt-6.2-sol3955/gpt-6.2-sol-extensions-local-mcp-serv-20261201-0911-c8hmainissue-3955-20261201-0911-gpt-6.2-sol-c8h🔍 Track Task Execution