Skip to content

Conversation

aditya-atlan
Copy link
Contributor

Bug Description

When the atlan-mcp-server package was installed via PyPI and executed using uvx atlan-mcp-server, the transport configuration was not being applied. The server would always start in stdio mode, ignoring both environment variables (MCP_TRANSPORT, MCP_HOST, etc.) and command-line arguments.

Root Cause

The argument parsing logic was only executed in the if __name__ == "__main__": block, which runs when the script is executed directly (python server.py) but not when called via the PyPI entry point (uvx atlan-mcp-server). The PyPI entry point calls the main() function directly, bypassing the argument parsing.

Solution

Moved the argument parsing logic from the if __name__ == "__main__": block into the main() function itself. This ensures that:

  • Environment variables are properly read (MCP_TRANSPORT, MCP_HOST, MCP_PORT, MCP_PATH)
  • Command-line arguments work as expected
  • Transport configuration works regardless of execution method (direct Python execution or PyPI entry point)
  • Backward compatibility is maintained

This also updates the uv lock which was not in sync with latest fastmcp version

"--transport",
type=str,
default="stdio",
default=os.getenv("MCP_TRANSPORT", "stdio"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also use dotenv for env variables. Lets use the setting.py for these configurations

@aditya-atlan
Copy link
Contributor Author

stale , closing

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