Compare commits

...

2 Commits

Author SHA1 Message Date
sdk-dev cb01fc2401 docs(mcp): fix stale SDK reference in CLAUDE.md
[Do] Manual gate post
sop-checklist / all-items-acked Manual gate post
CI / test (pull_request) Successful in 20s
Clarifies that the MCP server uses its own TypeScript API client
(src/api.ts), not the Python SDK. The Python SDK is for remote
agents running outside the platform; the MCP server is an operator-
side tool that bridges MCP clients to the platform REST API.

Also removes the "via the platform SDK" phrasing from the Postgres
section (server reads via REST API, not SDK).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 22:46:17 +00:00
sdk-dev effb534f64 docs(mcp): update KI-007 to reflect SDK KI-009 resolution
[Do] SDK-Dev self-review: docs-only change, no code impact
sop-checklist / all-items-acked All SOP items acknowledged: docs cross-reference sync, no breaking changes
CI / test (pull_request) Successful in 34s
Marks the MCP KI-007 as fully resolved. The Python SDK's
run_heartbeat_loop() / run_agent_loop() now accept stop_event,
resolving the underlying heartbeat-cleanup issue that KI-007
pointed to as SDK KI-009.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 22:14:05 +00:00
2 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -96,7 +96,7 @@ The workflow:
### APIs Connected
The server connects to the Molecule AI platform REST API. See the platform SDK (`../molecule-sdk-python`) for the underlying API client used.
The server connects to the Molecule AI platform REST API via its own TypeScript client (`src/api.ts`). It does not use the Python SDK (`molecule-sdk-python`) — the Python SDK is for remote agents that run outside the platform; this server runs as an MCP bridge *on* the operator side.
### Environment Variables
@@ -110,7 +110,7 @@ For local development, copy `.env.example` → `.env` and fill in values.
### Postgres
Platform data lives in Postgres (source of truth). The server reads data via the platform SDK — it does not connect to Postgres directly.
Platform data lives in Postgres (source of truth). The server reads data via the platform REST API — it does not connect to Postgres directly.
## TypeScript Conventions
+11 -11
View File
@@ -180,21 +180,21 @@ test documenting the known `optional().nullable()` zod-to-json-schema quirk.
## KI-007 — MCP server heartbeat tools are read-only; actual heartbeat lives in the Python SDK
**File:** `src/tools/remote_agents.ts` (heartbeat tool)
**Status:** Resolved — clarified scope
**Status:** Resolved
**Severity:** Low
### Clarification
### Resolution
The MCP server's remote-agent tools (`list_remote_agents`, `get_remote_agent_state`,
`check_remote_agent_freshness`, `get_remote_agent_setup_command`) are **read-only
queries** — they do not drive any background heartbeat loop. The actual
`run_heartbeat_loop()` that sends heartbeats from a remote agent lives in the
Python SDK (`molecule_sdk_python/molecule_agent/client.py`).
`run_heartbeat_loop()` lives in the Python SDK's `molecule_agent/client.py`
(standalone `molecule-sdk-python` repo).
The heartbeat cleanup issue (heartbeat loop continues after the controlling MCP
client disconnects) is tracked as **SDK KI-009** in `molecule-sdk-python/known-issues.md`.
### Suggested fix (SDK side)
Expose a `stop_event` parameter or `stop()` method on `RemoteAgentClient` so the
callers (MCP client, shell wrapper) can signal the loop to exit cleanly. The
Python SDK's `run_heartbeat_loop()` should check `threading.Event` or accept a
`stop_on: asyncio.Event` argument. See `molecule-sdk-python/known-issues.md`.
client disconnects) was tracked as **SDK KI-009**. It has been resolved:
`RemoteAgentClient.run_heartbeat_loop()` and `run_agent_loop()` now accept a
`stop_event: threading.Event | None` parameter. Callers signal clean shutdown by
calling `stop_event.set()` from a SIGTERM handler or another thread. The loop
checks the event at the start of each iteration (before `max_iterations`) and
exits with return value `"stopped"`. See `molecule-sdk-python`'s
`known-issues.md` (KI-009 resolved) and `molecule_agent/__init__.py` for usage.