Skip to content
This repository was archived by the owner on Jun 11, 2026. It is now read-only.

feat(noom-mcp-server): add Databricks Apps hosting layer#21

Open
beipang wants to merge 5 commits into
mainfrom
feat/databricks-apps-hosting
Open

feat(noom-mcp-server): add Databricks Apps hosting layer#21
beipang wants to merge 5 commits into
mainfrom
feat/databricks-apps-hosting

Conversation

@beipang

@beipang beipang commented Jun 3, 2026

Copy link
Copy Markdown

Deploys the Noom MCP server as a shared Databricks App at https://mcp-noom-dev-638571477831686.aws.databricksapps.com/mcp

Key changes:

  • hosting/: new ASGI serving layer — IdentityMiddleware extracts X-Forwarded-User per request and stores it in a ContextVar so SQL query tagging works correctly in a multi-user shared process
  • run_app.py: hosted entrypoint (uvicorn / Streamable HTTP transport); applies all governance patches, then serves via mcp.http_app()
  • customization/auth_guard_patch.py: skip browser OAuth when DATABRICKS_APPS_HOSTED=1 (Databricks Apps proxy handles auth)
  • customization/sql_executor_patch.py: get_mcp_user_identity() reads from ContextVar in hosted mode instead of process-level OAuth cache
  • requirements-app.txt: pinned dep lockfile for the App environment (generated from uv export; excludes the two local editable packages)
  • scripts/deploy.sh: stages customization + hosting + upstream packages into a temp dir, uploads to workspace, and deploys the App

All local-mode behavior (run.py, stdio transport, browser OAuth) is unchanged. See DATABRICKS_APPS_SPEC.md for full design rationale.

beipang and others added 5 commits June 2, 2026 18:29
Deploys the Noom MCP server as a shared Databricks App at
https://mcp-noom-dev-638571477831686.aws.databricksapps.com/mcp

Key changes:
- hosting/: new ASGI serving layer — IdentityMiddleware extracts
  X-Forwarded-User per request and stores it in a ContextVar so
  SQL query tagging works correctly in a multi-user shared process
- run_app.py: hosted entrypoint (uvicorn / Streamable HTTP transport);
  applies all governance patches, then serves via mcp.http_app()
- customization/auth_guard_patch.py: skip browser OAuth when
  DATABRICKS_APPS_HOSTED=1 (Databricks Apps proxy handles auth)
- customization/sql_executor_patch.py: get_mcp_user_identity() reads
  from ContextVar in hosted mode instead of process-level OAuth cache
- requirements-app.txt: pinned dep lockfile for the App environment
  (generated from uv export; excludes the two local editable packages)
- scripts/deploy.sh: stages customization + hosting + upstream packages
  into a temp dir, uploads to workspace, and deploys the App

All local-mode behavior (run.py, stdio transport, browser OAuth) is
unchanged. See DATABRICKS_APPS_SPEC.md for full design rationale.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add patch_get_best_warehouse: short-circuits the upstream warehouse
  discovery call (which fails in hosted mode since the app SP has no
  warehouse list permission) to return DATABRICKS_WAREHOUSE_ID directly
- deploy.sh step 6 now automatically grants secret scope READ and sets
  authorization mode (user_api_scopes: sql) via REST API — no manual
  steps required after deploy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The app SP is assigned asynchronously after first deploy. Without a
retry loop the script would immediately fail with "unknown" SP and
require a manual grant. Retries up to 6 times (30 s) before giving up.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant