Skip to content

Tool reference

uv-mcp exposes 51 tools. Names mirror the uv CLI, so uv pip list is uv_pip_list. Every tool that runs uv returns the same envelope (success, exit_code, command, cwd, stdout, stderr, duration_seconds, timed_out, truncated, hint), plus parsed fields where noted.

Badges reflect the MCP tool annotations clients use to decide when to ask for confirmation: read-only tools never change anything, destructive tools can delete or overwrite state or run arbitrary code, network tools may contact package indexes. In read-only mode only read-only tools are registered.

Every uv option is available. Common options are tool parameters; resolution and index options are grouped in a resolver object on the tools that resolve packages; every other option goes in extra_args, which is validated against the installed uv (unknown flags, missing values and invalid choices are rejected with suggestions). uv_help lists every option of any command, with its choices and environment variable, and says which of the three ways to pass it.

Every uv command and how uv-mcp exposes it. A test compares this table with the installed uv’s --help and fails when uv gains a command that is not listed.

uv commanduv-mcp
uv adduv_add
uv audituv_audit
uv auth diruv_info (reported in its output)
uv auth loginuv_auth_login
uv auth logoutuv_auth_logout
uv auth tokenrefused: returns stored secrets into the conversation
uv builduv_build
uv cache cleanuv_cache_clean
uv cache diruv_info (reported in its output)
uv cache pruneuv_cache_prune
uv cache sizeuv_cache_size
uv checkuv_check
uv exportuv_export
uv formatuv_format
uv helpuv_help
uv inituv_init
uv lockuv_lock
uv pip checkuv_pip_check
uv pip compileuv_pip_compile
uv pip freezeuv_pip_freeze
uv pip installuv_pip_install
uv pip listuv_pip_list
uv pip showuv_pip_show
uv pip syncuv_pip_sync
uv pip treeuv_pip_tree
uv pip uninstalluv_pip_uninstall
uv publishuv_publish
uv python diruv_info (reported in its output)
uv python finduv_python_find
uv python installuv_python_install
uv python listuv_python_list
uv python pinuv_python_pin
uv python uninstalluv_python_uninstall
uv python update-shellrefused: edits the user’s shell profile
uv python upgradeuv_python_upgrade
uv removeuv_remove
uv runuv_run
uv self updateuv_self_update
uv self versionuv_info (reported in its output)
uv syncuv_sync
uv tool audituv_tool_audit
uv tool diruv_info (reported in its output)
uv tool installuv_tool_install
uv tool listuv_tool_list
uv tool runuv_tool_run
uv tool uninstalluv_tool_uninstall
uv tool update-shellrefused: edits the user’s shell profile
uv tool upgradeuv_tool_upgrade
uv treeuv_tree
uv venvuv_venv
uv versionuv_version
uv workspace diruv_workspace_dir
uv workspace listuv_workspace_list
uv workspace metadatauv_workspace_metadata

Always available, whatever toolsets are enabled.

read-only · idempotent

Report the uv version, workspace root, enabled toolsets, safety settings and uv’s directories.

Call this first if unsure which project the server operates on or whether uv is installed.

No parameters.

read-only · idempotent

List every option the installed uv accepts for a command: value type, allowed choices, env var, and how to pass it with uv-mcp (a tool parameter, the resolver object, or extra_args). Use it before reaching for an uncommon uv feature.

ParameterTypeDefaultDescription
commandstring“uv command, e.g. ‘add’, ‘pip install’, ‘python’. Empty for the list of commands.
searchstringOnly options whose flag or description contains this text.

destructive · network

Run an arbitrary uv command. Use only when no dedicated uv_* tool covers what you need.

Not run through a shell. uv auth token and update-shell commands are refused. In read-only mode only inspection commands are allowed.

ParameterTypeDefaultDescription
argslist[string]requiredArguments after uv, subcommand first, e.g. [‘workspace’, ‘list’] or [‘pip’, ‘install’, ‘—dry-run’, ‘x’]. Global flags go after the subcommand.
project_pathstringWorking directory (default: workspace root).
timeout_secondsnumberTimeout in seconds (default: server setting).

Toolset: diagnostics. Understand and fix a project without guessing.

read-only · idempotent

Read pyproject.toml and the project tree: name, version, requires-python, dependencies, groups, extras, scripts, workspace members, lockfile, .python-version and .venv. Fast; runs no commands.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).

read-only · idempotent · network

Check that uv works, the project is valid, an interpreter is available, uv.lock is current, .venv exists and matches the lockfile, and installed packages are consistent. Each finding includes a suggested fix.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).

writes · idempotent · network

Fix what uv_diagnose finds: install the required Python, recreate a broken .venv, refresh uv.lock and sync (reinstalling if packages are inconsistent). Never edits pyproject.toml. Re-diagnoses afterwards.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
dry_runboolfalseOnly return the planned steps without running them.

Toolset: project. The uv project workflow: pyproject.toml + uv.lock + .venv.

writes

Create a new uv project (pyproject.toml, .python-version, README, sample code) or a PEP 723 script.

Use this instead of writing pyproject.toml by hand. Follow up with uv_add to add dependencies.

ParameterTypeDefaultDescription
pathstringDirectory to create the project in, or the .py file for kind=‘script’. Relative to the workspace root; defaults to the workspace root itself.
namestringProject name (defaults to the directory name).
kindapp | lib | scriptapp’app’ (default), ‘lib’ (an installable library) or ‘script’ (a single PEP 723 script).
packageboolfalseFor kind=‘app’: make it an installable package with a build system.
bareboolfalseOnly create pyproject.toml (no README, sample code, .python-version or git).
pythonstringPython to use: version (‘3.12’), ‘pypy@3.10’ or a path.
build_backendstringBuild backend for packaged projects, e.g. ‘uv’, ‘hatch’, ‘setuptools’.
vcsgit | noneVersion control to initialise (default: git).
no_workspaceboolfalseDo not add the project to an enclosing workspace.
descriptionstringProject description for pyproject.toml.
no_readmeboolfalse
no_pin_pythonboolfalseDo not write a .python-version file.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · network

Add dependencies to pyproject.toml, update uv.lock and sync the project environment.

This is the right way to install packages for a project; prefer it over uv_pip_install. Supports git (rev/tag/branch), local paths, extras, markers, groups, private indexes (resolver.index) and PEP 723 scripts.

ParameterTypeDefaultDescription
packageslist[string]Requirement specifiers: ‘httpx’, ‘fastapi[standard]>=0.115’, ‘git+https://github.com/org/repo’, or local paths.
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
devboolfalseAdd to the ‘dev’ dependency group.
groupstringAdd to this dependency group (e.g. ‘test’, ‘lint’).
optionalstringAdd to this optional-dependency extra.
editableboolfalseAdd local path dependencies as editable.
package_extraslist[string]Extras to enable on the added package, e.g. [‘socks’] (—extra).
markerstringEnvironment marker for the requirement, e.g. “sys_platform == ‘linux’”.
boundslower | major | minor | exactVersion constraint style written to pyproject.toml (default: lower bound).
rawboolfalseWrite the requirement exactly as given, with no added bounds.
revstringGit commit for a git dependency.
tagstringGit tag for a git dependency.
branchstringGit branch for a git dependency.
requirementslist[string]Requirement files, relative to project_path.
constraintslist[string]Constraint files limiting resolved versions.
workspaceboolfalseAdd a local path dependency as a workspace member.
memberstringWorkspace member (—package).
scriptstringPEP 723 script to operate on instead of the project.
no_syncboolfalseUpdate pyproject.toml/uv.lock but do not sync the environment (—no-sync).
no_install_projectboolfalseSync dependencies but not the project itself.
upgrade_packageslist[string]Allow upgrading only these packages (-P).
frozenboolfalseUse uv.lock without updating it.
lockedboolfalseFail if uv.lock is out of date.
resolverobjectResolution and index options.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · network

Remove dependencies from pyproject.toml, update uv.lock and sync the environment.

ParameterTypeDefaultDescription
packageslist[string]requiredPackage names to remove.
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
devboolfalseRemove from the ‘dev’ dependency group.
groupstringRemove from this dependency group.
optionalstringRemove from this optional-dependency extra.
memberstringWorkspace member (—package).
scriptstringPEP 723 script to operate on instead of the project.
no_syncboolfalseUpdate pyproject.toml/uv.lock but do not sync the environment (—no-sync).
frozenboolfalseUse uv.lock without updating it.
lockedboolfalseFail if uv.lock is out of date.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · idempotent · network

Make the project’s .venv match uv.lock exactly (creating the venv and lockfile if needed).

Run this after cloning a project, after editing pyproject.toml by hand, or to repair a broken environment.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
extraslist[string]Optional-dependency extras to include (—extra).
all_extrasboolfalse
groupslist[string]Dependency groups to include (—group).
all_groupsboolfalse
no_devboolfalseExclude the dev group.
only_devboolfalse
upgradeboolfalseUpgrade all packages to the latest allowed versions.
upgrade_packageslist[string]Allow upgrading only these packages (-P).
reinstallboolfalseReinstall every package (fixes corrupted installs).
inexactboolfalseKeep packages that are not in the lockfile.
no_install_projectboolfalseInstall dependencies only, not the project.
no_install_workspaceboolfalse
no_editableboolfalseInstall the project and members as non-editable.
compile_bytecodeboolfalseCompile .pyc files after installing.
activeboolfalseSync into the active virtualenv instead of .venv.
checkboolfalseOnly check whether the environment is in sync; change nothing.
dry_runboolfalse
memberstringWorkspace member (—package).
all_packagesboolfalseSync every workspace member.
scriptstringPEP 723 script to operate on instead of the project.
frozenboolfalseUse uv.lock without updating it.
lockedboolfalseFail if uv.lock is out of date.
pythonstringPython to use: version (‘3.12’), ‘pypy@3.10’ or a path.
resolverobjectResolution and index options.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · idempotent · network

Resolve dependencies and write uv.lock without touching the environment. Use resolver for strategies such as lowest-version testing or exclude_newer for reproducible point-in-time locks.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
upgradeboolfalseAllow upgrading every package.
upgrade_packageslist[string]Allow upgrading only these packages (-P).
checkboolfalseOnly check whether uv.lock is up to date; write nothing.
dry_runboolfalseResolve and report changes without writing uv.lock.
scriptstringPEP 723 script to operate on instead of the project.
pythonstringPython to use: version (‘3.12’), ‘pypy@3.10’ or a path.
resolverobjectResolution and index options.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

destructive · network

Run a command or script inside the project’s environment, syncing it first.

Use this to run tests, scripts, linters and Python one-liners with the project’s dependencies. The command’s exit status is returned in exit_code (non-zero is reported as success=false).

ParameterTypeDefaultDescription
commandlist[string]requiredProgram and arguments, e.g. [‘python’, ‘main.py’], [‘pytest’, ‘-x’], [‘python’, ‘-m’, ‘mymod’] or [‘script.py’] for a PEP 723 script. Not run through a shell.
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
with_packageslist[string]Extra packages available only for this run (—with).
with_editablelist[string]Local paths to add as editable for this run.
with_requirementslist[string]Requirement files to add for this run.
moduleboolfalseRun command[0] as a Python module (python -m).
envobjectExtra environment variables for the command.
env_filestringLoad environment variables from this .env file.
isolatedboolfalseRun in a temporary environment, leaving .venv untouched.
no_projectboolfalseIgnore the current project (useful for standalone scripts).
no_syncboolfalseDo not sync the environment before running.
extraslist[string]Optional-dependency extras to include (—extra).
all_extrasboolfalse
groupslist[string]Dependency groups to include (—group).
all_groupsboolfalse
no_devboolfalse
exactboolfalseRemove packages not in the lockfile before running.
activeboolfalseUse the active virtualenv instead of .venv.
memberstringWorkspace member (—package).
frozenboolfalseUse uv.lock without updating it.
lockedboolfalseFail if uv.lock is out of date.
pythonstringPython to use: version (‘3.12’), ‘pypy@3.10’ or a path.
resolverobjectResolution and index options.
timeout_secondsnumberTimeout in seconds (default: server setting).
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent · network

Display the project’s resolved dependency tree from uv.lock. Use invert=true to find why a package is installed.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
depthintMaximum display depth.
packageslist[string]Only show the tree rooted at these packages.
invertboolfalseShow reverse dependencies: who depends on packages.
outdatedboolfalseAnnotate packages that have newer versions available.
prunelist[string]Hide these packages and their dependencies.
universalboolfalseShow the tree for all platforms, not just this one.
no_dedupeboolfalse
extraslist[string]Optional-dependency extras to include (—extra).
groupslist[string]Dependency groups to include (—group).
all_groupsboolfalse
no_devboolfalse
scriptstringPEP 723 script to operate on instead of the project.
frozenboolfalseRead uv.lock as-is (otherwise a stale lockfile is refreshed).
pythonstringPython to use: version (‘3.12’), ‘pypy@3.10’ or a path.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent · network

Export uv.lock as requirements.txt, pylock.toml or a CycloneDX SBOM (e.g. for Docker or other tools).

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
formatrequirements.txt | pylock.toml | cyclonedx1.5requirements.txtOutput format; cyclonedx1.5 produces an SBOM.
output_filestringWrite to this file (relative to the project). Omit to return the content in stdout.
no_hashesboolfalse
no_headerboolfalse
no_emit_projectboolfalseLeave the project itself out of the output.
no_emit_packageslist[string]Leave these packages out of the output.
prunelist[string]Drop these packages and their exclusive dependencies.
extraslist[string]Optional-dependency extras to include (—extra).
all_extrasboolfalse
groupslist[string]Dependency groups to include (—group).
all_groupsboolfalse
no_devboolfalse
memberstringWorkspace member (—package).
all_packagesboolfalseExport the whole workspace.
scriptstringPEP 723 script to operate on instead of the project.
frozenboolfalseUse uv.lock without updating it.
lockedboolfalseFail if uv.lock is out of date.
resolverobjectResolution and index options.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes

Read the project’s version, or set/bump it in pyproject.toml (re-locking and syncing unless told not to).

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
valuestringSet the version to exactly this value, e.g. ‘1.4.0’.
bumplist[major | minor | patch | stable | alpha | beta | rc | post | dev]Bump components in order, e.g. [‘minor’] or [‘patch’, ‘beta’].
dry_runboolfalseCompute the new version without writing it.
memberstringWorkspace member (—package).
no_syncboolfalseUpdate pyproject.toml/uv.lock but do not sync the environment (—no-sync).
frozenboolfalseUse uv.lock without updating it.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · idempotent · network

Format the project’s Python code with Ruff (installed on demand by uv).

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
checkboolfalseOnly report files that would change; modify nothing.
diffboolfalseShow the formatting diff instead of writing files.
ruff_argslist[string]Arguments passed through to ruff format, e.g. file paths.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · idempotent · network

Run uv’s project checks (static type checking with ty). Requires a recent uv; experimental in uv.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
memberstringWorkspace member (—package).
all_packagesboolfalse
scriptstringPEP 723 script to operate on instead of the project.
extraslist[string]Optional-dependency extras to include (—extra).
groupslist[string]Dependency groups to include (—group).
isolatedboolfalseCheck without syncing or modifying the project environment.
frozenboolfalseUse uv.lock without updating it.
lockedboolfalseFail if uv.lock is out of date.
pythonstringPython to use: version (‘3.12’), ‘pypy@3.10’ or a path.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent · network

Check the locked dependencies against known vulnerability databases (OSV). Experimental in uv.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
no_devboolfalse
ignorelist[string]Vulnerability IDs to ignore (e.g. ‘GHSA-xxxx’, ‘PYSEC-…’).
ignore_until_fixedlist[string]Vulnerability IDs to ignore until a fixed version exists.
scriptstringPEP 723 script to operate on instead of the project.
frozenboolfalseUse uv.lock without updating it.
lockedboolfalseFail if uv.lock is out of date.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent

List the members of the uv workspace containing project_path (a single project is its own workspace).

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
pathsboolfalseReturn member paths instead of names.
scriptsboolfalseList standalone PEP 723 scripts in the workspace instead.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent

Return the workspace root directory, or the directory of one member.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
memberstringWorkspace member (—package).
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent · network

Machine-readable description of the workspace: members, environment, interpreter and resolved packages. Experimental in uv; the schema may change.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
scriptstringPEP 723 script to operate on instead of the project.
frozenboolfalseUse uv.lock without updating it.
lockedboolfalseFail if uv.lock is out of date.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

Toolset: python. Install, find and pin interpreters.

read-only · idempotent · network

List Python interpreters found on this machine and versions uv can download.

Entries with a null path are downloadable but not installed.

ParameterTypeDefaultDescription
requeststringOnly list versions matching this request, e.g. ‘3.12’.
only_installedboolfalseHide versions that are only available for download.
all_versionsboolfalseInclude every patch version, not just the latest per minor.
all_platformsboolfalseInclude downloads for every OS, not just this one.
all_archesboolfalseInclude downloads for every CPU architecture.
show_urlsboolfalseInclude download URLs.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · idempotent · network

Download and install uv-managed Python versions. With no versions, installs the version the project requires (or the latest).

ParameterTypeDefaultDescription
versionslist[string]Version requests such as ‘3.13’, ‘3.12.4’, ‘pypy@3.10’, ‘3.14t’ (free-threaded).
defaultboolfalseAlso install python/python3 executables on PATH for this version.
reinstallboolfalse
upgradeboolfalseUpgrade existing installs to the latest patch release.
forceboolfalseReplace existing python executables that uv did not install.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · idempotent · network

Upgrade uv-managed Python installs to their latest patch release (all of them if no versions are given).

ParameterTypeDefaultDescription
versionslist[string]Version requests such as ‘3.13’, ‘3.12.4’, ‘pypy@3.10’, ‘3.14t’ (free-threaded).
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

destructive · idempotent

Remove uv-managed Python installations. Virtual environments built on them will stop working.

ParameterTypeDefaultDescription
versionslist[string]Version requests such as ‘3.13’, ‘3.12.4’, ‘pypy@3.10’, ‘3.14t’ (free-threaded).
allboolfalseUninstall every uv-managed Python version.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent

Return the path of the interpreter uv would use (honouring .python-version, requires-python and .venv).

ParameterTypeDefaultDescription
requeststringVersion request, e.g. ‘3.12’. Defaults to the project’s requirement.
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
systemboolfalseIgnore virtual environments and only consider system interpreters.
scriptstringFind the interpreter for this PEP 723 script.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · idempotent

Read or write .python-version, which selects the interpreter uv uses for the project.

ParameterTypeDefaultDescription
versionstringVersion to pin, e.g. ‘3.12’. Omit to show the current pin.
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
global_pinboolfalseWrite the user-level default pin (uv —global) instead of the project’s.
resolvedboolfalsePin the full interpreter version/path instead of the request as typed.
removeboolfalseDelete the .python-version pin.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

Toolset: pip. Environment-level package management for plain virtualenvs and requirements files.

writes · network

Install packages into a virtual environment without recording them in pyproject.toml.

For uv projects use uv_add instead so the dependency is declared and locked.

ParameterTypeDefaultDescription
packageslist[string]Requirement specifiers to install.
requirementslist[string]Requirement files (requirements.txt, pyproject.toml, pylock.toml), relative to project_path.
editablelist[string]Local paths to install in editable mode (-e).
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
pythonstringTarget environment: venv path, python path or version (default: .venv in project_path or a parent).
systemboolfalseTarget the system Python. Avoid unless the user asked for it.
break_system_packagesboolfalseAllow modifying an externally-managed (PEP 668) Python.
targetstringInstall into this directory instead of an environment (—target).
constraintslist[string]Constraint files (-c) limiting resolved versions.
overrideslist[string]Override files forcing specific versions.
extraslist[string]Extras to install from pyproject.toml inputs.
all_extrasboolfalse
groupslist[string]Dependency groups to install from pyproject.toml.
no_depsboolfalseInstall only the named packages, not their dependencies.
upgradeboolfalse
reinstallboolfalse
compile_bytecodeboolfalse
python_versionstringResolve for this Python version, e.g. ‘3.11’.
dry_runboolfalse
resolverobjectResolution and index options.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

destructive · idempotent

Remove packages from a virtual environment (does not edit pyproject.toml; use uv_remove for projects).

ParameterTypeDefaultDescription
packageslist[string]requiredPackage names to uninstall.
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
pythonstringTarget environment: venv path, python path or version (default: .venv in project_path or a parent).
systemboolfalseTarget the system Python. Avoid unless the user asked for it.
dry_runboolfalse
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent

List the packages installed in an environment, with versions (and latest versions when outdated=true).

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
pythonstringTarget environment: venv path, python path or version (default: .venv in project_path or a parent).
systemboolfalseTarget the system Python. Avoid unless the user asked for it.
outdatedboolfalseOnly list packages with newer versions available (queries the index).
editable_onlyboolfalseOnly list editable installs.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent

Show version, location, requirements and reverse dependencies of installed packages.

ParameterTypeDefaultDescription
packageslist[string]requiredInstalled package names.
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
pythonstringTarget environment: venv path, python path or version (default: .venv in project_path or a parent).
systemboolfalseTarget the system Python. Avoid unless the user asked for it.
filesboolfalseAlso list the files each package installed.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent

Print the environment’s installed packages in requirements.txt format (in stdout).

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
pythonstringTarget environment: venv path, python path or version (default: .venv in project_path or a parent).
systemboolfalseTarget the system Python. Avoid unless the user asked for it.
exclude_editableboolfalse
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent

Display the dependency tree of the packages installed in an environment.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
pythonstringTarget environment: venv path, python path or version (default: .venv in project_path or a parent).
systemboolfalseTarget the system Python. Avoid unless the user asked for it.
packageslist[string]Only show the tree for these packages.
depthint
invertboolfalseShow reverse dependencies.
outdatedboolfalse
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent

Verify that installed packages have compatible, non-missing dependencies. success=false means problems were found.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
pythonstringTarget environment: venv path, python path or version (default: .venv in project_path or a parent).
systemboolfalseTarget the system Python. Avoid unless the user asked for it.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · idempotent · network

Resolve loose requirements into a fully pinned requirements.txt or pylock.toml.

ParameterTypeDefaultDescription
src_fileslist[string]requiredInput files: requirements.in, pyproject.toml, setup.cfg… (relative to project_path).
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
output_filestringWrite the pinned result here. Omit to return it in stdout.
formatrequirements.txt | pylock.toml
universalboolfalseProduce a platform-independent resolution.
generate_hashesboolfalse
upgradeboolfalse
upgrade_packageslist[string]Allow upgrading only these packages.
extraslist[string]Extras to include (pyproject.toml inputs).
all_extrasboolfalse
groupslist[string]Dependency groups to include (pyproject.toml).
constraintslist[string]Constraint files (-c) limiting resolved versions.
overrideslist[string]Override files forcing specific versions.
no_depsboolfalse
no_headerboolfalse
python_versionstringResolve for this Python version, e.g. ‘3.11’.
resolverobjectResolution and index options.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

destructive · idempotent · network

Make an environment contain exactly the listed packages, uninstalling everything else.

ParameterTypeDefaultDescription
src_fileslist[string]requiredPinned requirements.txt or pylock.toml files.
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
pythonstringTarget environment: venv path, python path or version (default: .venv in project_path or a parent).
systemboolfalseTarget the system Python. Avoid unless the user asked for it.
constraintslist[string]Constraint files (-c) limiting resolved versions.
compile_bytecodeboolfalse
dry_runboolfalse
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

Toolset: venv.

writes · network

Create a virtual environment. For uv projects, uv_sync creates and fills .venv automatically.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
pathstringEnvironment directory, relative to project_path (default: .venv).
pythonstringPython to use: version (‘3.12’), ‘pypy@3.10’ or a path.
seedboolfalseInstall pip (and setuptools/wheel on old Pythons) into the venv.
clearboolfalseReplace an existing environment at this path.
promptstringPrompt prefix shown when the venv is activated.
allow_existingboolfalseReuse an existing environment instead of failing.
system_site_packagesboolfalse
relocatableboolfalse
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

Toolset: tool. Run or install Python command-line tools in isolated environments.

destructive · network

Run a Python command-line tool in a cached, ephemeral environment (what uvx does).

Ideal for one-off linters, formatters and generators without adding them to the project.

ParameterTypeDefaultDescription
commandlist[string]requiredTool executable and arguments, e.g. [‘ruff’, ‘check’, ’.’] or [‘pycowsay’, ‘hi’].
from_packagestringPackage providing the executable when names differ or to pin a version, e.g. ‘httpie’, ‘ruff==0.6.0’.
with_packageslist[string]Extra packages to install alongside the tool.
project_pathstringWorking directory for the tool (default: workspace root).
pythonstringPython to use: version (‘3.12’), ‘pypy@3.10’ or a path.
with_requirementslist[string]Requirement files to add to the tool environment.
with_editablelist[string]Local paths to add as editable to the tool environment.
constraintslist[string]Constraint files limiting resolved versions.
overrideslist[string]Override files forcing specific versions.
isolatedboolfalseIgnore any installed version of the tool.
envobjectExtra environment variables.
resolverobjectResolution and index options.
timeout_secondsnumberTimeout in seconds (default: server setting).
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · idempotent · network

Install a Python CLI tool into its own isolated environment and put its executables on PATH (user-wide).

ParameterTypeDefaultDescription
packagestringrequiredPackage to install, optionally with a version or URL, e.g. ‘ruff’, ‘black==24.1.0’.
with_packageslist[string]Extra packages to include in the tool’s environment.
with_requirementslist[string]Requirement files to add to the tool environment.
with_editablelist[string]Local paths to add as editable to the tool environment.
with_executables_fromlist[string]Also expose executables from these extra packages.
constraintslist[string]Constraint files limiting resolved versions.
overrideslist[string]Override files forcing specific versions.
editableboolfalse
forceboolfalseOverwrite executables that already exist on PATH.
upgradeboolfalse
reinstallboolfalse
pythonstringPython to use: version (‘3.12’), ‘pypy@3.10’ or a path.
resolverobjectResolution and index options.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · idempotent · network

Upgrade installed tools to the latest versions their constraints allow.

ParameterTypeDefaultDescription
packageslist[string]Tools to upgrade.
allboolfalseUpgrade every installed tool.
pythonstringPython to use: version (‘3.12’), ‘pypy@3.10’ or a path.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

destructive · idempotent

Remove installed tools and their executables.

ParameterTypeDefaultDescription
packageslist[string]Tools to uninstall.
allboolfalseUninstall every tool.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent

List tools installed with uv tool install, their versions and executables.

ParameterTypeDefaultDescription
outdatedboolfalseOnly show tools with newer versions available (queries the index).
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent · network

Check tools installed with uv_tool_install, and their dependencies, against known vulnerabilities (OSV). Requires uv 0.13 or newer.

ParameterTypeDefaultDescription
packageslist[string]Installed tools to audit.
allboolfalseAudit every installed tool.
ignorelist[string]Vulnerability IDs to ignore.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

Toolset: build. Build and publish distributions.

writes · idempotent · network

Build the project into distributable archives. Both sdist and wheel are built unless one is selected.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
out_dirstringOutput directory, relative to project_path (default: dist/).
sdistboolfalseBuild only a source distribution.
wheelboolfalseBuild only a wheel.
memberstringWorkspace member (—package).
all_packagesboolfalseBuild every workspace member.
clearboolfalseEmpty the output directory first.
build_constraintslist[string]Constraint files for build dependencies (-b).
no_build_logsboolfalseHide build backend output.
force_pep517boolfalseAlways build through PEP 517, even with uv_build.
pythonstringPython to use: version (‘3.12’), ‘pypy@3.10’ or a path.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

destructive · network

Upload built distributions to PyPI or another index. Irreversible: a version can never be re-uploaded.

Runs as a dry run unless dry_run=false is passed explicitly. Credentials are passed to uv through environment variables, never on the command line, and are redacted from output.

ParameterTypeDefaultDescription
project_pathstringProject directory, absolute or relative to the workspace root (default: workspace root).
fileslist[string]Files or globs to upload (default: dist/*).
dry_runbooltrueValidate without uploading. Defaults to true: set false only when the user asked to publish.
indexstringName of an index from [[tool.uv.index]] to publish to.
publish_urlstringUpload endpoint, e.g. https://test.pypi.org/legacy/.
check_urlstringIndex URL used to skip files that are already uploaded.
trusted_publishingautomatic | always | never
tokenstringAPI token. Prefer trusted publishing or UV_PUBLISH_TOKEN in the server env; never echoed back.
usernamestring
passwordstringPassword (never echoed back).
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

Toolset: cache.

destructive · idempotent

Delete cached downloads and builds. Fixes corrupted-cache errors; later installs will re-download.

ParameterTypeDefaultDescription
packageslist[string]Only remove entries for these packages (default: everything).
forceboolfalseRemove even if another uv process holds the cache lock.
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

writes · idempotent

Remove unused and stale cache entries to reclaim disk space without losing what is in use.

ParameterTypeDefaultDescription
ciboolfalseAlso drop pre-built wheels, keeping only what is expensive to rebuild (for CI caches).
extra_argslist[string]Any other option of this uv command, e.g. [‘—compile-bytecode’]. Checked against the installed uv; uv_help lists every option.

read-only · idempotent

Report how much disk space the uv cache uses.

No parameters.

Toolset: auth. Credentials for private package indexes.

writes · idempotent

Save credentials for a package index in uv’s credential store so later installs can authenticate.

ParameterTypeDefaultDescription
servicestringrequiredIndex host or URL, e.g. ‘pypi.example.com’.
tokenstringAccess token (sent to uv over stdin, never echoed back).
usernamestring
passwordstringPassword (sent over stdin, never echoed back).

destructive · idempotent

Delete stored credentials for a package index.

ParameterTypeDefaultDescription
servicestringrequiredIndex host or URL, e.g. ‘pypi.example.com’.
usernamestring

Toolset: self.

destructive · network

Update the uv executable. Only works when uv was installed with the standalone installer.

ParameterTypeDefaultDescription
target_versionstringSpecific uv version to install (default: latest).
dry_runboolfalse