uv-mcp
This server acts as an MCP interface for uv, enabling full control over Python projects and environments. Key capabilities include:
Package & Environment Management: Inspect, install, uninstall, and sync packages; create, compare, and manage virtual environments.
Project Lifecycle: Initialize projects, add/remove dependencies, build distributions, publish packages, bump versions, and manage lockfiles.
Python Version Management: Discover, install, pin, upgrade, and uninstall Python versions managed by uv.
Tool Management: Install, list, upgrade, and uninstall global uv tools.
Security Auditing: Audit project dependencies and tools for vulnerabilities and adverse statuses.
Diagnostics & Repair: Diagnose environment health, repair inconsistencies, and self-heal environments.
Cache & Storage: Clean, prune, and inspect the uv cache.
Documentation & Self-Management: Search uv documentation, check/update uv installation, and get install instructions.
Utilities: Run commands/scripts, format code with Ruff, display dependency trees, and read project manifests.
Provides access to PyPI package metadata, including version information, distribution details, and security audit data, enabling management of Python dependencies.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@uv-mcp Audit my project dependencies for known vulnerabilities"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
uv-mcp
A Model Context Protocol (MCP) server for interacting with Python installations via uv, the fast Python package installer.
Overview
uv-mcp provides LLMs with direct access to inspect and manage Python environments through the uv package manager. This allows AI assistants to help with Python dependency management, environment inspection, and troubleshooting tasks.
Related MCP server: venv-mcp-server
Features
Environment Inspection: Query installed packages and their versions
Environment Comparison: Identify differences between virtual environments
Requirement Management: Parse requirements.txt and pyproject.toml files
Package Information: Retrieve metadata about PyPI packages
Virtual Environment Management: Create and inspect virtual environments
UV Documentation: Browse cached CLI, settings, and resolver documentation
Documentation Search: Search the cached UV documentation from an MCP client
Python Management: Discover, install, pin, upgrade, and remove Python versions
Tool Management: Install, upgrade, list, and uninstall global uv tools
Security Auditing: Audit project dependencies and installed uv tools for vulnerabilities and adverse package statuses
Diagnostics: Diagnose, repair, and self-heal project environments
How It Works
uv-mcp implements the Model Context Protocol to expose Python environment data and package management functionality through standardized resources and tools.
Resources
python:packages://installed- List of all installed packages and versionspython:packages://outdated- List of installed packages with newer versions availablepython:packages://{package_name}/info- Detailed information about a packagepython:requirements://{file_path*}- Parsed requirements and version conflictsuv:docs://{section}- List entries in thecli,settings, orresolversectionsuv:docs://{section}/{command}- Read documentation entry metadatauv:docs://{section}/{command}/{subsection}- Read detailed documentation content
Tools
run(command: str[])- Run a command or scriptinit()- Create a new projectadd(package_name: str, version: Optional[str])- Add dependencies to the projectremove(package_name: str)- Remove dependencies from the projectsync(dry_run: bool)- Install all declared dependencies, uninstall anything not declaredlock()- Update the project's lockfilecheck(project_path: Optional[str], fix: bool)- Check project metadata and dependenciesproject_version(project_path: Optional[str])- Read the project versionpip(command: str[])- Run a pip commandcreate_virtualenv(path: str, packages: str[])- Create a virtual environmentcompare_environments(env1: str, env2: str)- Compare packages in two environmentspip_install(package_name: str, version: Optional[str], venv_path: Optional[str])- Install a packagepip_uninstall(package_name: str, venv_path: Optional[str])- Uninstall a packagepip_list(venv_path: Optional[str])- List packages in an optional target environmentoutdated(venv_path: Optional[str])- List installed packages with newer versions availablepip_show(packages: str[], venv_path: Optional[str])- Show installed package metadatapip_tree(venv_path: Optional[str])/pip_check(venv_path: Optional[str])- Inspect environment dependenciesupdate_cache(force: bool)- Refresh the UV documentation cachesearch_documentation(query: str)- Search cached UV documentationpython_list()/python_install(version)/python_pin(version)- Manage Python installationspython_find(request)/python_upgrade(version)/python_uninstall(version)- Resolve and update Python versionstool_install(package)/tool_upgrade(name)/tool_list()/tool_uninstall(name)- Manage uv toolstool_dir(bin: bool)/tool_update_shell()- Inspect and configure the uv tools directorypython_update_shell()- Configure the uv-managed Python directory onPATHworkspace_metadata()/workspace_list()/workspace_dir(package?)- Inspect workspacesaudit(...)/tool_audit(...)- Audit project dependencies or installed uv tools for vulnerabilitiescache_clean(package)/cache_prune(ci)/cache_dir()/cache_size()- Manage the uv cachediagnose_environment(project_path)/repair_environment(project_path)/self_heal(project_path)- Inspect and repair environmentspip_compile(input_file)/pip_sync(requirements_file)/pip_freeze()- Run pip-compatible workflowsbuild(project_path)/publish(project_path)/bump_version(level)- Build and publish projectsself_version()/self_update(target_version)- Inspect and update uv
Prompts
summarize_docs(section: Optional[str])- Generate a prompt for summarizing UV documentation
Usage
To start the server:
uvx uv-mcpThe server checks for .venv or venv in its working directory. To select an
explicit virtual environment, use the serve command:
uvx uv-mcp serve /path/to/.venvInstall the bundled Agent Skill into a project for agents that discover skills
from .agents/skills:
uvx uv-mcp skill install uv-mcpUse --target /path/to/project to select another project directory, or
--force to replace an existing installation.
Configuration can also be provided through environment variables:
UV_MCP_VENV_PATH- Default virtual environment pathUV_MCP_LOG_LEVEL- Logging level, defaultINFOUV_MCP_UV_BINARY- Explicit path to the uv executableUV_MCP_COMMAND_TIMEOUT- Optional uv command timeout in secondsUV_MCP_CACHE_DIR- Documentation cache directory; defaults to the XDG cache directory
uv's optional malware check can be enabled for sync operations with
UV_MALWARE_CHECK=1.
Development
Available Tools
50 toolsaddC
Add a dependency to the current project.
Inputs: package_name (required), version. Returns: result
auditCRead-onlyIdempotent
Audit project dependencies for known vulnerabilities and adverse statuses.
Inputs: frozen, ignore, locked, no_dev, +6 more. Returns: Result of auditing a project's dependencies.
buildB
Build source and wheel distributions for a project.
Inputs: project_path. Returns: Result of building the project distributions.
bump_versionA
Bump a project's version using uv version.
Inputs: level, dry_run, project_path. Returns: Result of bumping the project version.
cache_cleanADestructive
Clear all cache entries, or entries associated with a package.
Inputs: package. Returns: Result of a cache cleanup operation.
cache_dirARead-onlyIdempotent
Return uv's cache directory.
Inputs: no named parameters. Returns: Information about uv's cache directory.
cache_pruneBDestructive
Prune dangling cache entries and environments.
Inputs: ci. Returns: Result of a cache cleanup operation.
cache_sizeARead-onlyIdempotent
Return uv's cache directory and its size in bytes.
Inputs: no named parameters. Returns: Information about uv's cache directory.
check_installationARead-onlyIdempotent
Check whether uv is installed and report its version.
Inputs: no named parameters. Returns: Result of checking whether uv is installed.
compare_environmentsARead-onlyIdempotent
Compare installed packages between two virtual environments.
Inputs: env1 (required), env2 (required). Returns: Result of comparing the packages of two virtual environments.
create_virtualenvB
Create a virtual environment and optionally install packages.
Inputs: path (required), packages. Returns: result
dependency_treeARead-onlyIdempotent
Display the project's dependency tree.
Inputs: depth, project_path. Returns: result
diagnose_environmentBRead-onlyIdempotent
Diagnose a project's metadata, lockfile, and environment consistency.
Inputs: project_path. Returns: Result of diagnosing a project environment.
export_requirementsB
Export the project lockfile to a requirements format.
Inputs: file_format, output_file, project_path. Returns: Result of exporting the project lockfile to another format.
format_codeB
Format Python code with an ephemeral Ruff installation.
Inputs: path. Returns: result
initB
Create a new project.
Inputs: name, path, template, python_version. Returns: result
install_instructionsARead-onlyIdempotent
Return platform-specific instructions for installing uv.
Returns: Installation instructions for the current operating system.
Inputs: no named parameters. Returns: Instructions for installing uv on the current platform.
lockBIdempotent
Update the project's lockfile.
Inputs: no named parameters. Returns: result
manifestARead-onlyIdempotent
Read a project's pyproject.toml using the standard library.
Inputs: project_path. Returns: Parsed contents of a project's ``pyproject.toml``.
pipB
Run an arbitrary uv pip command.
Inputs: command (required). Returns: result
pip_compileB
Compile a requirements input file into a pinned requirements file.
Inputs: input_file (required), python, output_file. Returns: result
pip_freezeBRead-onlyIdempotent
Freeze installed packages into requirements syntax.
Inputs: venv_path. Returns: result
pip_installC
Install a package using uv pip.
Inputs: package_name (required), version, venv_path. Returns: result
pip_listARead-onlyIdempotent
List packages installed by uv pip.
Inputs: venv_path. Returns: result
pip_syncCDestructive
Synchronize an environment to a requirements file.
Inputs: requirements_file (required). Returns: result
pip_uninstallBDestructive
Uninstall a package using uv pip.
Inputs: package_name (required), venv_path. Returns: result
publishBDestructive
Publish project distributions to the configured package index.
Inputs: token, project_path. Returns: Result of publishing distributions to an index.
python_dirBRead-onlyIdempotent
Show a uv-managed Python directory.
Inputs: which. Returns: The uv Python directory for a given target.
python_findARead-onlyIdempotent
Find the path of a Python interpreter.
Inputs: request. Returns: Result of resolving a Python interpreter request.
python_installB
Install a managed Python version.
Inputs: version (required). Returns: Result of an operation on a Python installation.
python_listARead-onlyIdempotent
List Python installations known to uv.
Inputs: no named parameters. Returns: Result of listing the available Python installations.
python_pinC
Pin a Python version in a project.
Inputs: version (required), project_path. Returns: Result of an operation on a Python installation.
python_uninstallADestructive
Uninstall a managed Python version.
Inputs: version (required). Returns: Result of an operation on a Python installation.
python_upgradeC
Reinstall a managed Python version.
Inputs: version (required). Returns: Result of an operation on a Python installation.
removeADestructive
Remove a dependency from the current project.
Inputs: package_name (required). Returns: result
repair_environmentBDestructive
Recreate a project's virtual environment and synchronize it.
Inputs: project_path. Returns: Result of repairing or self-healing a project environment.
runC
Run a command or script in the project environment.
Inputs: command (required). Returns: result
run_scriptB
Run a PEP 723 script with uv.
Inputs: script_path (required). Returns: result
run_toolC
Run an ephemeral tool through uv.
Inputs: package (required), arguments. Returns: result
search_documentationB
Search cached UV documentation.
Inputs: query (required). Returns: result
self_healBDestructive
Repair an environment with a reinstall-first strategy.
Inputs: project_path. Returns: Result of repairing or self-healing a project environment.
self_updateBDestructive
Update the uv executable.
Inputs: target_version. Returns: Result of updating the uv executable.
self_versionARead-onlyIdempotent
Return the installed uv version.
Inputs: no named parameters. Returns: The installed uv version.
syncCIdempotent
Synchronize the project environment.
Inputs: locked, dry_run, upgrade. Returns: result
tool_auditBRead-onlyIdempotent
Audit installed uv tools for known vulnerabilities.
Inputs: tools, ignore, offline, all_tools, +1 more. Returns: Result of auditing installed uv tools.
tool_installB
Install a package as a globally available uv tool.
Inputs: package (required), python, version. Returns: Result of installing, upgrading, or uninstalling a uv tool.
tool_listARead-onlyIdempotent
List globally installed uv tools.
Inputs: no named parameters. Returns: Result of listing the installed uv tools.
tool_uninstallADestructive
Uninstall a globally installed uv tool.
Inputs: name (required). Returns: Result of installing, upgrading, or uninstalling a uv tool.
tool_upgradeA
Upgrade one uv tool, or all tools when no name is given.
Inputs: name. Returns: Result of installing, upgrading, or uninstalling a uv tool.
update_cacheB
Update the cached UV documentation.
Inputs: force. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 50 tools
With 50 tools, many share overlapping purposes, such as multiple `run` variants and cache-related commands. Agents may struggle to select between `cache_dir` and `cache_size` or `diagnose_environment` and `repair_environment`.
Tool names mostly follow a consistent verb_noun pattern in snake_case, but a few like `manifest`, `dependency_tree`, and bare `pip` deviate slightly.
Exposing 50 tools is excessive for an MCP server, which typically benefits from a smaller, focused set; even complex tools like uv should be scoped down.
The tool set covers the full breadth of uv functionality including project management, pip, Python installations, tools, and caching, leaving no obvious gaps.
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI models to inspect local Python packages by retrieving PyPI descriptions, file structures, and source code. It allows agents to understand third-party libraries directly from a specified environment for tasks like code analysis and dependency checking.4MIT
- FlicenseBqualityDmaintenanceAn MCP server that manages Python virtual environments using uv, allowing LLMs to reliably resolve dependencies and update virtual environments.67-
- AlicenseNot gradedqualityBmaintenanceA security-focused MCP server that enables AI assistants to search PyPI packages, scan for vulnerabilities, audit dependencies, and ensure security across Python projects.322 PyPI3MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides AI agents with real-time package health data, vulnerability reports, and dependency graphs from PyPI and OSV.dev.MIT