Skip to content

feat: add .glama/entrypoint.sh for Glama-deployed builds#12

Merged
DubovskiyIM merged 1 commit into
mainfrom
feat/glama-entrypoint
May 6, 2026
Merged

feat: add .glama/entrypoint.sh for Glama-deployed builds#12
DubovskiyIM merged 1 commit into
mainfrom
feat/glama-entrypoint

Conversation

@DubovskiyIM
Copy link
Copy Markdown
Member

@DubovskiyIM DubovskiyIM commented May 6, 2026

Summary

Adds .glama/entrypoint.sh so the Glama-managed deployment (glama.ai/mcp/servers/intent-driven-software/idf-mcp) can spawn the IDF host + bootstrap the demo domain + hand off to mcp-idf stdio in a single script invocation.

Why

Glama's Dockerfile admin is form-based (Base image / Build steps / CMD arguments), not a free-form Dockerfile paste. The cleanest fit is to put the multi-stage logic into a script that lives in the repo, then point CMD arguments at it.

The script:

  1. Spawns the IDF host (npm run server) in background on :3001
  2. Waits up to 30s for /api/effects healthcheck
  3. Bootstraps the invest demo domain (typemap + intents POSTed from /opt/idf/src/domains/invest/{ontology,intents}.js)
  4. exec mcp-idf — stdio MCP server, foreground; this is what Glama Inspector / "Try in Browser" connects to

stderr carries host log + bootstrap chatter; stdout is reserved for the MCP wire-protocol so Inspector doesn't get garbled.

Glama configuration (paste into form fields)

After this PR merges, fill the Dockerfile admin like this:

  • Base image: debian:trixie-slim (default)
  • Node.js version: 25 (default — works fine, host requires Node ≥20)
  • Python version: 3.14 (default — only used to compile better-sqlite3)
  • Build steps (JSON array):
    [
      "apt-get update && apt-get install -y --no-install-recommends make g++",
      "npm install --omit=dev",
      "npm install -g .",
      "git clone --depth 1 https://github.com/DubovskiyIM/idf.git /opt/idf",
      "cd /opt/idf && npm install --omit=dev"
    ]
  • CMD arguments (JSON array):
    ["/app/.glama/entrypoint.sh"]

The shebang (#!/usr/bin/env bash) + executable bit on the script make it directly invokable; no need for ["bash", "/app/.glama/entrypoint.sh"].

Bootstrap must happen at runtime (it POSTs to the just-started host), so it intentionally lives in CMD rather than build steps — per Glama's tip, only the actual setup that can't be pre-baked is left for runtime.

Changes

  • New file: .glama/entrypoint.sh (85 lines, executable)

No code, no behavioural changes to the published @intent-driven/mcp-server package — .glama/ is excluded from the npm tarball by the existing files array in package.json.

@DubovskiyIM DubovskiyIM merged commit e874535 into main May 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants