Metadata-Version: 2.3
Name: svc-infra
Version: 0.1.136
Summary: Infrastructure for building and deploying prod-ready services
License: MIT
Keywords: fastapi,sqlalchemy,alembic,auth,infra,async,pydantic
Author: Ali Khatami
Author-email: aliikhatami94@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Typing :: Typed
Provides-Extra: duckdb
Provides-Extra: metrics
Provides-Extra: mssql
Provides-Extra: mysql
Provides-Extra: pg
Provides-Extra: pg2
Provides-Extra: redshift
Provides-Extra: snowflake
Provides-Extra: sqlite
Requires-Dist: ai-infra (>=0.1.29,<0.2.0)
Requires-Dist: aiosqlite (>=0.20.0,<0.21.0) ; extra == "sqlite"
Requires-Dist: alembic (>=1.13.2,<2.0.0)
Requires-Dist: asyncpg (>=0.30.0,<0.31.0) ; extra == "pg"
Requires-Dist: authlib (>=1.6.2,<2.0.0)
Requires-Dist: duckdb (>=1.1.3,<2.0.0) ; extra == "duckdb"
Requires-Dist: email-validator (>=2.2.0,<3.0.0)
Requires-Dist: fastapi (>=0.116.1,<0.117.0)
Requires-Dist: fastapi-users-db-sqlalchemy (>=7.0.0,<8.0.0)
Requires-Dist: fastapi-users[oauth] (>=14.0.1,<15.0.0)
Requires-Dist: greenlet (>=3,<4)
Requires-Dist: httpx (>=0.28.1,<0.29.0)
Requires-Dist: httpx-oauth (>=0.16.1,<0.17.0)
Requires-Dist: mcp (>=1.13.0,<2.0.0)
Requires-Dist: mysqlclient (>=2.2.4,<3.0.0) ; extra == "mysql"
Requires-Dist: opentelemetry-exporter-otlp (>=1.36.0,<2.0.0)
Requires-Dist: opentelemetry-instrumentation-fastapi (>=0.57b0,<0.58)
Requires-Dist: opentelemetry-instrumentation-httpx (>=0.57b0,<0.58)
Requires-Dist: opentelemetry-instrumentation-requests (>=0.57b0,<0.58)
Requires-Dist: opentelemetry-instrumentation-sqlalchemy (>=0.57b0,<0.58)
Requires-Dist: opentelemetry-propagator-b3 (>=1.36.0,<2.0.0)
Requires-Dist: opentelemetry-sdk (>=1.36.0,<2.0.0)
Requires-Dist: passlib[bcrypt] (>=1.7.4,<2.0.0)
Requires-Dist: prometheus-client (>=0.22.1,<0.23.0) ; extra == "metrics"
Requires-Dist: psycopg2-binary (>=2.9.10,<3.0.0) ; extra == "pg2"
Requires-Dist: psycopg[binary] (>=3.2.9,<4.0.0) ; extra == "pg"
Requires-Dist: pydantic-settings (>=2.10.1,<3.0.0)
Requires-Dist: pymysql (>=1.1.1,<2.0.0) ; extra == "mysql"
Requires-Dist: pyodbc (>=5.1.0,<6.0.0) ; extra == "mssql"
Requires-Dist: python-dotenv (>=1.1.1,<2.0.0)
Requires-Dist: redshift-connector (>=2.0.918,<3.0.0) ; extra == "redshift"
Requires-Dist: snowflake-connector-python (>=3.12.0,<4.0.0) ; extra == "snowflake"
Requires-Dist: sqlalchemy[asyncio] (>=2.0.43,<3.0.0)
Requires-Dist: typer (>=0.16.1,<0.17.0)
Project-URL: Documentation, https://github.com/your-org/svc-infra#readme
Project-URL: Homepage, https://github.com/your-org/svc-infra
Project-URL: Issues, https://github.com/your-org/svc-infra/issues
Project-URL: Repository, https://github.com/your-org/svc-infra
Description-Content-Type: text/markdown

# svc-infra

Infrastructure for building and deploying prod-ready applications:
- **FastAPI** app scaffolding with versioned mounting and uniform error handling
- **SQLAlchemy** async DB integration + Alembic CLI
- **Auth** via fastapi-users (session/refresh/OAuth)
- Simple **CRUD** router generator
- Logging, metrics, tracing, health checks

## Install

```bash
poetry add svc-infra
# or
pip install svc-infra
```

## MCP stdio CLIs

Two MCP servers are available as Node shims that launch the Python modules via uvx:
- auth-infra-mcp -> svc_infra.auth.mcp
- db-management-mcp -> svc_infra.db.setup.mcp

Prerequisites:
- Python 3.11+ available to uvx
- uv (uvx) installed and on PATH (for macOS: `brew install uv`)

Run locally from this repo:
- ./mcp-shim/bin/auth-infra-mcp.js
- ./mcp-shim/bin/db-infra-mcp.js

Notes:
- The shims default to repo https://github.com/Aliikhatami94/svc-infra.git at ref "main". Override with env vars:
  - SVC_INFRA_REPO: Git URL (e.g., your fork)
  - SVC_INFRA_REF: Branch, tag, or commit
  - UVX_REFRESH: Set to force uvx to refresh the environment
- You can also run via npm scripts: `npm run auth-mcp` or `npm run db-mcp` after installing Node 18+.

## MCP server config examples

Add entries like these to your Copilot MCP config (e.g., ~/.config/github-copilot/intellij/mcp.json):

```json
{
  "servers": {
    "auth-infra-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "--package=github:Aliikhatami94/svc-infra",
        "auth-infra-mcp"
      ]
    },
    "db-management-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "--package=github:Aliikhatami94/svc-infra",
        "db-management-mcp"
      ]
    }
  }
}
```

Tip:
- If you want to pin a specific ref (branch, tag, commit), set SVC_INFRA_REF in your environment before launching the IDE.

