Skip to main content

Generate Databricks App MCP servers from OpenAPI specs

Project description

uc-mcp-gen

A CLI that compiles an OpenAPI spec directly into a self-contained Databricks App bundle — a runnable MCP server with one concrete Python function per API operation. Auth and routing are handled by a Databricks Unity Catalog connection.

How It Works

  1. Point uc-mcp-gen generate at an OpenAPI spec (local file or URL, YAML or JSON)
  2. Provide a UC connection name
  3. Get a self-contained Databricks App bundle back — ready to deploy with databricks bundle deploy

The generated main.py has zero dependency on uc_mcp_gen. It's a plain FastMCP server where every API operation becomes a typed async def tool function, with all HTTP calls proxied through your UC connection.

Install

# Run without installing (recommended)
uvx uc-mcp-gen generate ...

# Or install locally for development
uv sync

Usage

uc-mcp-gen generate <spec> --connection <conn-name> [--name <service-name>] [-o <output-dir>]

Arguments:

Argument Description
spec Path or URL to OpenAPI spec (.yaml, .yml, .json, or remote URL)
--connection UC connection name in your Databricks workspace
--name Service name (kebab-case). Derived from spec title if omitted.
-o / --output Output directory. Defaults to generated_mcp_servers/<name>-app.

Examples:

# From a local YAML spec
uc-mcp-gen generate openapi.yaml --connection my-slack-conn -o ./slack-app

# From a local JSON spec
uc-mcp-gen generate openapi.json --connection my-api-conn

# From a remote spec
uc-mcp-gen generate https://api.example.com/openapi.yaml --connection my-conn -o ./example-app

Generated Bundle

<output>/
├── databricks.yml           Databricks Asset Bundle manifest
├── app.yaml                 App startup config — sets UC_CONNECTION_NAME
├── pyproject.toml           App dependencies (mcp, databricks-sdk, starlette, uvicorn)
└── src/app/
    ├── __init__.py
    └── main.py              Self-contained FastMCP server

Deploy with:

cd <output>
databricks bundle deploy
databricks bundle run

Auth

The generated main.py handles three auth scenarios automatically:

Scenario Mechanism
Databricks Apps (user-facing) X-Forwarded-Access-Token header → per-user WorkspaceClient
Databricks Model Serving Model Serving credentials context
Service principal / local dev Default WorkspaceClient() from environment

All tool calls are routed through client.serving_endpoints.http_request(conn=CONNECTION_NAME, ...) — your UC connection handles the downstream API auth.

Running Tests

uv run pytest -v

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uc_mcp_gen-0.1.1.tar.gz (115.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uc_mcp_gen-0.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file uc_mcp_gen-0.1.1.tar.gz.

File metadata

  • Download URL: uc_mcp_gen-0.1.1.tar.gz
  • Upload date:
  • Size: 115.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for uc_mcp_gen-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6eb8429ef2e3e8db15d4d5296aeadbfad3a6a7a5c54d0e0d1157c5669adb43ed
MD5 4eb0aecff0054d5494817ee0c2255846
BLAKE2b-256 ba8a7444d82cb21ad813dfea2efd534eb9a50193a622c27b83e08b3d147e4680

See more details on using hashes here.

Provenance

The following attestation bundles were made for uc_mcp_gen-0.1.1.tar.gz:

Publisher: publish.yml on IceRhymers/uc-mcp-gen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uc_mcp_gen-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: uc_mcp_gen-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for uc_mcp_gen-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 712431b0a6334c0b4fac3636a80f16683ac15dcb9de8806be32fce9af2245352
MD5 91ee67ff1b31bffa49786ddd70af3b16
BLAKE2b-256 4aaf310d8840556b12342425b93c16bc9dfe6f6c0e2f088d80568beba11f7b15

See more details on using hashes here.

Provenance

The following attestation bundles were made for uc_mcp_gen-0.1.1-py3-none-any.whl:

Publisher: publish.yml on IceRhymers/uc-mcp-gen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page