This repository was archived by the owner on Jan 30, 2026. It is now read-only.
feat: add --index-url support for private package registries#35
Open
juan-abia wants to merge 7 commits intopydantic:mainfrom
Open
feat: add --index-url support for private package registries#35juan-abia wants to merge 7 commits intopydantic:mainfrom
juan-abia wants to merge 7 commits intopydantic:mainfrom
Conversation
79f12ac to
2e51c0b
Compare
d33a672 to
22eb651
Compare
DouweM
suggested changes
Jan 12, 2026
1f09b30 to
553272c
Compare
Add support for custom package index URLs to allow installing dependencies from private registries. The --index-url CLI option can be repeated multiple times to specify multiple indexes, which are tried in order before PyPI. Changes: - Add --index-url CLI argument with action='append' for multiple indexes - Add index_urls parameter to run_mcp_server(), prepare_deno_env(), async_prepare_deno_env(), and code_sandbox() - Pass index_urls through Deno/TypeScript layer to micropip.install() - Update README with usage examples Usage: uvx mcp-run-python --index-url https://private.repo.com/simple --deps pkg stdio Python API: async with code_sandbox( dependencies=['pkg'], index_urls=['https://private.repo.com/simple'] ) as sandbox: await sandbox.eval('import pkg')
553272c to
81e9179
Compare
- Always pass indexUrls to prepare_env (even if empty), matching how dependencies are handled - Add repeatable --dep flag alongside existing --deps for CLI consistency with --index-url - Mark --deps as deprecated but keep it working for backwards compatibility
micropip treats empty list [] differently from None - with [] it doesn't fall back to PyPI. Using 'index_urls or None' ensures empty lists are converted to None so PyPI fallback works correctly.
DouweM
suggested changes
Jan 14, 2026
- Update README.md examples to use --dep (repeatable) instead of --deps - Hide --deps from CLI help (argparse.SUPPRESS) - Add DeprecationWarning when --deps is used - Keep --deps working for backwards compatibility
- Add --dep and --index-url as repeatable args in Deno CLI (using collect) - Update Python main.py to pass --dep= and --index-url= instead of comma-separated - Add deprecation warnings when --deps or --index-urls are used - Update Deno help text to show new args - Keep backwards compatibility for old comma-separated format - Add test for repeatable --dep flag
- test_cli_dep_multiple: test multiple --dep flags (--dep numpy --dep pydantic) - test_cli_dep_and_deps_combined: test combining --dep and --deps - test_cli_deps_deprecation_warning: verify deprecation warning is emitted
DouweM
suggested changes
Jan 16, 2026
--index-urls was never a public option, so there's nothing to deprecate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for custom package index URLs to allow installing dependencies from private registries. The --index-url CLI option can be repeated multiple times to specify multiple indexes, which are tried in order before PyPI.
Changes:
Usage:
uvx mcp-run-python --index-url https://private.repo.com/simple --deps pkg stdioPython API:
async with code_sandbox( dependencies=['pkg'], index_urls=['https://private.repo.com/simple'] ) as sandbox: await sandbox.eval('import pkg')