bots-garden/mini-mepublic Fork
⑂ ef5c701
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/mini-me.git
git clone ssh://git@rickub.com/bots-garden/mini-me.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

📦 Mini Me

k33g committed 2026-09-23T20:44:31+02:00 Browse files
ef5c701 parent: 5c9b783
modified .gitignore +1 -0
@@ -7,6 +7,7 @@ mm-*
77 blog
88 ebook
99 sandboxes
10+docker-agent
1011 .memory
1112 .qlty
1213 .quality
@@ -7,6 +7,7 @@ mm-*
7 blog7 blog
8 ebook8 ebook
9 sandboxes9 sandboxes
10+docker-agent
10 .memory11 .memory
11 .qlty12 .qlty
12 .quality13 .quality
modified demo/MCP-GITHUB.md +17 -2
@@ -32,11 +32,26 @@ Pour mini-me dans sbx : Utilisez sbx mcp add github + sbx mcp auth github (méth
3232 # 4. Start sandbox: sbx run mm --name my-session --config agent.dmr.sbx.yaml
3333 #
3434
35-sbx mcp add github --url https://mcp.github.com/mcp
35+sbx mcp add github --url https://api.githubcopilot.com/mcp/
3636 sbx mcp auth github
3737 sbx mcp auth status --all
3838 sbx mcp inspect github
3939
4040 sbx run k33g/mm-tui:0.1.4 . --name mm-mcp-github -- agent.dmr.sbx.yaml --static-mcp github
4141
42-sbx mcp load github --sandbox mm-mcp-github
\ No newline at end of file
42+sbx mcp load github --sandbox mm-mcp-github
43+
44+----
45+🎯 Option 1 : Serveur stdio (recommandé pour le développement)
46+sbx mcp add github --command npx --args @modelcontextprotocol/server-github
47+sbx mcp auth github
48+
49+
50+
51+
52+sbx run k33g/mm-tui:0.1.4 --name mm-mcp-github --static-mcp github . -- agent.dmr.sbx.yaml
53+
54+
55+sbx mcp add context7 --url https://mcp.context7.com/mcp
56+
57+sbx run -d --static-mcp context7 ./ . -p ${published_port}:8080/tcp
@@ -32,11 +32,26 @@ Pour mini-me dans sbx : Utilisez sbx mcp add github + sbx mcp auth github (méth
32 # 4. Start sandbox: sbx run mm --name my-session --config agent.dmr.sbx.yaml32 # 4. Start sandbox: sbx run mm --name my-session --config agent.dmr.sbx.yaml
33 #33 #
34 34
35-sbx mcp add github --url https://mcp.github.com/mcp35+sbx mcp add github --url https://api.githubcopilot.com/mcp/
36 sbx mcp auth github36 sbx mcp auth github
37 sbx mcp auth status --all37 sbx mcp auth status --all
38 sbx mcp inspect github38 sbx mcp inspect github
39 39
40 sbx run k33g/mm-tui:0.1.4 . --name mm-mcp-github -- agent.dmr.sbx.yaml --static-mcp github40 sbx run k33g/mm-tui:0.1.4 . --name mm-mcp-github -- agent.dmr.sbx.yaml --static-mcp github
41 41
42-sbx mcp load github --sandbox mm-mcp-github
\ No newline at end of file\ No newline at end of file
42+sbx mcp load github --sandbox mm-mcp-github
43+
44+----
45+🎯 Option 1 : Serveur stdio (recommandé pour le développement)
46+sbx mcp add github --command npx --args @modelcontextprotocol/server-github
47+sbx mcp auth github
48+
49+
50+
51+
52+sbx run k33g/mm-tui:0.1.4 --name mm-mcp-github --static-mcp github . -- agent.dmr.sbx.yaml
53+
54+
55+sbx mcp add context7 --url https://mcp.context7.com/mcp
56+
57+sbx run -d --static-mcp context7 ./ . -p ${published_port}:8080/tcp
added demo/MCP_SBX_FIX.md +95 -0
new file mode 100644
@@ -0,0 +1,95 @@
1+# Fix MCP Gateway Token Issue for Mini-Me in Docker Sandbox
2+
3+## Problem Summary
4+
5+When running Mini-Me (`mm`) inside a Docker Sandbox with `sbx`, the following warning appears:
6+```
7+[warning: mcp server sbx-gateway: discovery failed: missing token for env var MCP_GATEWAY_TOKEN]
8+```
9+
10+## Root Cause
11+
12+**Misalignment between sbx and mini-me:**
13+
14+- **sbx injects**: `MCP_GATEWAY_URL` and `MCP_SENTINEL_TOKEN_NAME` environment variables
15+- **mini-me expects**: `MCP_GATEWAY_URL` and `MCP_GATEWAY_TOKEN` environment variables
16+
17+This is confirmed by Docker Agent's code in `sandboxes/sandboxlib/agentkits/agents/claude/spec.yaml`:
18+```yaml
19+# MCP_GATEWAY_URL / MCP_SENTINEL_TOKEN_NAME are injected by sandboxd as
20+# container env at create time (gateway-first lifecycle)
21+```
22+
23+## Applied Fix
24+
25+### 1. Code Fix in `main.go` (line 346)
26+```diff
27+- TokenEnv: "MCP_GATEWAY_TOKEN", // sbx may inject this, or substitute via header
28++ TokenEnv: "MCP_SENTINEL_TOKEN_NAME", // sbx injects this, not MCP_GATEWAY_TOKEN
29+```
30+
31+### 2. Configuration in `agent.dmr.sbx.yaml`
32+```yaml
33+mcp:
34+ enabled: true
35+ permissions: ask
36+ discoveryTimeout: 10s
37+ servers: [] # Let sbx-gateway handle all MCP servers
38+```
39+
40+## Why It Still Fails
41+
42+The binary in the Docker image (`k33g/mm-sandbox:0.1.4`) was **built before the fix** (timestamp: Sep 23 18:02, while fix was applied at 19:23).
43+
44+Docker's layer caching prevented the Go binary from being recompiled with the corrected `TokenEnv` value.
45+
46+## Verification
47+
48+```bash
49+# Check binary timestamp in the image
50+ docker run --rm k33g/mm-sandbox:0.1.4 sh -c "ls -l /usr/local/bin/mm"
51+# If date < 19:23: the fix is NOT in the binary
52+
53+# Check if MCP_SENTINEL_TOKEN_NAME is in the binary
54+ docker run --rm k33g/mm-sandbox:0.1.4 sh -c "strings /usr/local/bin/mm | grep SENTINEL"
55+# Should show: MCP_SENTINEL_TOKEN_NAME
56+```
57+
58+## Solution
59+
60+Rebuild the Docker image with cache disabled:
61+```bash
62+cd /Users/k33g/kDrive/Rickub/bots-garden/mini-me
63+
64+# Clean everything
65+docker rmi k33g/mm-sandbox:0.1.4
66+docker builder prune -af
67+
68+# Force full rebuild (no cache for Go compilation or Docker layers)
69+docker build --no-cache --pull -f docker-sbx/template/Dockerfile -t k33g/mm-sandbox:0.1.4 .
70+
71+# Resync kits
72+./docker-sbx/sync-kits.sh k33g 0.1.4
73+
74+# Launch with local image
75+sbx run --pull never ./docker-sbx/kits/mm-tui . -- agent.dmr.sbx.yaml
76+```
77+
78+## Alternative: Use Claude Code Directly
79+
80+Claude Code in Docker Sandbox uses the correct variable name (`MCP_SENTINEL_TOKEN_NAME`) as seen in:
81+`docker-sbx/sandboxlib/agentkits/agents/claude/spec.yaml`
82+
83+Reference from Docker Agent code:
84+```yaml
85+claude mcp add mcp-gateway "$MCP_GATEWAY_URL" \
86+ --transport http \
87+ --scope user \
88+ --header "Authorization: Bearer $MCP_SENTINEL_TOKEN_NAME"
89+```
90+
91+## Status
92+
93+- ✅ Fix applied to mini-me source code
94+- ⚠️ Requires clean rebuild of Docker image
95+- 📝 This document created for reference
new file mode 100644
@@ -0,0 +1,95 @@
1+# Fix MCP Gateway Token Issue for Mini-Me in Docker Sandbox
2+
3+## Problem Summary
4+
5+When running Mini-Me (`mm`) inside a Docker Sandbox with `sbx`, the following warning appears:
6+```
7+[warning: mcp server sbx-gateway: discovery failed: missing token for env var MCP_GATEWAY_TOKEN]
8+```
9+
10+## Root Cause
11+
12+**Misalignment between sbx and mini-me:**
13+
14+- **sbx injects**: `MCP_GATEWAY_URL` and `MCP_SENTINEL_TOKEN_NAME` environment variables
15+- **mini-me expects**: `MCP_GATEWAY_URL` and `MCP_GATEWAY_TOKEN` environment variables
16+
17+This is confirmed by Docker Agent's code in `sandboxes/sandboxlib/agentkits/agents/claude/spec.yaml`:
18+```yaml
19+# MCP_GATEWAY_URL / MCP_SENTINEL_TOKEN_NAME are injected by sandboxd as
20+# container env at create time (gateway-first lifecycle)
21+```
22+
23+## Applied Fix
24+
25+### 1. Code Fix in `main.go` (line 346)
26+```diff
27+- TokenEnv: "MCP_GATEWAY_TOKEN", // sbx may inject this, or substitute via header
28++ TokenEnv: "MCP_SENTINEL_TOKEN_NAME", // sbx injects this, not MCP_GATEWAY_TOKEN
29+```
30+
31+### 2. Configuration in `agent.dmr.sbx.yaml`
32+```yaml
33+mcp:
34+ enabled: true
35+ permissions: ask
36+ discoveryTimeout: 10s
37+ servers: [] # Let sbx-gateway handle all MCP servers
38+```
39+
40+## Why It Still Fails
41+
42+The binary in the Docker image (`k33g/mm-sandbox:0.1.4`) was **built before the fix** (timestamp: Sep 23 18:02, while fix was applied at 19:23).
43+
44+Docker's layer caching prevented the Go binary from being recompiled with the corrected `TokenEnv` value.
45+
46+## Verification
47+
48+```bash
49+# Check binary timestamp in the image
50+ docker run --rm k33g/mm-sandbox:0.1.4 sh -c "ls -l /usr/local/bin/mm"
51+# If date < 19:23: the fix is NOT in the binary
52+
53+# Check if MCP_SENTINEL_TOKEN_NAME is in the binary
54+ docker run --rm k33g/mm-sandbox:0.1.4 sh -c "strings /usr/local/bin/mm | grep SENTINEL"
55+# Should show: MCP_SENTINEL_TOKEN_NAME
56+```
57+
58+## Solution
59+
60+Rebuild the Docker image with cache disabled:
61+```bash
62+cd /Users/k33g/kDrive/Rickub/bots-garden/mini-me
63+
64+# Clean everything
65+docker rmi k33g/mm-sandbox:0.1.4
66+docker builder prune -af
67+
68+# Force full rebuild (no cache for Go compilation or Docker layers)
69+docker build --no-cache --pull -f docker-sbx/template/Dockerfile -t k33g/mm-sandbox:0.1.4 .
70+
71+# Resync kits
72+./docker-sbx/sync-kits.sh k33g 0.1.4
73+
74+# Launch with local image
75+sbx run --pull never ./docker-sbx/kits/mm-tui . -- agent.dmr.sbx.yaml
76+```
77+
78+## Alternative: Use Claude Code Directly
79+
80+Claude Code in Docker Sandbox uses the correct variable name (`MCP_SENTINEL_TOKEN_NAME`) as seen in:
81+`docker-sbx/sandboxlib/agentkits/agents/claude/spec.yaml`
82+
83+Reference from Docker Agent code:
84+```yaml
85+claude mcp add mcp-gateway "$MCP_GATEWAY_URL" \
86+ --transport http \
87+ --scope user \
88+ --header "Authorization: Bearer $MCP_SENTINEL_TOKEN_NAME"
89+```
90+
91+## Status
92+
93+- ✅ Fix applied to mini-me source code
94+- ⚠️ Requires clean rebuild of Docker image
95+- 📝 This document created for reference
modified demo/agent.dmr.sbx.yaml +1 -3
@@ -128,12 +128,10 @@ displayCommands: true
128128 showThinking: true
129129
130130 # MCP Configuration for sbx mode
131-# This agent uses the sbx MCP gateway which is automatically injected.
132-# The gateway URL is provided via MCP_GATEWAY_URL environment variable.
131+# Uses sbx MCP gateway - tokens are managed by sbx via MCP_SENTINEL_TOKEN_NAME
133132 # All MCP servers registered with `sbx mcp add` will be available through this gateway.
134133 mcp:
135134 enabled: true
136135 permissions: ask
137136 discoveryTimeout: 10s
138- # No static servers - all servers come from sbx gateway
139137 servers: []
@@ -128,12 +128,10 @@ displayCommands: true
128 showThinking: true128 showThinking: true
129 129
130 # MCP Configuration for sbx mode130 # MCP Configuration for sbx mode
131-# This agent uses the sbx MCP gateway which is automatically injected.131+# Uses sbx MCP gateway - tokens are managed by sbx via MCP_SENTINEL_TOKEN_NAME
132-# The gateway URL is provided via MCP_GATEWAY_URL environment variable.
133 # All MCP servers registered with `sbx mcp add` will be available through this gateway.132 # All MCP servers registered with `sbx mcp add` will be available through this gateway.
134 mcp:133 mcp:
135 enabled: true134 enabled: true
136 permissions: ask135 permissions: ask
137 discoveryTimeout: 10s136 discoveryTimeout: 10s
138- # No static servers - all servers come from sbx gateway
139 servers: []137 servers: []
modified main.go +1 -1
@@ -343,7 +343,7 @@ func assembleMCP(e *engine.Engine, d *detector.LoopDetector, set *toolSet) {
343343 Timeout: config.Cfg.MCP.DiscoveryTimeout,
344344 Auth: config.MCPAuthConfig{
345345 Type: "bearer",
346- TokenEnv: "MCP_GATEWAY_TOKEN", // sbx may inject this, or substitute via header
346+ TokenEnv: "MCP_SENTINEL_TOKEN_NAME", // sbx injects this, not MCP_GATEWAY_TOKEN
347347 },
348348 Headers: map[string]string{
349349 "Accept": "application/json, text/event-stream",
@@ -343,7 +343,7 @@ func assembleMCP(e *engine.Engine, d *detector.LoopDetector, set *toolSet) {
343 Timeout: config.Cfg.MCP.DiscoveryTimeout,343 Timeout: config.Cfg.MCP.DiscoveryTimeout,
344 Auth: config.MCPAuthConfig{344 Auth: config.MCPAuthConfig{
345 Type: "bearer",345 Type: "bearer",
346- TokenEnv: "MCP_GATEWAY_TOKEN", // sbx may inject this, or substitute via header346+ TokenEnv: "MCP_SENTINEL_TOKEN_NAME", // sbx injects this, not MCP_GATEWAY_TOKEN
347 },347 },
348 Headers: map[string]string{348 Headers: map[string]string{
349 "Accept": "application/json, text/event-stream",349 "Accept": "application/json, text/event-stream",