uv-mcp
MCP server enabling AI assistants to inspect and manage Python environments via uv, including package management, virtual environments, Python versions, tools, and security auditing.
README
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.
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-mcp
The 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/.venv
Install the bundled Agent Skill into a project for agents that discover skills
from .agents/skills:
uvx uv-mcp skill install uv
Use --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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。