Skip to content

Initial MCP server for stage control and image capture, packaged as confocal-mcp - #1

Merged
qquais merged 2 commits into
mainfrom
packaging
Aug 31, 2026
Merged

qquais merged 2 commits into
mainfrom
packaging

Conversation

@qquais

@qquais qquais commented Aug 31, 2026 •

Copy link
Copy Markdown
Collaborator

Why
Claude had no safe way to look through the microscope and move the stage. The goal is a small MCP server a client can use for the agent loop (look, decide, move), with limits so a wrong chat command can't damage the sample. It also had to be simple to install, with no hardware libraries needed on a machine that only uses the mock.

What

  • MCP server. Four tools: get_pos, move (XY only), get_image, get_move_history. backend is mock or sdk, and any move on real hardware needs confirm=True. Why: the mock lets the loop be developed anywhere, and the gate stops accidental motion.
  • Staleness detection. stage_revision and frame_id on each result, a frame history log, and an internal get_frame lookup with no new tool. Why: the model must be able to tell that an image no longer matches where the stage is.
  • Preview control. crop and max_dimension on get_image. Why: smaller images keep the conversation cheap.
  • Harness. harness/context.py prunes old images from the chat history and keeps the caption. harness/mcp_agent.py is a real MCP client loop. ANTHROPIC_API_KEY loads from .env, and a Windows stdout encoding crash is fixed.
  • Focus. move_focus() is an internal Z move with a 50 µm cap and no chat tool. Why: a chat-reachable Z move could drive the objective into the dish.
  • Camera fix. capture() dispatches on the camera's PixelFormat (BGR8, RGB8, Mono8, Bayer*) instead of assuming BayerRG8. Why: it crashed whenever the camera was left in a 3-channel format.
  • Packaging. eaa_integration/ wraps the server as an EAA tool, isolated from the rest. confocal-mcp installs with a console entry point and optional groups (camera, sdk, harness, all). A core install pulls no hardware dependencies. CONFOCAL_MCP_DATA_DIR sets where data is written. MIT license and CHANGELOG added.

Testing

@qquais
qquais requested a review from DIGIREN August 31, 2026 20:11
@qquais qquais self-assigned this Aug 31, 2026
@qquais
qquais merged commit 329c34b into main Aug 31, 2026
@qquais qquais changed the title Packaging Packaging: Initial MCP server for stage control and image capture, packaged as confocal-mcp. Oct 17, 2026
@qquais qquais changed the title Packaging: Initial MCP server for stage control and image capture, packaged as confocal-mcp. Initial MCP server for stage control and image capture, packaged as confocal-mcp Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant