capstone-mcp 0.1.1__tar.gz
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.
- capstone_mcp-0.1.1/.gitignore +21 -0
- capstone_mcp-0.1.1/AGENTS.md +43 -0
- capstone_mcp-0.1.1/CODING_STANDARDS.md +56 -0
- capstone_mcp-0.1.1/GLOSSARY.md +80 -0
- capstone_mcp-0.1.1/LICENSE +21 -0
- capstone_mcp-0.1.1/MISSION.md +19 -0
- capstone_mcp-0.1.1/PKG-INFO +163 -0
- capstone_mcp-0.1.1/PRIVACY.md +14 -0
- capstone_mcp-0.1.1/README.en.md +128 -0
- capstone_mcp-0.1.1/README.md +128 -0
- capstone_mcp-0.1.1/RESOURCES.md +26 -0
- capstone_mcp-0.1.1/assets/icon.svg +4 -0
- capstone_mcp-0.1.1/docs/adr/0001-tool-surface-and-ipc-error-remediation.md +32 -0
- capstone_mcp-0.1.1/docs/adr/0002-bridge-unification-and-runtime-verification.md +23 -0
- capstone_mcp-0.1.1/docs/adr/0003-cdp-primary-telemetry-and-uia-fallback.md +21 -0
- capstone_mcp-0.1.1/docs/adr/0004-fake-backend-and-defect-eradication.md +22 -0
- capstone_mcp-0.1.1/docs/adr/0005-exhaustive-live-stabilization.md +31 -0
- capstone_mcp-0.1.1/docs/adr/README.md +3 -0
- capstone_mcp-0.1.1/docs/agents/domain.md +31 -0
- capstone_mcp-0.1.1/docs/agents/issue-tracker.md +50 -0
- capstone_mcp-0.1.1/docs/agents/triage-labels.md +13 -0
- capstone_mcp-0.1.1/docs/architecture-audit.md +215 -0
- capstone_mcp-0.1.1/docs/architecture.md +510 -0
- capstone_mcp-0.1.1/docs/remediation-verification.md +88 -0
- capstone_mcp-0.1.1/docs/specs/codex-handover-master-spec.md +95 -0
- capstone_mcp-0.1.1/docs/specs/phase10-codebase-deepening.md +90 -0
- capstone_mcp-0.1.1/docs/specs/phase11-core-deepening.md +95 -0
- capstone_mcp-0.1.1/docs/specs/phase3-physics-suite.md +103 -0
- capstone_mcp-0.1.1/docs/specs/phase4-architecture-deepening.md +77 -0
- capstone_mcp-0.1.1/docs/specs/phase5-core-deepening.md +77 -0
- capstone_mcp-0.1.1/docs/specs/phase6-graph-and-mcp-maturity.md +98 -0
- capstone_mcp-0.1.1/docs/specs/phase9-reverse-engineering-and-core-overhaul.md +136 -0
- capstone_mcp-0.1.1/docs/usage.md +145 -0
- capstone_mcp-0.1.1/pyproject.toml +87 -0
- capstone_mcp-0.1.1/reference/adiabatic_gas.html +26 -0
- capstone_mcp-0.1.1/reference/forced_harmonic_oscillation.html +26 -0
- capstone_mcp-0.1.1/reference/photoelectric_effect.html +26 -0
- capstone_mcp-0.1.1/reference/rlc_resonance.html +26 -0
- capstone_mcp-0.1.1/reference/slit_diffraction.html +26 -0
- capstone_mcp-0.1.1/scripts/__init__.py +2 -0
- capstone_mcp-0.1.1/scripts/probe.py +13 -0
- capstone_mcp-0.1.1/scripts/probe_numeric_storage.py +57 -0
- capstone_mcp-0.1.1/server.json +33 -0
- capstone_mcp-0.1.1/src/capstone_mcp/__init__.py +9 -0
- capstone_mcp-0.1.1/src/capstone_mcp/_win32.py +37 -0
- capstone_mcp-0.1.1/src/capstone_mcp/acquisition.py +156 -0
- capstone_mcp-0.1.1/src/capstone_mcp/agent_instructions.py +205 -0
- capstone_mcp-0.1.1/src/capstone_mcp/analysis.py +218 -0
- capstone_mcp-0.1.1/src/capstone_mcp/automation_models.py +143 -0
- capstone_mcp-0.1.1/src/capstone_mcp/automation_worker.py +404 -0
- capstone_mcp-0.1.1/src/capstone_mcp/backend_protocol.py +105 -0
- capstone_mcp-0.1.1/src/capstone_mcp/bridge.py +324 -0
- capstone_mcp-0.1.1/src/capstone_mcp/calculator.py +530 -0
- capstone_mcp-0.1.1/src/capstone_mcp/capfile_models.py +212 -0
- capstone_mcp-0.1.1/src/capstone_mcp/capfiles/__init__.py +66 -0
- capstone_mcp-0.1.1/src/capstone_mcp/capfiles/archive.py +928 -0
- capstone_mcp-0.1.1/src/capstone_mcp/capfiles/records.py +171 -0
- capstone_mcp-0.1.1/src/capstone_mcp/csv_data.py +335 -0
- capstone_mcp-0.1.1/src/capstone_mcp/data_sources/__init__.py +32 -0
- capstone_mcp-0.1.1/src/capstone_mcp/data_sources/adapters/__init__.py +94 -0
- capstone_mcp-0.1.1/src/capstone_mcp/data_sources/adapters/capfile.py +256 -0
- capstone_mcp-0.1.1/src/capstone_mcp/data_sources/adapters/csv_file.py +177 -0
- capstone_mcp-0.1.1/src/capstone_mcp/data_sources/adapters/live_session.py +101 -0
- capstone_mcp-0.1.1/src/capstone_mcp/data_sources/adapters/live_telemetry.py +156 -0
- capstone_mcp-0.1.1/src/capstone_mcp/data_sources/models.py +49 -0
- capstone_mcp-0.1.1/src/capstone_mcp/data_sources/seam.py +119 -0
- capstone_mcp-0.1.1/src/capstone_mcp/desktop.py +736 -0
- capstone_mcp-0.1.1/src/capstone_mcp/displays/__init__.py +156 -0
- capstone_mcp-0.1.1/src/capstone_mcp/displays/digits.py +197 -0
- capstone_mcp-0.1.1/src/capstone_mcp/displays/harness.py +350 -0
- capstone_mcp-0.1.1/src/capstone_mcp/displays/manager.py +257 -0
- capstone_mcp-0.1.1/src/capstone_mcp/displays/models.py +533 -0
- capstone_mcp-0.1.1/src/capstone_mcp/displays/scope.py +353 -0
- capstone_mcp-0.1.1/src/capstone_mcp/displays/table.py +357 -0
- capstone_mcp-0.1.1/src/capstone_mcp/displays/workbook.py +259 -0
- capstone_mcp-0.1.1/src/capstone_mcp/experiment_analysis.py +295 -0
- capstone_mcp-0.1.1/src/capstone_mcp/fake_backend.py +906 -0
- capstone_mcp-0.1.1/src/capstone_mcp/file_events.py +137 -0
- capstone_mcp-0.1.1/src/capstone_mcp/file_workflow_models.py +30 -0
- capstone_mcp-0.1.1/src/capstone_mcp/file_workflows.py +585 -0
- capstone_mcp-0.1.1/src/capstone_mcp/graphs/__init__.py +164 -0
- capstone_mcp-0.1.1/src/capstone_mcp/graphs/inspection.py +857 -0
- capstone_mcp-0.1.1/src/capstone_mcp/graphs/manager.py +793 -0
- capstone_mcp-0.1.1/src/capstone_mcp/graphs/models.py +729 -0
- capstone_mcp-0.1.1/src/capstone_mcp/graphs/toolbox.py +528 -0
- capstone_mcp-0.1.1/src/capstone_mcp/instruments/__init__.py +110 -0
- capstone_mcp-0.1.1/src/capstone_mcp/instruments/_controls.py +39 -0
- capstone_mcp-0.1.1/src/capstone_mcp/instruments/generator.py +382 -0
- capstone_mcp-0.1.1/src/capstone_mcp/instruments/manager.py +298 -0
- capstone_mcp-0.1.1/src/capstone_mcp/instruments/models.py +524 -0
- capstone_mcp-0.1.1/src/capstone_mcp/instruments/sensors.py +428 -0
- capstone_mcp-0.1.1/src/capstone_mcp/instruments/triggers.py +345 -0
- capstone_mcp-0.1.1/src/capstone_mcp/instruments/wireless.py +485 -0
- capstone_mcp-0.1.1/src/capstone_mcp/models.py +96 -0
- capstone_mcp-0.1.1/src/capstone_mcp/native/__init__.py +9 -0
- capstone_mcp-0.1.1/src/capstone_mcp/native/errors.py +128 -0
- capstone_mcp-0.1.1/src/capstone_mcp/native/runtime.py +948 -0
- capstone_mcp-0.1.1/src/capstone_mcp/native_loop.py +61 -0
- capstone_mcp-0.1.1/src/capstone_mcp/native_main.py +43 -0
- capstone_mcp-0.1.1/src/capstone_mcp/numeric_storage.py +96 -0
- capstone_mcp-0.1.1/src/capstone_mcp/numerics/__init__.py +38 -0
- capstone_mcp-0.1.1/src/capstone_mcp/numerics/diffraction.py +239 -0
- capstone_mcp-0.1.1/src/capstone_mcp/numerics/regression.py +347 -0
- capstone_mcp-0.1.1/src/capstone_mcp/numerics/sparklines.py +270 -0
- capstone_mcp-0.1.1/src/capstone_mcp/numerics/spectral.py +196 -0
- capstone_mcp-0.1.1/src/capstone_mcp/numerics/summary.py +59 -0
- capstone_mcp-0.1.1/src/capstone_mcp/plotting.py +154 -0
- capstone_mcp-0.1.1/src/capstone_mcp/popup_selection.py +119 -0
- capstone_mcp-0.1.1/src/capstone_mcp/prompts.py +154 -0
- capstone_mcp-0.1.1/src/capstone_mcp/py.typed +1 -0
- capstone_mcp-0.1.1/src/capstone_mcp/recipes/__init__.py +68 -0
- capstone_mcp-0.1.1/src/capstone_mcp/recipes/adiabatic_gas.py +509 -0
- capstone_mcp-0.1.1/src/capstone_mcp/recipes/base.py +264 -0
- capstone_mcp-0.1.1/src/capstone_mcp/recipes/forced_oscillation.py +245 -0
- capstone_mcp-0.1.1/src/capstone_mcp/recipes/photoelectric.py +276 -0
- capstone_mcp-0.1.1/src/capstone_mcp/recipes/polarization.py +208 -0
- capstone_mcp-0.1.1/src/capstone_mcp/recipes/rlc_resonance.py +260 -0
- capstone_mcp-0.1.1/src/capstone_mcp/recipes/slit_diffraction.py +901 -0
- capstone_mcp-0.1.1/src/capstone_mcp/record_events.py +95 -0
- capstone_mcp-0.1.1/src/capstone_mcp/repetition.py +429 -0
- capstone_mcp-0.1.1/src/capstone_mcp/reports/__init__.py +50 -0
- capstone_mcp-0.1.1/src/capstone_mcp/reports/generator.py +939 -0
- capstone_mcp-0.1.1/src/capstone_mcp/reports/models.py +123 -0
- capstone_mcp-0.1.1/src/capstone_mcp/reports/output.py +73 -0
- capstone_mcp-0.1.1/src/capstone_mcp/reports/templates.py +600 -0
- capstone_mcp-0.1.1/src/capstone_mcp/resources.py +317 -0
- capstone_mcp-0.1.1/src/capstone_mcp/runs/__init__.py +58 -0
- capstone_mcp-0.1.1/src/capstone_mcp/runs/manager.py +744 -0
- capstone_mcp-0.1.1/src/capstone_mcp/runs/models.py +198 -0
- capstone_mcp-0.1.1/src/capstone_mcp/runs/tool.py +64 -0
- capstone_mcp-0.1.1/src/capstone_mcp/server.py +462 -0
- capstone_mcp-0.1.1/src/capstone_mcp/session/__init__.py +137 -0
- capstone_mcp-0.1.1/src/capstone_mcp/session/cdp_client.py +38 -0
- capstone_mcp-0.1.1/src/capstone_mcp/session/lifecycle.py +60 -0
- capstone_mcp-0.1.1/src/capstone_mcp/session/telemetry.py +181 -0
- capstone_mcp-0.1.1/src/capstone_mcp/session/watcher.py +136 -0
- capstone_mcp-0.1.1/src/capstone_mcp/tools/__init__.py +16 -0
- capstone_mcp-0.1.1/src/capstone_mcp/tools/displays.py +167 -0
- capstone_mcp-0.1.1/src/capstone_mcp/tools/files.py +237 -0
- capstone_mcp-0.1.1/src/capstone_mcp/tools/instruments.py +81 -0
- capstone_mcp-0.1.1/src/capstone_mcp/tools/physics.py +268 -0
- capstone_mcp-0.1.1/src/capstone_mcp/tools/ui.py +532 -0
- capstone_mcp-0.1.1/src/capstone_mcp/ui_events.py +219 -0
- capstone_mcp-0.1.1/src/capstone_mcp/ui_strings.py +65 -0
- capstone_mcp-0.1.1/tests/__init__.py +2 -0
- capstone_mcp-0.1.1/tests/golden_samples.py +11 -0
- capstone_mcp-0.1.1/tests/test_acquisition.py +166 -0
- capstone_mcp-0.1.1/tests/test_agent_instructions.py +68 -0
- capstone_mcp-0.1.1/tests/test_analysis.py +163 -0
- capstone_mcp-0.1.1/tests/test_automation_worker.py +119 -0
- capstone_mcp-0.1.1/tests/test_bridge.py +90 -0
- capstone_mcp-0.1.1/tests/test_bridge_wire.py +109 -0
- capstone_mcp-0.1.1/tests/test_calculator.py +389 -0
- capstone_mcp-0.1.1/tests/test_capfile_corpus.py +95 -0
- capstone_mcp-0.1.1/tests/test_capfile_pages.py +114 -0
- capstone_mcp-0.1.1/tests/test_capfile_records.py +178 -0
- capstone_mcp-0.1.1/tests/test_capfiles.py +615 -0
- capstone_mcp-0.1.1/tests/test_cross_platform_import.py +95 -0
- capstone_mcp-0.1.1/tests/test_csv_data.py +84 -0
- capstone_mcp-0.1.1/tests/test_csv_locales.py +200 -0
- capstone_mcp-0.1.1/tests/test_data_adapter_safety.py +185 -0
- capstone_mcp-0.1.1/tests/test_data_sources.py +274 -0
- capstone_mcp-0.1.1/tests/test_default_window.py +63 -0
- capstone_mcp-0.1.1/tests/test_desktop_guards.py +362 -0
- capstone_mcp-0.1.1/tests/test_desktop_screenshot.py +59 -0
- capstone_mcp-0.1.1/tests/test_desktop_type_text_guard.py +78 -0
- capstone_mcp-0.1.1/tests/test_dialog_discovery.py +38 -0
- capstone_mcp-0.1.1/tests/test_digits_display.py +275 -0
- capstone_mcp-0.1.1/tests/test_display_harness.py +266 -0
- capstone_mcp-0.1.1/tests/test_display_maturity.py +91 -0
- capstone_mcp-0.1.1/tests/test_displays.py +307 -0
- capstone_mcp-0.1.1/tests/test_domain_protocol.py +157 -0
- capstone_mcp-0.1.1/tests/test_double_slit.py +159 -0
- capstone_mcp-0.1.1/tests/test_experiment_analysis.py +545 -0
- capstone_mcp-0.1.1/tests/test_fake_backend.py +198 -0
- capstone_mcp-0.1.1/tests/test_file_events.py +73 -0
- capstone_mcp-0.1.1/tests/test_file_tool_offload.py +32 -0
- capstone_mcp-0.1.1/tests/test_file_workflow_labels.py +150 -0
- capstone_mcp-0.1.1/tests/test_file_workflows.py +294 -0
- capstone_mcp-0.1.1/tests/test_foreground.py +28 -0
- capstone_mcp-0.1.1/tests/test_full_automation_suite.py +381 -0
- capstone_mcp-0.1.1/tests/test_golden_master.py +473 -0
- capstone_mcp-0.1.1/tests/test_graph_execution.py +129 -0
- capstone_mcp-0.1.1/tests/test_graph_fit.py +129 -0
- capstone_mcp-0.1.1/tests/test_graph_frame_admission.py +71 -0
- capstone_mcp-0.1.1/tests/test_graph_popup_geometry_labels.py +331 -0
- capstone_mcp-0.1.1/tests/test_graph_report.py +279 -0
- capstone_mcp-0.1.1/tests/test_graph_state.py +403 -0
- capstone_mcp-0.1.1/tests/test_graph_toolbar_ownership.py +53 -0
- capstone_mcp-0.1.1/tests/test_graph_toolbox.py +326 -0
- capstone_mcp-0.1.1/tests/test_graph_workflows.py +415 -0
- capstone_mcp-0.1.1/tests/test_graphs.py +359 -0
- capstone_mcp-0.1.1/tests/test_http_lifecycle.py +110 -0
- capstone_mcp-0.1.1/tests/test_instrument_adversarial.py +225 -0
- capstone_mcp-0.1.1/tests/test_instrument_maturity.py +191 -0
- capstone_mcp-0.1.1/tests/test_instruments.py +430 -0
- capstone_mcp-0.1.1/tests/test_ipc_error_contract.py +164 -0
- capstone_mcp-0.1.1/tests/test_job_admission.py +117 -0
- capstone_mcp-0.1.1/tests/test_live_e2e_app.py +442 -0
- capstone_mcp-0.1.1/tests/test_live_smoke.py +213 -0
- capstone_mcp-0.1.1/tests/test_manual_sample_owner.py +88 -0
- capstone_mcp-0.1.1/tests/test_mcp_maturity.py +180 -0
- capstone_mcp-0.1.1/tests/test_native_clipboard.py +50 -0
- capstone_mcp-0.1.1/tests/test_native_p0_regressions.py +147 -0
- capstone_mcp-0.1.1/tests/test_native_runtime.py +56 -0
- capstone_mcp-0.1.1/tests/test_numeric_adapter_bounds.py +59 -0
- capstone_mcp-0.1.1/tests/test_numerics.py +178 -0
- capstone_mcp-0.1.1/tests/test_numerics_adversarial.py +79 -0
- capstone_mcp-0.1.1/tests/test_offline_protocol_p0.py +58 -0
- capstone_mcp-0.1.1/tests/test_oscilloscope_fft.py +459 -0
- capstone_mcp-0.1.1/tests/test_p0_boundaries.py +107 -0
- capstone_mcp-0.1.1/tests/test_packaging_metadata.py +42 -0
- capstone_mcp-0.1.1/tests/test_phase11_ticket1_hazards.py +175 -0
- capstone_mcp-0.1.1/tests/test_phase2_recipes_and_reports.py +237 -0
- capstone_mcp-0.1.1/tests/test_plotting.py +29 -0
- capstone_mcp-0.1.1/tests/test_protocol.py +121 -0
- capstone_mcp-0.1.1/tests/test_recipes.py +515 -0
- capstone_mcp-0.1.1/tests/test_rename_run.py +155 -0
- capstone_mcp-0.1.1/tests/test_repetition.py +179 -0
- capstone_mcp-0.1.1/tests/test_report_input_integrity.py +78 -0
- capstone_mcp-0.1.1/tests/test_reports.py +547 -0
- capstone_mcp-0.1.1/tests/test_resources_offline.py +37 -0
- capstone_mcp-0.1.1/tests/test_run_capture.py +253 -0
- capstone_mcp-0.1.1/tests/test_run_delete.py +85 -0
- capstone_mcp-0.1.1/tests/test_run_visibility.py +288 -0
- capstone_mcp-0.1.1/tests/test_runs.py +201 -0
- capstone_mcp-0.1.1/tests/test_runtime_cancellation.py +63 -0
- capstone_mcp-0.1.1/tests/test_runtime_round2.py +196 -0
- capstone_mcp-0.1.1/tests/test_screenshot.py +69 -0
- capstone_mcp-0.1.1/tests/test_seam_coverage_boost.py +460 -0
- capstone_mcp-0.1.1/tests/test_select_measurement.py +99 -0
- capstone_mcp-0.1.1/tests/test_sensor_settings.py +398 -0
- capstone_mcp-0.1.1/tests/test_sensor_zero.py +202 -0
- capstone_mcp-0.1.1/tests/test_server_contract.py +399 -0
- capstone_mcp-0.1.1/tests/test_session.py +132 -0
- capstone_mcp-0.1.1/tests/test_session_components.py +228 -0
- capstone_mcp-0.1.1/tests/test_signal_generator.py +406 -0
- capstone_mcp-0.1.1/tests/test_smart_triggers.py +308 -0
- capstone_mcp-0.1.1/tests/test_snapshot_filter.py +110 -0
- capstone_mcp-0.1.1/tests/test_spectral_and_weighted_numerics.py +107 -0
- capstone_mcp-0.1.1/tests/test_table_cell_locales.py +13 -0
- capstone_mcp-0.1.1/tests/test_table_display.py +441 -0
- capstone_mcp-0.1.1/tests/test_telemetry_clock.py +77 -0
- capstone_mcp-0.1.1/tests/test_telemetry_history_merge.py +65 -0
- capstone_mcp-0.1.1/tests/test_tool_routers.py +302 -0
- capstone_mcp-0.1.1/tests/test_ui_events.py +90 -0
- capstone_mcp-0.1.1/tests/test_ui_workflow_safety.py +308 -0
- capstone_mcp-0.1.1/tests/test_watcher_safety.py +76 -0
- capstone_mcp-0.1.1/tests/test_wireless_calibration.py +430 -0
- capstone_mcp-0.1.1/tests/test_workbook_layout.py +363 -0
- capstone_mcp-0.1.1/tests/test_worker_stderr.py +157 -0
- capstone_mcp-0.1.1/tests/worker_fixture.py +51 -0
- capstone_mcp-0.1.1/typings/pythoncom.pyi +2 -0
- capstone_mcp-0.1.1/typings/pywinauto/__init__.pyi +10 -0
- capstone_mcp-0.1.1/typings/pywinauto/application.pyi +14 -0
- capstone_mcp-0.1.1/typings/pywinauto/controls/hwndwrapper.pyi +3 -0
- capstone_mcp-0.1.1/typings/pywinauto/controls/uiawrapper.pyi +55 -0
- capstone_mcp-0.1.1/typings/pywinauto/findwindows.pyi +1 -0
- capstone_mcp-0.1.1/typings/win32api.pyi +3 -0
- capstone_mcp-0.1.1/typings/win32clipboard.pyi +7 -0
- capstone_mcp-0.1.1/typings/win32event.pyi +17 -0
- capstone_mcp-0.1.1/typings/win32file.pyi +12 -0
- capstone_mcp-0.1.1/typings/win32gui.pyi +18 -0
- capstone_mcp-0.1.1/typings/win32job.pyi +21 -0
- capstone_mcp-0.1.1/typings/win32process.pyi +1 -0
- capstone_mcp-0.1.1/uv.lock +1504 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Agent Guidelines for capstone-mcp
|
|
2
|
+
|
|
3
|
+
This repository contains the Model Context Protocol (MCP) server for PASCO Capstone automation, experiment data extraction, and numerical analysis.
|
|
4
|
+
|
|
5
|
+
## Development Environment & Commands
|
|
6
|
+
|
|
7
|
+
- Package manager & tool runner: `uv`
|
|
8
|
+
- Run test suite: `uv run --no-sync pytest`
|
|
9
|
+
- Run linter: `uv run --no-sync ruff check src tests`
|
|
10
|
+
- Run type checker: `uv run --no-sync basedpyright src`
|
|
11
|
+
- Python runtime: Python 3.12+ (Windows x64)
|
|
12
|
+
|
|
13
|
+
## Agent Operational Guidelines
|
|
14
|
+
|
|
15
|
+
- **Windows Process Lock Guard**: Always pass `--no-sync` to `uv run` during testing and linting commands to prevent `os error 32` file locking when background MCP server processes hold `capstone-mcp.exe`.
|
|
16
|
+
- **Pre-action Briefing**: Always output a brief 1-2 sentence message explaining what you are about to do before executing commands or launching tool sequences. Never run silent background actions without keeping the user informed.
|
|
17
|
+
- **Direct CLI Invocations**: Use direct binary commands (`uv run ...`, `git ...`, `gh ...`) rather than wrapping inside `powershell -Command "..."` to prevent IDE approval popup loops. On Windows PowerShell, never chain commands with `&&` (syntax error in PowerShell 5.1); execute commands individually or separate statements with `;`.
|
|
18
|
+
- **Language Consistency**: Always communicate with the user in the user's active language (Korean in this project) across all responses, status updates, and code reviews, regardless of English slash command names or skill templates.
|
|
19
|
+
- **Offline Test Guards**: Live desktop GUI tests (e.g. `tests/test_protocol.py`) and external machine-dependent fixtures (e.g. `tests/test_golden_master.py`) must include fallback guards (`pytest.skip` / `pytestmark = pytest.mark.skipif(...)`), ensuring automated test suites pass deterministically in headless/CI environments.
|
|
20
|
+
- **Remote CI Verification (Definition of Done)**: Never report work complete or close a cycle immediately after `git push`. A build or fix is only done when `gh run watch` or `gh run list` explicitly confirms that GitHub Actions CI has finished with `completed: success`.
|
|
21
|
+
- **Branch Hygiene**: Merged or stale feature branches must be deleted locally (`git branch -d`) and on the remote (`git push origin --delete`) before closing a task.
|
|
22
|
+
|
|
23
|
+
## Agent skills
|
|
24
|
+
|
|
25
|
+
### Issue tracker
|
|
26
|
+
|
|
27
|
+
Issues and specs for this repo are tracked on GitHub Issues. See `docs/agents/issue-tracker.md`.
|
|
28
|
+
|
|
29
|
+
### Triage labels
|
|
30
|
+
|
|
31
|
+
Five canonical triage roles mapped to standard GitHub labels (`needs-triage`, `needs-info`, `ready-for-agent`, `ready-for-human`, `wontfix`). See `docs/agents/triage-labels.md`.
|
|
32
|
+
|
|
33
|
+
### Domain docs
|
|
34
|
+
|
|
35
|
+
Single-context repository layout (`GLOSSARY.md`, `docs/adr/`). See `docs/agents/domain.md`.
|
|
36
|
+
|
|
37
|
+
### Architecture & Module Map
|
|
38
|
+
|
|
39
|
+
FastMCP tool routers (`src/capstone_mcp/tools/`), deep graph domain (`src/capstone_mcp/graphs/`), deep run management (`src/capstone_mcp/runs/`), deep numerics (`numerics/`), and unified data sources (`data_sources/`). See `docs/architecture.md`.
|
|
40
|
+
|
|
41
|
+
### Review standards
|
|
42
|
+
|
|
43
|
+
Repo-specific judgement calls and review rules. See `CODING_STANDARDS.md`.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Coding Standards for capstone-mcp
|
|
2
|
+
|
|
3
|
+
This document guides the review agent (`/code-review`) on repo-specific judgement calls that automated linters (`ruff`, `basedpyright`) cannot mechanically enforce.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Protocol Adapter & Error Code Stability
|
|
8
|
+
|
|
9
|
+
- **Immutable Error Codes**: Error codes (`code="..."`) across `native_loop.py`, `automation_models.py`, and domain tool routers are rigid external contracts. Never rename, alter casing, or repurpose existing error codes (e.g., `FRAME_REQUIRED`, `AUTOMATION_ERROR`, `STALE_FRAME`) without a formal ADR and versioned migration plan.
|
|
10
|
+
- **Fail-Fast Input Validation**: Protocol requests must reject missing handles or invalid bounds before dispatching across thread boundaries or waking GUI automation workers.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 2. Tool Router & State Accessor Patterns
|
|
15
|
+
|
|
16
|
+
- **Dynamic Accessors for Mutable Globals**: When domain routers (`src/capstone_mcp/tools/*.py`) register FastMCP tools, mutable server state (such as `AcquisitionJobs` or `AutomationWorker`) must be accessed through dynamic callables (`jobs: Callable[[], AcquisitionJobs] = lambda: JOBS`) rather than static value captures. This guarantees lifecycle resets and test monkeypatching remain fully operational.
|
|
17
|
+
- **Pure Domain Isolation**: Domain routers should contain tool signature adapters and schema annotations only. Numerical algorithms, physics calculations, and data parsing must reside in dedicated deep modules (`numerics/`, `data_sources/`, `tutor/`).
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 3. Headless & Offline Test Guards
|
|
22
|
+
|
|
23
|
+
- **Deterministic CI Execution**: All tests interacting with desktop GUI windows, hardware interfaces, or golden sample fixtures must implement offline fallback guards (`pytest.mark.skipif(...)` or `pytest.skip(...)`), ensuring 100% deterministic test execution in headless environments.
|
|
24
|
+
- **Windows Process Lock Discipline**: Test fixtures that launch or inspect background worker processes must terminate child threads and processes cleanly in `finally` blocks or fixture teardowns.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 4. UI Automation & Display Harness Primitives
|
|
29
|
+
|
|
30
|
+
- **Direct Display Harness Primitives**: UI automation modules (`digits_display.py`, `table_display.py`, `workbook_layout.py`, `runs/manager.py`) must invoke shared display harness primitives (`click_control`, `double_click_control`, `drag_control`, `center_coords`) directly from `capstone_mcp.displays`. Never define one-line forwarding wrapper functions (`_click`, `_click_control`) within individual domain files.
|
|
31
|
+
- **Coordinate Centralization**: Bounding box center calculations must use `center_coords(bounds)` rather than ad-hoc coordinate arithmetic.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 5. Unified Seam Cohesion & No Speculative Generality
|
|
36
|
+
|
|
37
|
+
- **Action Dispatch Completeness**: Unified request models and action enums (`RunRequest`, `RunAction`) must only declare variants actively and immediately handled by the dispatcher. Never introduce speculative enum values or request fields that trigger unhandled branches.
|
|
38
|
+
- **Stateful vs Stateless Boundary**: Multi-cycle, stateful workflows (such as `CaptureSession` or acquisition jobs) must remain encapsulated in dedicated session classes rather than being mixed into discrete, single-shot request/result dispatchers.
|
|
39
|
+
- **Dispatcher Integration Test Synchronization**: When migrating discrete native operations into a unified domain seam (e.g., `manage_instrument` or `manage_graph`), update the dispatch integration suites (`tests/test_full_automation_suite.py`) within the same ticket to mock the unified seam rather than deleted discrete handler functions.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 6. Native Deserialization & Reverse-Engineered Schema Fidelity
|
|
44
|
+
|
|
45
|
+
- **Exact Schema & Tag Preservation**: When decoding native desktop serialization formats (such as Capstone clipboard XML, COM property bags, or binary archive streams), never substitute hypothetical, sanitized, or speculative attribute names (`ActualParameter`, `ZBundleInputIndex`) for verified native identifiers. Always preserve the exact tags, attributes (`BundleMeasID`, `ZCFDICurveFitParameterDefinition`), and boolean representation conventions (`"TRUE"`/`"FALSE"`, `"1"`/`"0"`) discovered from primary sources and IDA disassembly.
|
|
46
|
+
- **Fail-Closed on Unknown Constructs**: Parser logic must validate element counts and schema bounds strictly, raising domain-specific parse errors rather than returning incomplete or corrupted state models.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 7. FastMCP Protocol Envelopes & Backward Compatibility
|
|
51
|
+
|
|
52
|
+
- **Structured Error Envelopes**: Tool execution failures must never leak raw Python exception tracebacks across the protocol boundary. All tool errors must return `CallToolResult(isError=True)` with consistent JSON payloads containing `error_code`, `message`, and actionable `remediation` instructions.
|
|
53
|
+
- **Pydantic Model Field Aliasing**: When refining or deepening field names on public domain models (e.g., `renderers` vs legacy `groups`), always maintain backward compatibility for existing callers and test suites by exposing `@computed_field @property` aliases.
|
|
54
|
+
- **Table-Driven Normalization Pattern**: When supporting ergonomic flat payload arguments alongside nested models on compound requests (e.g., `InstrumentRequest`, `GraphRequest`), use a static table mapping (`_FLAT_FIELD_MAPPINGS`) rather than verbose `if/elif` branches. Populate child model dictionaries strictly when flat arguments are non-empty (`if flat:`) to prevent spurious missing-field validation errors.
|
|
55
|
+
- **FastMCP Tool Handler Mocking Convention**: When writing unit contract tests for registered FastMCP tools, mock execution at the worker boundary (`patch.object(server.WORKER, "call", ...)`) rather than patching `server._native`. Because tool registration captures the `native` callable at startup, patching `server._native` after registration has no effect.
|
|
56
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Domain Glossary
|
|
2
|
+
|
|
3
|
+
Domain concepts and terms used across the `capstone-mcp` project.
|
|
4
|
+
|
|
5
|
+
### Capstone
|
|
6
|
+
The official PASCO Capstone Windows desktop application used for physics and science experimentation, sensor data collection, and graphing.
|
|
7
|
+
|
|
8
|
+
### Run (회차)
|
|
9
|
+
A single execution or trial of data recording within an experiment. Named sequentially by default (`Run #1`, `Run #2`) in the Data Summary tree.
|
|
10
|
+
|
|
11
|
+
### Data Summary
|
|
12
|
+
The panel in Capstone listing connected interfaces, sensors, available runs, and their constituent datasets.
|
|
13
|
+
|
|
14
|
+
### Calculator
|
|
15
|
+
The formula creation and calculation workspace in Capstone where mathematical expressions and variable relationships (e.g., `[Position (m)]`) are defined.
|
|
16
|
+
|
|
17
|
+
### Dataset
|
|
18
|
+
A column or array of numeric data points (such as Time, Voltage, Current, Position) produced by a sensor or formula for a specific Run.
|
|
19
|
+
|
|
20
|
+
### Scale to Fit
|
|
21
|
+
The graph tool in Capstone that automatically adjusts the X and Y axis bounds to fully display all visible data points.
|
|
22
|
+
|
|
23
|
+
### Graph
|
|
24
|
+
The primary 2D data visualization display in Capstone displaying continuous or discrete measurements along horizontal and vertical axes, supporting curve fitting and toolbox tools.
|
|
25
|
+
|
|
26
|
+
### Curve Fit
|
|
27
|
+
Mathematical model fitting (Linear, Quadratic, Polynomial, Sine, etc.) applied to experimental data points in a graph to extract physical parameters.
|
|
28
|
+
|
|
29
|
+
### Toolbox
|
|
30
|
+
The Qt-based floating smart toolbar (`ZSmartToolBox`) positioned over a graph display, housing tools for delta coordinates, statistics, area integration, and auto-scaling.
|
|
31
|
+
|
|
32
|
+
### CDP (Chrome DevTools Protocol)
|
|
33
|
+
The WebSocket debugging protocol exposed by Capstone's internal QtWebEngine / Chromium instance on port 9222, providing high-speed telemetry and direct JavaScript/C++ RPC inspection.
|
|
34
|
+
|
|
35
|
+
### QWebChannel
|
|
36
|
+
Qt's IPC bridge bridging native C++ objects (`javascriptBridge`) with the embedded webview, hosting 53 native RPC methods under `window.app.mSenseAndControlView.mServices`.
|
|
37
|
+
|
|
38
|
+
### UnifiedSessionManager
|
|
39
|
+
Central coordinator in `capstone_mcp.session` managing desktop UIA interactions and high-speed CDP WebSocket telemetry (< 15 ms).
|
|
40
|
+
|
|
41
|
+
### Fast-Path Telemetry
|
|
42
|
+
Direct WebSocket polling for sensor inventories and instantaneous values without UI automation overhead.
|
|
43
|
+
|
|
44
|
+
### Stop Condition Trigger
|
|
45
|
+
Automated threshold monitor halting data recording when sensor values exceed or cross specified mathematical boundaries (`StopCondition`).
|
|
46
|
+
|
|
47
|
+
### UI Escape Hatch (`capstone_interact_ui`)
|
|
48
|
+
Consolidated fallback tool providing raw mouse and keyboard UIA activations across invoke, click, drag, scroll, and key typing without polluting the top-level tool catalog.
|
|
49
|
+
|
|
50
|
+
### Live URI
|
|
51
|
+
A URI scheme (`live://measurements`, `live://table`) enabling callers to query real-time sensor streams and display tables through the unified `data_sources` seam without knowing transport details.
|
|
52
|
+
|
|
53
|
+
### Compound Seam
|
|
54
|
+
A high-depth module interface (such as `manage_display` or `manage_instrument`) consolidating multiple domain actions behind a single parameter-driven entry point, eliminating shallow pass-through wrappers.
|
|
55
|
+
|
|
56
|
+
### ICapstoneBackend & InMemoryFakeBackend
|
|
57
|
+
The decoupled backend protocol interface and in-memory test implementation emulating Capstone's 53 native QWebChannel RPC methods and state transitions deterministically in CI/headless environments without live GUI dependencies.
|
|
58
|
+
|
|
59
|
+
### NativeDesktop Runtime
|
|
60
|
+
The decomposed STA automation core in `capstone_mcp.native.runtime`, separating process discovery, window focusing, and input dispatch from the outer event loop and IPC layer.
|
|
61
|
+
|
|
62
|
+
### Tool Annotations (4-Hint Conformance)
|
|
63
|
+
Explicit boolean declarations across all four MCP hints (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) on every FastMCP tool, strictly conforming to m8ven and OpenAI registry standards.
|
|
64
|
+
|
|
65
|
+
### Live Runtime Blind Spot
|
|
66
|
+
The deceptive discrepancy where automated test suites pass completely (e.g. 570 green unit tests) against mock backends (`InMemoryFakeBackend`, `MagicMock`), while masking real runtime failure modes on live Windows OS environments (clipboard hijacking, UI race conditions, locale mismatch, and dropped keystrokes).
|
|
67
|
+
|
|
68
|
+
### Zero OS Pollution
|
|
69
|
+
The architectural principle strictly prohibiting MCP servers from modifying, capturing, or corrupting external operating system global states (such as Windows clipboard, system mouse focus, or unmanaged temp files) during tool execution.
|
|
70
|
+
|
|
71
|
+
### Bi-furcated Exception Contract
|
|
72
|
+
The error handling rule strictly distinguishing safe inspection probing (`contextlib.suppress` allowed only for checking optional interfaces/attributes) from state-mutating actions (clicks, drags, keystrokes, deletes), requiring all mutating action failures to fail fast with explicit domain errors (`AutomationError`).
|
|
73
|
+
|
|
74
|
+
### Locale Decoupling
|
|
75
|
+
Elimination of UI text-based control queries (e.g. `"File"`, `"Select All"`, `"Export"`) in favor of language-neutral UIA `AutomationId` selectors backed by centralized multi-language resource dictionaries (`LocaleTable`).
|
|
76
|
+
|
|
77
|
+
### Direct Synthesis Path
|
|
78
|
+
Bypassing brittle UI automation macros by programmatically generating or patching `.cap` compound archives (ZIP + XML) and directly invoking QWebChannel C++ RPC slots over CDP WebSockets.
|
|
79
|
+
|
|
80
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Capstone MCP contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Mission: University Physics Laboratory Mastery with PASCO Capstone & MCP Automation
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
Master classical and modern physics experimental principles by combining hands-on PASCO Capstone data acquisition with AI-guided computational analysis. Build the capability to automate instrument control, extract real-time experimental data, and generate publication-quality scientific reports with rigorous statistical and error analyses.
|
|
5
|
+
|
|
6
|
+
## Success looks like
|
|
7
|
+
- Autonomously configure Capstone hardware interfaces (850 Universal Interface, Smart Cart, Photogates, Signal Generators) for 5 canonical experiments.
|
|
8
|
+
- Execute automated measurement workflows (frequency sweeps, stopping voltage detection, cyclic P-V area integration).
|
|
9
|
+
- Derive fundamental physical constants (Planck's constant $h$, resonant frequency $f_0$, adiabatic index $\gamma$, slit dimensions $a, d$) within 5% of theoretical values.
|
|
10
|
+
- Produce comprehensive laboratory reports adhering to peer-reviewed publication standards.
|
|
11
|
+
|
|
12
|
+
## Constraints
|
|
13
|
+
- Windows x64 laboratory workstation with PASCO Capstone installed.
|
|
14
|
+
- Must operate deterministically in headless/CI test environments when physical hardware is disconnected.
|
|
15
|
+
- Primary source laboratory manuals in Korean (.hwp, .docx, .pdf) serve as the ground truth.
|
|
16
|
+
|
|
17
|
+
## Out of scope
|
|
18
|
+
- Hardware component soldering or PCB electrical repairs.
|
|
19
|
+
- Proprietary PASCO firmware flashing outside standard Capstone software controls.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: capstone-mcp
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Cross-platform physics analysis and Windows UI automation MCP for PASCO Capstone
|
|
5
|
+
Project-URL: Homepage, https://github.com/ji5zi5/capstone-mcp
|
|
6
|
+
Project-URL: Repository, https://github.com/ji5zi5/capstone-mcp
|
|
7
|
+
Project-URL: Issues, https://github.com/ji5zi5/capstone-mcp/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/ji5zi5/capstone-mcp/blob/main/docs/usage.md
|
|
9
|
+
Author: ji5zi5
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: automation,capstone,lab,mcp,pasco,physics
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Education
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: MacOS
|
|
18
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
19
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
23
|
+
Requires-Python: >=3.12
|
|
24
|
+
Requires-Dist: anyio<5,>=4
|
|
25
|
+
Requires-Dist: defusedxml<0.8,>=0.7.1
|
|
26
|
+
Requires-Dist: httpx2[brotli,http2,zstd]
|
|
27
|
+
Requires-Dist: mcp<2,>=1.20
|
|
28
|
+
Requires-Dist: pillow>=11
|
|
29
|
+
Requires-Dist: psutil<9,>=7
|
|
30
|
+
Requires-Dist: pydantic<3,>=2
|
|
31
|
+
Requires-Dist: pywin32>=305; sys_platform == 'win32'
|
|
32
|
+
Requires-Dist: pywinauto<0.7,>=0.6.9; sys_platform == 'win32'
|
|
33
|
+
Requires-Dist: websockets<18,>=15
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
<!-- mcp-name: io.github.ji5zi5/capstone-mcp -->
|
|
37
|
+
|
|
38
|
+
<h1 align="center">PASCO Capstone MCP</h1>
|
|
39
|
+
|
|
40
|
+
<p align="center">AI와 대화하며 Capstone 실험을 조작하고 데이터를 분석하세요.</p>
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<a href="https://github.com/ji5zi5/capstone-mcp/actions/workflows/ci.yml"><img src="https://github.com/ji5zi5/capstone-mcp/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
44
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
|
|
45
|
+
<img src="https://img.shields.io/badge/python-3.12%2B-blue.svg" alt="Python 3.12+">
|
|
46
|
+
</p>
|
|
47
|
+
|
|
48
|
+
<p align="center"><strong>한국어</strong> · <a href="README.en.md">English</a></p>
|
|
49
|
+
|
|
50
|
+
<p align="center">
|
|
51
|
+
<a href="#시작하기">시작하기</a> ·
|
|
52
|
+
<a href="#이렇게-요청하세요">사용 예시</a> ·
|
|
53
|
+
<a href="docs/usage.md">상세 사용 가이드</a> ·
|
|
54
|
+
<a href="PRIVACY.md">개인정보 보호정책</a>
|
|
55
|
+
</p>
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
PASCO Capstone MCP는 AI 클라이언트에서 **PASCO Capstone 화면 조작, `.cap`/CSV 실험 파일 추출, 물리 수치 분석 및 보고서 생성**을 사용할 수 있게 해 주는 비공식 MCP 서버입니다. MCP(Model Context Protocol)를 통해 AI가 로컬 환경의 도구를 호출합니다.
|
|
60
|
+
|
|
61
|
+
- **오프라인 분석 (크로스플랫폼: Windows / macOS / Linux)**: `.cap`·CSV 파일 읽기, 수치 회귀, 스펙트럼 분석, 물리 실험 계산 및 Markdown/HTML 보고서 생성은 **Capstone 앱 없이** 어떤 OS에서도 바로 실행됩니다.
|
|
62
|
+
- **실시간 앱 제어 (Windows 전용)**: Capstone 창 제어, 파일 열기/저장/내보내기, 그래프/계산기 조작 및 센서 실시간 조회는 Windows에서 PASCO Capstone을 실행해 연동합니다.
|
|
63
|
+
|
|
64
|
+
## 무엇을 할 수 있나요?
|
|
65
|
+
|
|
66
|
+
| 작업 | 제공 기능 |
|
|
67
|
+
| :--- | :--- |
|
|
68
|
+
| 실험 파일 분석 | `.cap` 설정·데이터셋·회차·단위·저장 그래프를 추출하고, CSV의 strict ISO 8601 벽시계 시간축·원점·단위를 안전하게 파싱합니다. |
|
|
69
|
+
| 수치·스펙트럼 분석 | 짝지은 표본 산점도, 일반/가중 선형 회귀, Cook's distance, Hann/직사각 창 FFT 전력 스펙트럼 및 회차 비교를 수행합니다. |
|
|
70
|
+
| Capstone 앱 조작 | 창·컨트롤 조회, 스크린샷, 안전 모달/업데이트 팝업 가드, Windows 11 파일 열기/저장/CSV 내보내기를 지원합니다. |
|
|
71
|
+
| 그래프·디스플레이·계산기 | 그래프(축·23종 피팅·`Copy Display` 클립보드 소유권 검증), 페이지/표/Digits/Scope/FFT 배치 및 계산기(`CalcEntryWidget`) 수식·단위 등록을 지원합니다. |
|
|
72
|
+
| 센서·기록 | 로컬 CDP(`127.0.0.1:9222`) 기반 센서·측정량 읽기, 샘플링 속도·타이머 조건·수동 표본 요청을 지원합니다. (물리 850/550 장비 제어는 실장비 검증 필요) |
|
|
73
|
+
| 물리 실험·보고서 | 광전효과·편광(Malus 법칙)·RLC·강제진동·단열기체·단일/이중 슬릿 회절(GUM 불확도 포함)을 분석하고 Markdown·HTML 보고서를 생성합니다. |
|
|
74
|
+
|
|
75
|
+
## 시작하기
|
|
76
|
+
|
|
77
|
+
### 1. 설치
|
|
78
|
+
|
|
79
|
+
Git, [uv](https://docs.astral.sh/uv/), Python 3.12+ 및 MCP 호환 AI 클라이언트가 필요합니다.
|
|
80
|
+
|
|
81
|
+
실시간 데스크톱 앱 제어를 사용하려면 Windows에 PASCO Capstone이 설치되어 있어야 합니다. 기본 탐색 경로는 다음과 같으며, 다른 경로에 설치한 경우 환경 변수 `CAPSTONE_EXECUTABLE`에 절대 `.exe` 경로를 지정할 수 있습니다.
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
C:/Program Files/PASCO scientific/Capstone/Capstone.exe
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
저장소를 내려받고 의존성을 설치합니다.
|
|
88
|
+
|
|
89
|
+
```powershell
|
|
90
|
+
git clone https://github.com/ji5zi5/capstone-mcp.git
|
|
91
|
+
cd capstone-mcp
|
|
92
|
+
uv sync --python 3.12
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 2. AI 클라이언트에 연결
|
|
96
|
+
|
|
97
|
+
클라이언트의 MCP 설정에 다음 항목을 추가합니다. `C:/Projects/capstone-mcp`는 저장소를 내려받은 **실제 폴더의 절대 경로**로 바꾸세요.
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"mcpServers": {
|
|
102
|
+
"capstone": {
|
|
103
|
+
"command": "uv",
|
|
104
|
+
"args": [
|
|
105
|
+
"--directory", "C:/Projects/capstone-mcp",
|
|
106
|
+
"run", "--no-sync", "capstone-mcp"
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
설정을 적용하거나 클라이언트를 다시 시작한 뒤 `capstone_file_datasets`, `capstone_manage_graph` 등 22개 도구가 표시되는지 확인하세요. 클라이언트가 `stdio` 프로세스를 직접 띄우므로 별도 터미널을 열어 둘 필요가 없습니다.
|
|
114
|
+
|
|
115
|
+
<details>
|
|
116
|
+
<summary><strong>Streamable HTTP 모드로 연결하기</strong></summary>
|
|
117
|
+
|
|
118
|
+
저장소 폴더에서 HTTP 서버를 실행합니다.
|
|
119
|
+
|
|
120
|
+
```powershell
|
|
121
|
+
uv run --no-sync capstone-mcp-http
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
클라이언트에 `http://127.0.0.1:8766/mcp` 주소를 등록하고 실행 터미널을 유지하세요. 서버는 로컬 루프백(`127.0.0.1`)에서만 수신합니다. 자세한 옵션은 [사용 가이드](docs/usage.md#http-연결)를 참고하세요.
|
|
125
|
+
|
|
126
|
+
</details>
|
|
127
|
+
|
|
128
|
+
### 3. 첫 작업 요청
|
|
129
|
+
|
|
130
|
+
AI 클라이언트의 채팅창에서 로컬 경로를 지정해 요청하세요.
|
|
131
|
+
|
|
132
|
+
> `C:/Experiments/momentum.cap`에 어떤 데이터가 있는지 보여 줘. 각 데이터셋의 이름, 단위 정보, 샘플 수를 정리해 줘.
|
|
133
|
+
|
|
134
|
+
앱을 조작하려면 먼저 Capstone에서 실험을 열고 “실행 중인 Capstone에 연결해서 현재 창을 확인해 줘”라고 요청하세요.
|
|
135
|
+
|
|
136
|
+
## 이렇게 요청하세요
|
|
137
|
+
|
|
138
|
+
- **저장된 실험** — “이 파일의 회차와 단위를 확인하고, 시간과 속도가 함께 기록된 회차의 처음 20개 표본을 보여 줘.”
|
|
139
|
+
- **그래프** — “저장된 두 번째 그래프에서 축, 회차, 피팅 계수를 읽어 줘.” 열린 그래프 변경 시에는 현재 창을 먼저 관찰한 뒤 네이티브 피팅 상태를 재확인합니다.
|
|
140
|
+
- **저장 전 내보내기** — “열린 실험을 새 파일 `C:/Experiments/current.csv`로 내보내고 처음 20행을 보여 줘.”
|
|
141
|
+
- **편광·회절 분석** — “측정한 각도(`deg`)와 광량 배열로 말뤼스 법칙(`cos²θ`) 피팅을 수행하고 HTML 보고서를 만들어 줘.”
|
|
142
|
+
- **실시간 센서** — “현재 연결된 힘 센서의 측정값과 단위를 확인해 줘.” 실시간 조회에는 같은 Capstone 프로세스의 로컬 디버깅 포트가 필요합니다. [설정 방법](docs/usage.md#실시간-조회)
|
|
143
|
+
|
|
144
|
+
## 알아두기
|
|
145
|
+
|
|
146
|
+
- UI 조작 시 Capstone 창이 앞으로 나올 수 있으므로 잠금이 해제된 데스크톱에서 사용하세요. 백그라운드 실행 중인 MCP 프로세스 lock을 피하려면 CLI 테스트/실행 시 `uv run --no-sync` 옵션을 권장합니다.
|
|
147
|
+
- 저장·내보내기는 기존 파일을 절대 덮어쓰지 않습니다. CSV는 화면 표시 정밀도를 따르므로 저장된 원본 수치가 필요하면 `.cap` 파일에서 추출하세요.
|
|
148
|
+
- 저장 그래프는 파일에서 읽고, 미저장 그래프는 `Copy Display` 클립보드 소유자·세대를 검증해 지원 형식을 복원합니다.
|
|
149
|
+
- Capstone `2.13.4` + Windows 11 기준으로 무센서 실기 E2E 검증을 마쳤으나, `.PageView` 내부 Table/Digits 커스텀 렌더링과 물리 850/550 하드웨어 연동은 UIA 노출 및 장비 미보유 한계에 따라 제한·미검증 상태로 남습니다.
|
|
150
|
+
|
|
151
|
+
도구별 호출 스키마, 실시간 조회 설정, 오류 코드는 **[상세 사용 가이드](docs/usage.md)**에서 확인할 수 있습니다.
|
|
152
|
+
|
|
153
|
+
## 개발 및 검증
|
|
154
|
+
|
|
155
|
+
```powershell
|
|
156
|
+
uv run --no-sync ruff check src tests
|
|
157
|
+
uv run --no-sync basedpyright src
|
|
158
|
+
uv run --no-sync pytest -q
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## 개인정보 보호정책 (Privacy Policy)
|
|
162
|
+
|
|
163
|
+
`capstone-mcp`는 사용자 PC에서 100% 로컬로 실행되며 외부 서버로 원격 분석·실험 파일·화면 데이터를 전송하지 않습니다. 자세한 내용은 [PRIVACY.md](PRIVACY.md)를 참고하세요.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Privacy Policy
|
|
2
|
+
|
|
3
|
+
`capstone-mcp` is an open-source, locally executed Model Context Protocol (MCP) server for PASCO Capstone automation, experiment file inspection, and physics data analysis.
|
|
4
|
+
|
|
5
|
+
## Data Processing & Local Execution
|
|
6
|
+
|
|
7
|
+
- **100% Local Operation**: All file inspection (`.cap`, `.csv`), numerical analysis, report generation, and PASCO Capstone UI/bridge automation run strictly on your local machine.
|
|
8
|
+
- **No External Telemetry or Analytics**: `capstone-mcp` does not collect, store, transmit, or share user data, experiment files, screenshots, or usage telemetry with external servers or third parties.
|
|
9
|
+
- **Loopback Communication Only**: Network communication is limited to local loopback (`127.0.0.1`) connections to your locally running PASCO Capstone Qt debug port (for live sensor polling when enabled) or the optional local HTTP MCP transport (`capstone-mcp-http`).
|
|
10
|
+
- **Explicit File Scope**: File reads, writes, and CSV exports only access paths explicitly requested by the connected MCP client and never overwrite existing files.
|
|
11
|
+
|
|
12
|
+
## Contact & Issues
|
|
13
|
+
|
|
14
|
+
If you have privacy or security questions, please open an issue at https://github.com/ji5zi5/capstone-mcp/issues.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<!-- mcp-name: io.github.ji5zi5/capstone-mcp -->
|
|
2
|
+
|
|
3
|
+
<h1 align="center">PASCO Capstone MCP</h1>
|
|
4
|
+
|
|
5
|
+
<p align="center">Control Capstone experiments and analyze physics data through your AI assistant.</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://github.com/ji5zi5/capstone-mcp/actions/workflows/ci.yml"><img src="https://github.com/ji5zi5/capstone-mcp/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
9
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
|
|
10
|
+
<img src="https://img.shields.io/badge/python-3.12%2B-blue.svg" alt="Python 3.12+">
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center"><a href="README.md">한국어</a> · <strong>English</strong></p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="#getting-started">Getting started</a> ·
|
|
17
|
+
<a href="#example-requests">Example requests</a> ·
|
|
18
|
+
<a href="docs/usage.md">User guide (Korean)</a> ·
|
|
19
|
+
<a href="PRIVACY.md">Privacy Policy</a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
PASCO Capstone MCP is an unofficial Model Context Protocol (MCP) server for **operating PASCO Capstone, extracting `.cap`/CSV experiment data, running numerical/spectral analysis, and generating physics lab reports**.
|
|
25
|
+
|
|
26
|
+
- **Offline file & physics analysis (cross-platform: Windows / macOS / Linux)**: Reading `.cap` archives and CSV files, linear/weighted regression, FFT power spectra, experiment recipes, and Markdown/HTML reports run on any OS without launching Capstone.
|
|
27
|
+
- **Live desktop automation (Windows only)**: Window control, file Open/Save/CSV export, graph/calculator automation, and live sensor polling integrate with PASCO Capstone running on Windows.
|
|
28
|
+
|
|
29
|
+
## What can it do?
|
|
30
|
+
|
|
31
|
+
| Task | Capabilities |
|
|
32
|
+
| :--- | :--- |
|
|
33
|
+
| Read saved experiments | Inspect settings, runs, units, and saved graphs in `.cap` files, and parse strict ISO 8601 CSV time axes safely. |
|
|
34
|
+
| Analyze measurements | Plot paired samples, run OLS and inverse-variance weighted linear regression, Cook's distance, and Hann/rectangular FFT power spectra. |
|
|
35
|
+
| Operate Capstone UI | Inspect windows/controls, capture screenshots, dismiss delayed software update prompts safely, and drive Windows 11 Open/Save/Export dialogs. |
|
|
36
|
+
| Displays & calculator | Manage graphs (axes, 23 built-in fits, ownership-checked `Copy Display`), pages/tables/Digits/Scope/FFT layouts, and `CalcEntryWidget` formulas & units. |
|
|
37
|
+
| Work with instruments | Poll live sensor/measurement channels over local CDP (`127.0.0.1:9222`), configure rates, timers, or manual samples. (Physical 850/550 equipment requires real-device verification.) |
|
|
38
|
+
| Analyze physics experiments | Analyze photoelectric, polarization (Malus's law), RLC, forced oscillation, adiabatic gas, and single/double-slit diffraction (with GUM uncertainty) data, and render Markdown/HTML lab reports. |
|
|
39
|
+
|
|
40
|
+
## Getting started
|
|
41
|
+
|
|
42
|
+
### 1. Install
|
|
43
|
+
|
|
44
|
+
You need Git, [uv](https://docs.astral.sh/uv/), Python 3.12+, and an MCP-compatible AI client.
|
|
45
|
+
|
|
46
|
+
To drive the live desktop app, PASCO Capstone must be installed on Windows. By default the server looks for Capstone at the standard install path below; set `CAPSTONE_EXECUTABLE` to an absolute `.exe` path to override it:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
C:/Program Files/PASCO scientific/Capstone/Capstone.exe
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Clone the repository and install dependencies:
|
|
53
|
+
|
|
54
|
+
```powershell
|
|
55
|
+
git clone https://github.com/ji5zi5/capstone-mcp.git
|
|
56
|
+
cd capstone-mcp
|
|
57
|
+
uv sync --python 3.12
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 2. Connect your AI client
|
|
61
|
+
|
|
62
|
+
Add this entry to your client's MCP configuration. Replace `C:/Projects/capstone-mcp` with the **absolute path to your local clone**:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"mcpServers": {
|
|
67
|
+
"capstone": {
|
|
68
|
+
"command": "uv",
|
|
69
|
+
"args": [
|
|
70
|
+
"--directory", "C:/Projects/capstone-mcp",
|
|
71
|
+
"run", "--no-sync", "capstone-mcp"
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Apply the configuration or restart the client and verify that the 22 `capstone_*` tools (such as `capstone_file_datasets` and `capstone_manage_graph`) appear. Your client launches the `stdio` server automatically.
|
|
79
|
+
|
|
80
|
+
<details>
|
|
81
|
+
<summary><strong>Using Streamable HTTP instead</strong></summary>
|
|
82
|
+
|
|
83
|
+
Run the HTTP server from the repository folder:
|
|
84
|
+
|
|
85
|
+
```powershell
|
|
86
|
+
uv run --no-sync capstone-mcp-http
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Register `http://127.0.0.1:8766/mcp` as the MCP server URL in your client and keep the terminal running. The server listens strictly on local loopback (`127.0.0.1`). See the [user guide (Korean)](docs/usage.md#http-연결) for details.
|
|
90
|
+
|
|
91
|
+
</details>
|
|
92
|
+
|
|
93
|
+
### 3. Try your first request
|
|
94
|
+
|
|
95
|
+
Ask your assistant to inspect a local experiment file:
|
|
96
|
+
|
|
97
|
+
> Show me the datasets in `C:/Experiments/momentum.cap`, including their names, unit information, and sample counts.
|
|
98
|
+
|
|
99
|
+
To operate the live app on Windows, open an experiment in Capstone and ask: “Connect to the running Capstone app and show me its current windows.”
|
|
100
|
+
|
|
101
|
+
## Example requests
|
|
102
|
+
|
|
103
|
+
- **Saved experiment** — “Show the runs and units, then give me the first 20 paired time and velocity samples from a recorded run.”
|
|
104
|
+
- **Graphs** — “Read the axes, run and fit coefficients from the second saved graph.” When changing an open graph, observe the window first and verify native fit status afterward.
|
|
105
|
+
- **Export before saving** — “Export this experiment to a new file, `C:/Experiments/current.csv`, and show the first 20 rows.”
|
|
106
|
+
- **Polarization / diffraction** — “Fit Malus’s law (`cos²θ`) to my angle (`deg`) and intensity arrays and generate an HTML lab report.”
|
|
107
|
+
- **Live readings** — “Read the current value and unit from the connected force sensor.” Live measurement polling requires the Capstone process to expose the local debugging port. [Setup in Korean](docs/usage.md#실시간-조회)
|
|
108
|
+
|
|
109
|
+
## Things to know
|
|
110
|
+
|
|
111
|
+
- UI automation may bring Capstone to the foreground. Use an unlocked Windows desktop and avoid simultaneous control from multiple clients. Pass `--no-sync` to `uv run` if another background `capstone-mcp` process holds a lock on Windows.
|
|
112
|
+
- Saving and exporting never overwrite existing files. CSV exports follow Capstone's display precision; extract from `.cap` archives when full stored numerical precision is required.
|
|
113
|
+
- Read saved graphs directly from `.cap` files. For unsaved graphs, the server verifies clipboard ownership and generation around native `Copy Display` and restores prior clipboard formats.
|
|
114
|
+
- Sensorless live workflows are verified on PASCO Capstone `2.13.4` + Windows 11, while custom-rendered `.PageView` Table/Digits internals and physical PASCO 850/550 hardware acquisition remain bounded by UIA exposure and hardware availability.
|
|
115
|
+
|
|
116
|
+
Detailed tool references and troubleshooting are in the **[user guide (Korean)](docs/usage.md)**.
|
|
117
|
+
|
|
118
|
+
## Development & checks
|
|
119
|
+
|
|
120
|
+
```powershell
|
|
121
|
+
uv run --no-sync ruff check src tests
|
|
122
|
+
uv run --no-sync basedpyright src
|
|
123
|
+
uv run --no-sync pytest -q
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Privacy Policy
|
|
127
|
+
|
|
128
|
+
`capstone-mcp` executes strictly on your local machine without telemetry or third-party data transmission. See [PRIVACY.md](PRIVACY.md) for details.
|