@stackable-labs/mcp-app-extension 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # `@stackable-labs/mcp-app-extension`
2
+
3
+ MCP server exposing Stackable Labs extension-platform tools to AI agents (Claude Code, etc.). Supports both **stdio** (local process, SDK self-auth via OAuth) and **streamable HTTP** (deployed Lambda, Claude Code native OAuth) transports.
4
+
5
+ ## Transports
6
+
7
+ | Transport | Home | Auth flow | Best for |
8
+ |-----------|------|-----------|----------|
9
+ | **HTTP** (streamable) | Deployed at `api-{stage}-use1.stackablelabs.io/mcp/app-extension` | Claude Code native OAuth — SDK discovers `.well-known/oauth-authorization-server` via `WWW-Authenticate` header, stores token in keychain | Most users. Simplest to configure. |
10
+ | **stdio** | Local process via `pnpm dlx @stackable-labs/mcp-app-extension@latest` | Package-level OAuth flow — spins up localhost callback listener, caches token to `~/.stackable/mcp-auth.json` | Local dev, agent orchestration outside a Claude Code keychain |
11
+
12
+ Both transports expose the same tool surface: `list_apps`, `list_extensions`, `get_extension`, `list_instances`, plus SDK-only tools (`list_skills`, `lookup_skill`, `validate_manifest`, `validate_permissions`).
13
+
14
+ ## Claude Code `.mcp.json` config
15
+
16
+ Drop into your project root (or `~/.claude.json` for user-scoped setup). Both entries can coexist — Claude Code routes tool calls per-server.
17
+
18
+ **Dev (against deployed `api-dev-use1.stackablelabs.io`):**
19
+
20
+ ```json
21
+ {
22
+ "mcpServers": {
23
+ "stackable-dev-http": {
24
+ "type": "http",
25
+ "url": "https://api-dev-use1.stackablelabs.io/mcp/app-extension"
26
+ },
27
+ "stackable-dev-stdio": {
28
+ "type": "stdio",
29
+ "command": "pnpm",
30
+ "args": [
31
+ "--config.dlx-cache-max-age=0",
32
+ "dlx",
33
+ "@stackable-labs/mcp-app-extension@latest"
34
+ ],
35
+ "env": {
36
+ "MCP_API_BASE_URL": "https://api-dev-use1.stackablelabs.io/mcp",
37
+ "ADMIN_API_BASE_URL": "https://api-dev-use1.stackablelabs.io/admin"
38
+ }
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
44
+ **Prod (defaults, no env vars needed):**
45
+
46
+ ```json
47
+ {
48
+ "mcpServers": {
49
+ "stackable-http": {
50
+ "type": "http",
51
+ "url": "https://api-use1.stackablelabs.io/mcp/app-extension"
52
+ },
53
+ "stackable-stdio": {
54
+ "type": "stdio",
55
+ "command": "pnpm",
56
+ "args": ["--config.dlx-cache-max-age=0", "dlx", "@stackable-labs/mcp-app-extension@latest"]
57
+ }
58
+ }
59
+ }
60
+ ```
61
+
62
+ ## Env vars (stdio only)
63
+
64
+ Both optional — defaults point at prod. Override per-stage as needed.
65
+
66
+ | Env var | Default | Purpose |
67
+ |---------|---------|---------|
68
+ | `MCP_API_BASE_URL` | `https://api-use1.stackablelabs.io/mcp` | MCP host root. OAuth discovery URL is derived as `${mcpBase}/.well-known/oauth-authorization-server`. |
69
+ | `ADMIN_API_BASE_URL` | `https://api-use1.stackablelabs.io/admin` | Admin API endpoint for platform tool calls (`list_apps`, etc.). |
70
+
71
+ HTTP transport reads URLs from the deployed Lambda's env (set via CDK + `packages/infra/cdk/.env.{stage}` — not client-controlled).
72
+
73
+ ## Auth isolation
74
+
75
+ Stdio transport stores its token at `~/.stackable/mcp-auth.json`. CLI (`@stackable-labs/cli-app-extension`) stores its token at `~/.stackable/auth.json`. The two are independent — authenticating via stdio MCP does not affect CLI auth and vice versa. HTTP transport stores its token in the Claude Code keychain, completely separate from both file-based caches.
76
+
77
+ ## Development
78
+
79
+ ```bash
80
+ pnpm --filter @stackable-labs/mcp-app-extension build # tsup bundle
81
+ pnpm --filter @stackable-labs/mcp-app-extension test # vitest
82
+ pnpm --filter @stackable-labs/mcp-app-extension typecheck
83
+ ```
84
+
85
+ To test a local build via stdio, point the `.mcp.json` `command`/`args` at the built dist:
86
+
87
+ ```json
88
+ {
89
+ "command": "node",
90
+ "args": ["/absolute/path/to/packages/mcp/app-extension/dist/index.js"],
91
+ "env": { "MCP_API_BASE_URL": "...", "ADMIN_API_BASE_URL": "..." }
92
+ }
93
+ ```