Skip to content
Back to skills

2139 Project Structure E6fbef34

ASecurity

This document explains the new project structure following Python best practices.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
documentationpythonshellbashdockerazuretestinggitapibackenddocumentation

Works with

  • vscode
  • cli
  • api
  • mcp

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2139-project_structure_e6fbef34 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2139 Project Structure E6fbef34?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2139 Project Structure E6fbef34
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2139-project-structure-e6fbef34/badge)](https://www.skillsdirectory.com/skills/tools-only-2139-project-structure-e6fbef34)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# Azure Pricing MCP - Project Structure

This document explains the new project structure following Python best practices.

## Directory Structure

```
AzurePricingMCP/
├── src/
│   └── azure_pricing_mcp/          # Main package
│       ├── __init__.py             # Package initialization
│       ├── __main__.py             # Module entry point
│       ├── server.py               # Main server implementation
│       └── handlers.py             # Tool call handlers
│
├── tests/                          # Test files
│   ├── test_mcp.py
│   ├── test_mcp_server.py
│   └── simulate_mcp_call.py
│
├── scripts/                        # Utility scripts
│   ├── install.py                 # Installation script
│   ├── run_server.py              # Server runner
│   ├── setup.ps1                  # PowerShell setup
│   ├── docker-build.sh            # Docker build script (Linux/Mac)
│   ├── docker-build.ps1           # Docker build script (Windows)
│   └── debug_*.py                 # Debug utilities
│
├── docs/                          # Documentation
│   ├── QUICK_START.md
│   ├── USAGE_EXAMPLES.md
│   ├── PROJECT_STRUCTURE.md
│   └── config_examples.json
│
├── .vscode/                       # VS Code configuration
│   └── mcp.json.example           # MCP config template
│
├── Dockerfile                     # Docker image definition
├── docker-compose.yml             # Docker Compose configuration
├── .dockerignore                  # Docker build exclusions
├── pyproject.toml                 # Modern Python packaging config
├── setup.py                       # Setup script (backward compatible)
├── requirements.txt               # Dependencies
├── README.md                      # Main documentation
├── INSTALL.md                     # Installation guide
├── DOCKER.md                      # Docker guide
├── SETUP_CHECKLIST.md             # Setup verification
├── MANIFEST.in                    # Package data inclusion
└── .gitignore                     # Git ignore patterns
```

## Key Improvements

### 1. **Src Layout**
- Source code is in `src/azure_pricing_mcp/` following the "src layout" pattern
- Prevents accidental imports from the project root
- Ensures tests run against the installed package

### 2. **Modern Packaging**
- `pyproject.toml` - PEP 518/517 compliant packaging configuration
- `setup.py` - Maintained for backward compatibility
- `MANIFEST.in` - Controls what files are included in distributions

### 3. **Clear Separation**
- **Source code**: `src/azure_pricing_mcp/`
- **Tests**: `tests/`
- **Scripts**: `scripts/` (utilities, debug tools)
- **Documentation**: `docs/` and root-level markdown files

### 4. **Package Organization**
- `server.py` - Core server logic and API client
- `handlers.py` - MCP tool call handlers (separated for clarity)
- `__init__.py` - Package exports and version
- `__main__.py` - Module execution entry point

## Installation

### Development Installation

```bash
# Run the installation script
python scripts/install.py

# Or manually:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e .[dev]
```

### Production Installation

```bash
pip install .
```

Or from PyPI (when published):
```bash
pip install azure-pricing-mcp
```

## Running the Server

### Method 1: Module execution
```bash
python -m azure_pricing_mcp
```

### Method 2: Console script (after installation)
```bash
azure-pricing-mcp
```

### Method 3: Use the run script
```bash
python scripts/run_server.py
```

## Development Workflow

### Setting up for development
```bash
# Install in editable mode with dev dependencies
pip install -e .[dev]
```

### Code formatting
```bash
# Format code with black
black src/ tests/

# Lint with ruff
ruff check src/ tests/
```

### Type checking
```bash
mypy src/
```

### Running tests
```bash
pytest tests/
```

## VS Code / MCP Client Configuration

Update your MCP configuration to use the new package name:

```json
{
  "servers": {
    "azure-pricing": {
      "type": "stdio",
      "command": "/path/to/.venv/bin/python",
      "args": ["-m", "azure_pricing_mcp"]
    }
  }
}
```

Or use the installed console script:

```json
{
  "servers": {
    "azure-pricing": {
      "type": "stdio",
      "command": "azure-pricing-mcp"
    }
  }
}
```

## Benefits of This Structure

1. **Professional**: Follows established Python packaging standards
2. **Testable**: Clear separation enables better testing practices
3. **Installable**: Can be installed via pip and distributed on PyPI
4. **Maintainable**: Logical organization makes code easier to navigate
5. **Extensible**: Easy to add new modules and features
6. **Modern**: Uses latest Python packaging tools and conventions

## Migration Notes

If you have existing installations:

1. **Old import**: `import azure_pricing_server` → **New import**: `import azure_pricing_mcp`
2. **Old command**: `python -m azure_pricing_server` → **New command**: `python -m azure_pricing_mcp`
3. **Update MCP configs** to reference the new module name
4. **Reinstall** using the new installation method

## Additional Resources

- [Python Packaging User Guide](https://packaging.python.org/)
- [PEP 517 - Backend Interface](https://peps.python.org/pep-0517/)
- [PEP 518 - Build System](https://peps.python.org/pep-0518/)
- [Src Layout vs Flat Layout](https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.