Skip to content

Conversation

@maxisbey
Copy link
Contributor

@maxisbey maxisbey commented Nov 6, 2025

This PR adds the --frozen flag to all uv run commands generated in Claude Desktop configuration files.

Motivation and Context

When Claude Desktop launches MCP servers using the generated configuration, the uv run commands were executing without the --frozen flag. This could cause uv to update lock files unexpectedly, leading to:

  • Spurious changes to uv.lock during development
  • Test failures when test_command_execution ran the command
  • Potential issues in CI/CD pipelines
  • Inconsistent dependency resolution across environments

The --frozen flag ensures that uv uses the existing lock file without modifications, which is the expected behavior for running applications.

How Has This Been Tested?

  • Verified that test_command_execution in tests/client/test_config.py no longer updates uv.lock
  • Confirmed that pre-commit hooks pass
  • The generated configuration now includes ["run", "--frozen", "--with", "mcp[cli]", ...] instead of ["run", "--with", "mcp[cli]", ...]

Breaking Changes

No breaking changes. This only affects the generated Claude Desktop configuration commands. Users who have already configured MCP servers in Claude Desktop may want to regenerate their configuration to get the --frozen flag, but existing configurations will continue to work.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

This aligns with uv's best practices for production deployments where lock file stability is important. The --frozen flag is already used throughout the repository's own development workflows (in CI, scripts, etc.) and should also be used in generated configurations.

When generating Claude Desktop configuration files, the uv run commands
now include the --frozen flag. This prevents uv from updating lock files
when Claude Desktop launches MCP servers.

Without this flag, running MCP servers could inadvertently update uv.lock,
potentially causing issues in development environments and CI pipelines.
The --frozen flag ensures dependency resolution uses the existing lock
file without modifications.

This also fixes test_command_execution which was executing uv run without
--frozen, causing spurious lock file updates during test runs.
@maxisbey maxisbey enabled auto-merge (squash) November 6, 2025 15:40
@maxisbey maxisbey merged commit b7b0f8e into main Nov 6, 2025
21 checks passed
@maxisbey maxisbey deleted the fix-uv-frozen-flag-in-claude-config branch November 6, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants