Skip to content

Add ${mpak.*} runtime variable substitution in mcp_config.env#68

Open
mgoldsborough wants to merge 3 commits intomainfrom
feat/upjack-root
Open

Add ${mpak.*} runtime variable substitution in mcp_config.env#68
mgoldsborough wants to merge 3 commits intomainfrom
feat/upjack-root

Conversation

@mgoldsborough
Copy link
Copy Markdown
Contributor

@mgoldsborough mgoldsborough commented Mar 29, 2026

Summary

  • Bundles can now reference mpak runtime values in mcp_config.env via ${mpak.*} placeholders: workspace, cache_dir, bundle_name
  • Resolve MPAK_WORKSPACE before env substitution so it's available to bundles
  • Keeps mpak framework-agnostic — bundles declare their own env needs in the manifest rather than mpak having framework-specific logic

Example manifest usage:

{
  "mcp_config": {
    "env": {
      "UPJACK_ROOT": "${mpak.workspace}",
      "MY_STATE": "${mpak.cache_dir}/state"
    }
  }
}

Test plan

  • Run a bundle with ${mpak.workspace} in mcp_config.env — verify it resolves correctly
  • Run a bundle without mpak vars — verify no change in behavior
  • pnpm typecheck && pnpm lint && pnpm test all pass (141 tests, 0 failures)

When running an Upjack app (manifest has _meta["ai.nimblebrain/upjack"]),
set UPJACK_ROOT to MPAK_WORKSPACE so entity data persists outside the
ephemeral bundle cache. Non-Upjack bundles are unaffected.
…stitution

Bundles can now reference mpak runtime values (workspace, cache_dir,
bundle_name) in mcp_config.env via ${mpak.*} placeholders. This keeps
mpak framework-agnostic — the Upjack bundle declares its own env needs
in its manifest instead of mpak knowing about Upjack.
@mgoldsborough mgoldsborough changed the title Set UPJACK_ROOT for Upjack bundles during mpak run Add ${mpak.*} runtime variable substitution in mcp_config.env Mar 29, 2026
@mgoldsborough mgoldsborough added the qa-reviewed QA review completed with no critical issues label Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa-reviewed QA review completed with no critical issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant