Migration Guide - Azure Pricing MCP v2.0
Overview
Version 2.0 restructures the project following Python best practices. This guide helps you migrate from the old structure to the new one.
What Changed?
1. Project Structure
- Source code moved to
src/azure_pricing_mcp/ - Tests organized in
tests/directory - Utility scripts moved to
scripts/ - Documentation consolidated in
docs/
2. Package Name
- Old:
azure_pricing_server - New:
azure_pricing_mcp
3. Installation Method
- Now uses modern Python packaging (
pyproject.toml) - Installable via pip in development mode
- Can be distributed on PyPI
Migration Steps
Step 1: Update Your Environment
# Remove old virtual environment (optional but recommended)
rm -rf .venv # On Windows: Remove-Item -Recurse -Force .venv
# Run the new installation script
python scripts/install.py
# Or install manually
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .[dev]
Step 2: Update Import Statements
If you have any custom code importing the package:
Before:
from azure_pricing_server import AzurePricingServer
import azure_pricing_server
After:
from azure_pricing_mcp import AzurePricingServer
import azure_pricing_mcp
Step 3: Update Run Commands
Before:
python -m azure_pricing_server
python azure_pricing_server.py
After:
python -m azure_pricing_mcp
# Or use the console script:
azure-pricing-mcp
# Or use the runner script:
python scripts/run_server.py
Step 4: Update MCP Configuration
Update your MCP client configuration files:
VS Code (.vscode/mcp.json)
Before:
{
"servers": {
"azure-pricing": {
"type": "stdio",
"command": "/path/to/.venv/bin/python",
"args": ["-m", "azure_pricing_server"]
}
}
}
After:
{
"servers": {
"azure-pricing": {
"type": "stdio",
"command": "/path/to/.venv/bin/python",
"args": ["-m", "azure_pricing_mcp"]
}
}
}
Or use the console script:
{
"servers": {
"azure-pricing": {
"type": "stdio",
"command": "azure-pricing-mcp"
}
}
}
Claude Desktop
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Before:
{
"mcpServers": {
"azure-pricing": {
"command": "python",
"args": ["-m", "azure_pricing_server"],
"cwd": "/path/to/AzurePricingMCP"
}
}
}
After:
{
"mcpServers": {
"azure-pricing": {
"command": "python",
"args": ["-m", "azure_pricing_mcp"],
"cwd": "/path/to/AzurePricingMCP"
}
}
}
Step 5: Restart MCP Server
After updating configuration:
VS Code:
- Open Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Run: MCP: List Servers
- Click restart button next to
azure-pricing
- Open Command Palette (
Claude Desktop:
- Restart Claude Desktop application
Verification
Test that everything works:
# Activate environment
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Test import
python -c "import azure_pricing_mcp; print(azure_pricing_mcp.__version__)"
# Should print: 2.1.0
# Test server
python -m azure_pricing_mcp
# Should start without errors
New Features in v2.0
Development Tools
# Code formatting
black src/ tests/
# Linting
ruff check src/ tests/
# Type checking
mypy src/
# Run tests
pytest tests/
Improved Scripts
scripts/install.py- Automated setup and installationscripts/run_server.py- Quick server runner- Debug utilities organized in
scripts/
Better Documentation
docs/PROJECT_STRUCTURE.md- Detailed structure explanationdocs/QUICK_START.md- Quick start guidedocs/USAGE_EXAMPLES.md- Usage examples
Troubleshooting
"Module not found: azure_pricing_mcp"
Solution: Reinstall the package
cd /path/to/AzurePricingMCP
pip install -e .
"Command 'azure-pricing-mcp' not found"
Solution: Ensure you've installed the package and are in the correct virtual environment
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
MCP Server Not Starting
- Check your MCP configuration file for typos
- Verify the Python path is correct
- Ensure you're using
azure_pricing_mcp(new name) notazure_pricing_server(old name) - Check server logs in your MCP client
Import Errors
If you see import errors about missing modules:
pip install -r requirements.txt
# Or
pip install -e .[dev]
Old Files Cleanup (Optional)
The old root-level files are no longer needed. You can safely remove:
# These are replaced by the new structure
rm __init__.py
rm __main__.py
rm azure_pricing_server.py
Note: Keep these files temporarily if you want to compare or have active deployments using the old structure.
Rollback (If Needed)
If you need to rollback to the old version:
- Checkout the previous commit (before restructuring)
- Reinstall dependencies
- Update your MCP configs to use old module name
git checkout <previous-commit>
pip install -r requirements.txt
# Update configs to use azure_pricing_server
Support
If you encounter issues:
- Check docs/PROJECT_STRUCTURE.md
- Review README.md
- Open an issue on GitHub
Summary
The v2.0 restructuring provides:
✅ Professional structure following Python best practices
✅ Better maintainability with clear code organization
✅ Easier testing with proper test isolation
✅ Improved development with modern tooling
✅ PyPI ready for easy distribution
The migration is straightforward - mainly updating import names and run commands!