Skip to content

Using uvx to Run MCP Servers in Claude Desktop

The Problem

I wanted to run an MCP server in Claude Desktop using uvx, but I wasn’t sure how to configure it correctly. I also wondered whether I should use uvx or uv tool install for my use case.

What uvx Actually Is

uvx is just an alias for uv tool run. Both commands run Python tools in isolated, temporary environments without permanently installing them.

terminal
# These are equivalent:
uvx ruff check .
uv tool run ruff check .

When I run uvx things-mcp, here’s what happens:

  1. uv creates a temporary virtual environment
  2. Installs the package and its dependencies
  3. Runs the tool
  4. Cleans up (unless cached)

This is perfect for testing different versions and keeping my system clean.

uvx vs uv tool install

I made a comparison table to help decide:

Featureuvx (uv tool run)uv tool install
InstallationEphemeralPermanent
EnvironmentTemporary, isolatedPersistent in ~/.local
Startup timeSlower (first run)Faster
UpdatesAutomaticManual (uv tool upgrade)
macOS permissionsNew process each timeSingle process

Use uvx when:

  • Testing a new MCP server before committing
  • Running tools occasionally
  • Want automatic version updates

Use uv tool install when:

  • Using the MCP server daily
  • Need faster startup times
  • Want to avoid repeated permission prompts on macOS

Basic Configuration

Here’s the simplest way to configure an MCP server with uvx:

claude_desktop_config.json
{
"mcpServers": {
"my-server": {
"command": "uvx",
"args": ["package-name"]
}
}
}

Specifying Python Version

Some MCP servers require specific Python versions. I found this format works well:

claude_desktop_config.json
{
"mcpServers": {
"my-server": {
"command": "uvx",
"args": [
"--python",
"3.11",
"package-name"
]
}
}
}

Real Examples

things-mcp (macOS)

claude_desktop_config.json
{
"mcpServers": {
"things": {
"command": "uvx",
"args": [
"--python",
"3.11",
"things-mcp"
]
}
}
}

This requires macOS and Things app with Reminders permission.

Git Server

claude_desktop_config.json
{
"mcpServers": {
"git": {
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"/Users/username/projects/myproject"
]
}
}
}

With Environment Variables

claude_desktop_config.json
{
"mcpServers": {
"github": {
"command": "uvx",
"args": ["mcp-server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}

Performance Numbers I Measured

First run: ~2-5 seconds (package download, environment creation)
Cached run: ~0.5-1 second (environment reuse)
Installed: ~0.1-0.3 seconds (direct execution via uv tool install)

uvx caches downloaded packages, virtual environments, and Python interpreters in ~/.cache/uv/.

To clear the cache:

terminal
# Clear all uv cache
uv cache clean
# Clear specific package
uv cache clean things-mcp

Troubleshooting

”uvx: command not found”

Install uv first:

terminal
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or with Homebrew
brew install uv

Python Version Not Found

uv can manage Python installations:

terminal
uv python install 3.11
# Or use system Python
uvx --python-preference system things-mcp

Package Not Found

Verify the package name or use a Git URL:

terminal
uvx --from git+https://github.com/hald/things-mcp things-mcp

Slow Startup

If startup is too slow, switch to permanent installation:

terminal
uv tool install things-mcp --python 3.11

Then update your config:

claude_desktop_config.json
{
"mcpServers": {
"things": {
"command": "things-mcp"
}
}
}

Security Tips

I always verify packages before using them. For production, I pin versions:

claude_desktop_config.json
{
"mcpServers": {
"things": {
"command": "uvx",
"args": [
"--python",
"3.11",
"things-mcp==1.0.0"
]
}
}
}

Migration Path

When I want to transition from uvx to permanent installation:

terminal
# 1. Install permanently
uv tool install things-mcp --python 3.11
# 2. Update config to use direct command
# 3. Verify
things-mcp --version
# 4. To uninstall later
uv tool uninstall things-mcp

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments