Skip to content
Yejun Su

Avoid setting UV_ENV_FILE globally

Published

I’m using the Atlassian Remote MCP Server in Claude Code to fetch Jira tickets. I installed it per-project using claude mcp add-json <name> <string>. Recently, I noticed it keeps failing in one project, although the config is exactly the same.

I checked the problem by locating the MCP server command and executing it within the project. The error raised: No environment file found at: `.env`. It reminded me that UV_ENV_FILE=.env is set globally, and it’s too convenient to be noticed. After removing the environment variable, the MCP server works.

If only one command needs a dotenv file, pass it to that command instead of exporting UV_ENV_FILE in your shell profile:

uv run --env-file .env python app.py

See uv’s dotenv documentation.