0e2fc97aa8
The previous provisioner wrote ~/.claude/settings.json with an
mcpServers entry — but claude-code doesn't read its mcpServers from
that path. Inside a bottle, /mcp showed "No MCP servers configured"
even though the sidecar was running.
Switch to the official `claude mcp add` command run via docker exec:
docker exec -u node <agent> \
claude mcp add --scope user --transport http supervise <url>
claude-code owns its config file format (~/.claude.json shape, key
names, scope semantics) and has changed it between versions. The
official command writes to the right place in the right shape for
whatever version is installed.
Failure is logged but not fatal — the bottle still works; you just
have to register the server manually with the command surfaced in
the warning. Worst case is a bad agent claude-code version, not a
bad bottle.
To fix an already-running bottle without restarting, the user can
run the same `docker exec` command directly.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
"""Unit: supervise MCP provisioning (PRD 0013 follow-up).
|
|
|
|
The real provisioning runs `claude mcp add` inside the agent
|
|
container — exercised by the existing supervise integration test
|
|
chain once the agent container is brought up. Here we just cover
|
|
the URL computation so a regression in SUPERVISE_HOSTNAME / PORT
|
|
plumbing surfaces in unit CI."""
|
|
|
|
import unittest
|
|
|
|
from claude_bottle.backend.docker.provision.supervise import supervise_mcp_url
|
|
from claude_bottle.supervise import SUPERVISE_HOSTNAME, SUPERVISE_PORT
|
|
|
|
|
|
class TestSuperviseMcpUrl(unittest.TestCase):
|
|
def test_url_matches_sidecar_constants(self):
|
|
self.assertEqual(
|
|
f"http://{SUPERVISE_HOSTNAME}:{SUPERVISE_PORT}/",
|
|
supervise_mcp_url(),
|
|
)
|
|
|
|
def test_url_is_http_not_https(self):
|
|
# The agent dials the sidecar on the internal docker network;
|
|
# no TLS termination, no CA trust juggling. If this ever
|
|
# needs HTTPS, the sidecar's listener side has to change too.
|
|
self.assertTrue(supervise_mcp_url().startswith("http://"))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|