Metadata-Version: 2.4
Name: scientifiq-mcp-provider
Version: 0.1.0
Summary: Provider toolkit: JSON Schema → Pydantic codegen and validated FastMCP registration
Project-URL: Homepage, https://github.com/Scientifiq/mcp-server-gateway
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp<2,>=1.27
Requires-Dist: pydantic>=2.7
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: ruff>=0.8; extra == "dev"
Requires-Dist: anyio>=4.0; extra == "dev"

# scientifiq-mcp-provider

Toolkit for standalone Scientifiq MCP providers:

1. Generate Pydantic models from per-tool JSON Schema (`input.v1.json` / `output.v1.json`)
2. Register handlers on FastMCP with Pydantic input/output validation

## Install

```bash
pip install -e packages/scientifiq-mcp-provider
```

## Codegen

```bash
scientifiq-mcp-codegen \
  --api-dir path/to/domain_api \
  --handler-prefix my_pkg.domain_api
```

Writes `domain_api/<domain>/_generated/python/pydantic_models.py` (and `tool_schemas.json`).

`$ref` resolution: relative path from the referencing schema, then `$id` lookup under `api_dir` (so `_shared/bbox.v1.json` works).

## Serve

```python
from pathlib import Path
from scientifiq_mcp_provider import build_provider_server

mcp = build_provider_server(
    name="my-provider",
    api_dir=Path(__file__).parent / "domain_api",
    handler_prefix="my_pkg.domain_api",
)
```

Tool names stay unprefixed; the gateway applies namespaces when proxying.
