Skip to content

UV-MCP

The Stop Shop for Python Environment Management

UV-MCP is a Model Context Protocol (MCP) server that maps natural language to typed uv commands. It gives AI assistants — Claude Code, OpenCode, Codex, Gemini CLI, and any MCP client — the ability to manage Python environments, dependencies, and project lifecycles without memorizing 45 different CLI flags.

Instead of typing, you say:

“Create a virtual environment with seed packages, install requests, and run my script.”

UV-MCP handles the rest.

ClientConfig fileSetup
Claude Code.mcp.jsonclaude mcp add uv-mcp -- uv run uv-mcp
OpenCodeopencode.jsonopencode.json ships in the repo — open and it’s active
Codex CLI.codex/config.tomlcodex mcp add uv-mcp -- uv run uv-mcp
Gemini CLIgemini-extension.jsongemini extensions install https://github.com/saadmanrafat/uv-mcp

See the Installation guide for the complete config for each client.

  • 45 typed tools — Every uv command is exposed as a structured, type-safe MCP tool with Pydantic models. From uv add to uv publish, nothing is left behind.
  • Self-healing diagnostics — Detects ModuleNotFoundError, suggests uv add fixes, and auto-syncs environments. Broken projects repair themselves.
  • Workspace introspection — Parses [tool.uv.workspace] from pyproject.toml and emits topological dependency graphs for monorepos.
  • Ephemeral tool runner — Run any CLI tool via uv tool run without permanent installation. Useful for one-off formatters, linters, and utilities.
  • Concurrency safeasyncio.Lock() serializes mutating commands to prevent uv.lock deadlocks during concurrent AI tool calls.
  • ANSI-free output — Guaranteed clean, parseable streams by injecting UV_COLOR=never and TERM=dumb on every subprocess.
CategoryTools
Project Lifecycleinit, version, format, build, publish, lock
Dependenciesadd, remove, sync, tree, list, show, outdated, freeze
Pythoninstall, pin, find, upgrade, uninstall, dir
Virtual Envcreate, seed, relocatable, system-site-packages
Ephemeralrun script, uvx proxy, temporary --with
Diagnosticscheck, repair, self-heal, workspace manifest
  • Read the Introduction to install and configure UV-MCP for your preferred client.
  • Explore the Usage Guide for real-world workflows and command patterns.
  • Browse the Tool Reference for complete API documentation.

Built with care by Saadman Rafat.