doricomcp 0.1.0__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.
Files changed (98) hide show
  1. doricomcp-0.1.0/.github/workflows/ci.yml +17 -0
  2. doricomcp-0.1.0/.github/workflows/release.yml +89 -0
  3. doricomcp-0.1.0/.gitignore +15 -0
  4. doricomcp-0.1.0/.mcp.json +8 -0
  5. doricomcp-0.1.0/CONTRIBUTING.md +89 -0
  6. doricomcp-0.1.0/LICENSE +21 -0
  7. doricomcp-0.1.0/PKG-INFO +249 -0
  8. doricomcp-0.1.0/README.md +229 -0
  9. doricomcp-0.1.0/docs/dorico-behaviour.md +34 -0
  10. doricomcp-0.1.0/docs/popovers.md +983 -0
  11. doricomcp-0.1.0/doricomcp/__init__.py +0 -0
  12. doricomcp-0.1.0/doricomcp/analysis.py +161 -0
  13. doricomcp-0.1.0/doricomcp/bridge.py +153 -0
  14. doricomcp-0.1.0/doricomcp/catalog.py +154 -0
  15. doricomcp-0.1.0/doricomcp/confirm.py +684 -0
  16. doricomcp-0.1.0/doricomcp/data/commands.json +14827 -0
  17. doricomcp-0.1.0/doricomcp/data/commands_not_in_getcommands.json +123 -0
  18. doricomcp-0.1.0/doricomcp/data/confirmed.json +436 -0
  19. doricomcp-0.1.0/doricomcp/data/enums.json +15970 -0
  20. doricomcp-0.1.0/doricomcp/data/library/library_collections.json +58 -0
  21. doricomcp-0.1.0/doricomcp/data/library/library_kAccidentalDefinitionCollection.json +272 -0
  22. doricomcp-0.1.0/doricomcp/data/library/library_kAccidentalSystemCollection.json +32 -0
  23. doricomcp-0.1.0/doricomcp/data/library/library_kBLOBEntityCollection.json +7 -0
  24. doricomcp-0.1.0/doricomcp/data/library/library_kBrushStyleCollection.json +16 -0
  25. doricomcp-0.1.0/doricomcp/data/library/library_kCharacterStyleCollection.json +20 -0
  26. doricomcp-0.1.0/doricomcp/data/library/library_kChordDiagramCollection.json +1924 -0
  27. doricomcp-0.1.0/doricomcp/data/library/library_kChordSymbolAppearanceCollection.json +7 -0
  28. doricomcp-0.1.0/doricomcp/data/library/library_kChordSymbolAppearanceComponentCollection.json +1568 -0
  29. doricomcp-0.1.0/doricomcp/data/library/library_kChordSymbolComponentKerningPairsCollection.json +24 -0
  30. doricomcp-0.1.0/doricomcp/data/library/library_kClefCollection.json +112 -0
  31. doricomcp-0.1.0/doricomcp/data/library/library_kCompositeCollection.json +7200 -0
  32. doricomcp-0.1.0/doricomcp/data/library/library_kCustomChordDataCollection.json +7 -0
  33. doricomcp-0.1.0/doricomcp/data/library/library_kDrawingPrimitiveCollection.json +12 -0
  34. doricomcp-0.1.0/doricomcp/data/library/library_kDrumKitNoteMapCollection.json +136 -0
  35. doricomcp-0.1.0/doricomcp/data/library/library_kEnsembleCollection.json +140 -0
  36. doricomcp-0.1.0/doricomcp/data/library/library_kExpressionMapCollection.json +172 -0
  37. doricomcp-0.1.0/doricomcp/data/library/library_kFlagCollection.json +168 -0
  38. doricomcp-0.1.0/doricomcp/data/library/library_kFlagSetCollection.json +16 -0
  39. doricomcp-0.1.0/doricomcp/data/library/library_kFontStyleCollection.json +256 -0
  40. doricomcp-0.1.0/doricomcp/data/library/library_kFrettedInstrumentDataCollection.json +220 -0
  41. doricomcp-0.1.0/doricomcp/data/library/library_kGlyphPrimitiveCollection.json +5892 -0
  42. doricomcp-0.1.0/doricomcp/data/library/library_kGraphicPrimitiveCollection.json +7 -0
  43. doricomcp-0.1.0/doricomcp/data/library/library_kInstrumentCollection.json +2504 -0
  44. doricomcp-0.1.0/doricomcp/data/library/library_kInstrumentFamilyCollection.json +56 -0
  45. doricomcp-0.1.0/doricomcp/data/library/library_kInstrumentNameCollection.json +12 -0
  46. doricomcp-0.1.0/doricomcp/data/library/library_kInstrumentScoreOrderCollection.json +20 -0
  47. doricomcp-0.1.0/doricomcp/data/library/library_kLineAnnotationCollection.json +84 -0
  48. doricomcp-0.1.0/doricomcp/data/library/library_kLineBodyStyleCollection.json +144 -0
  49. doricomcp-0.1.0/doricomcp/data/library/library_kLineStyleCollection.json +192 -0
  50. doricomcp-0.1.0/doricomcp/data/library/library_kMultiSegmentLineCollection.json +12 -0
  51. doricomcp-0.1.0/doricomcp/data/library/library_kNoteheadCollection.json +856 -0
  52. doricomcp-0.1.0/doricomcp/data/library/library_kNoteheadSetCollection.json +156 -0
  53. doricomcp-0.1.0/doricomcp/data/library/library_kOrnamentCollection.json +188 -0
  54. doricomcp-0.1.0/doricomcp/data/library/library_kOttavaLineCollection.json +36 -0
  55. doricomcp-0.1.0/doricomcp/data/library/library_kPageDimensionsPresetCollection.json +84 -0
  56. doricomcp-0.1.0/doricomcp/data/library/library_kPagePairDefinitionSetCollection.json +16 -0
  57. doricomcp-0.1.0/doricomcp/data/library/library_kParagraphStyleCollection.json +156 -0
  58. doricomcp-0.1.0/doricomcp/data/library/library_kPenStyleCollection.json +16 -0
  59. doricomcp-0.1.0/doricomcp/data/library/library_kPercussionInstrumentDataCollection.json +100 -0
  60. doricomcp-0.1.0/doricomcp/data/library/library_kPercussionKitDefinitionCollection.json +116 -0
  61. doricomcp-0.1.0/doricomcp/data/library/library_kPlayingTechniqueAppearanceCollection.json +1238 -0
  62. doricomcp-0.1.0/doricomcp/data/library/library_kPlayingTechniqueCollection.json +1200 -0
  63. doricomcp-0.1.0/doricomcp/data/library/library_kRepeatableCompositeCollection.json +408 -0
  64. doricomcp-0.1.0/doricomcp/data/library/library_kRestCollection.json +72 -0
  65. doricomcp-0.1.0/doricomcp/data/library/library_kRestSetCollection.json +20 -0
  66. doricomcp-0.1.0/doricomcp/data/library/library_kRhythmicFeelCollection.json +52 -0
  67. doricomcp-0.1.0/doricomcp/data/library/library_kTemperamentDefinitionCollection.json +28 -0
  68. doricomcp-0.1.0/doricomcp/data/library/library_kTempoPresetCollection.json +320 -0
  69. doricomcp-0.1.0/doricomcp/data/library/library_kTextPrimitiveCollection.json +1136 -0
  70. doricomcp-0.1.0/doricomcp/data/library/library_kTonalitySystemDefinitionCollection.json +20 -0
  71. doricomcp-0.1.0/doricomcp/data/property_names.json +1169 -0
  72. doricomcp-0.1.0/doricomcp/data/rc_property_schemas.json +560 -0
  73. doricomcp-0.1.0/doricomcp/fixture.py +132 -0
  74. doricomcp-0.1.0/doricomcp/logtail.py +47 -0
  75. doricomcp-0.1.0/doricomcp/lua/lib.lua +516 -0
  76. doricomcp-0.1.0/doricomcp/model.py +326 -0
  77. doricomcp-0.1.0/doricomcp/ops/__init__.py +47 -0
  78. doricomcp-0.1.0/doricomcp/ops/__main__.py +121 -0
  79. doricomcp-0.1.0/doricomcp/ops/common.py +310 -0
  80. doricomcp-0.1.0/doricomcp/ops/dynamics.py +226 -0
  81. doricomcp-0.1.0/doricomcp/ops/markings.py +293 -0
  82. doricomcp-0.1.0/doricomcp/ops/notes.py +498 -0
  83. doricomcp-0.1.0/doricomcp/probe.py +86 -0
  84. doricomcp-0.1.0/doricomcp/rc.py +185 -0
  85. doricomcp-0.1.0/doricomcp/reads.py +288 -0
  86. doricomcp-0.1.0/doricomcp/server.py +982 -0
  87. doricomcp-0.1.0/doricomcp/session.py +342 -0
  88. doricomcp-0.1.0/doricomcp/windows.py +245 -0
  89. doricomcp-0.1.0/fixtures/throwaway.pristine.dorico +0 -0
  90. doricomcp-0.1.0/icon.png +0 -0
  91. doricomcp-0.1.0/icon.svg +8 -0
  92. doricomcp-0.1.0/manifest.json +48 -0
  93. doricomcp-0.1.0/pyproject.toml +43 -0
  94. doricomcp-0.1.0/scripts/build_mcpb.sh +11 -0
  95. doricomcp-0.1.0/scripts/readme_table.py +57 -0
  96. doricomcp-0.1.0/server.json +20 -0
  97. doricomcp-0.1.0/tests/offline.py +83 -0
  98. doricomcp-0.1.0/uv.lock +836 -0
@@ -0,0 +1,17 @@
1
+ name: ci
2
+ on: [push, pull_request]
3
+ permissions: {}
4
+ jobs:
5
+ offline:
6
+ runs-on: ubuntu-latest
7
+ permissions:
8
+ contents: read
9
+ steps:
10
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
11
+ with:
12
+ persist-credentials: false
13
+ - uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
14
+ - run: uv sync
15
+ - run: uvx ruff check
16
+ - run: uv run python tests/offline.py
17
+ - run: scripts/build_mcpb.sh # validates manifest.json
@@ -0,0 +1,89 @@
1
+ name: release
2
+ # Pushing a tag vX.Y.Z publishes that version: PyPI (uvx doricomcp), the Claude Desktop bundle on the GitHub
3
+ # release, and the MCP registry entry. PyPI and the registry trust this workflow through OIDC; no tokens are stored.
4
+ on:
5
+ push:
6
+ tags: ["v*"]
7
+ permissions: {}
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: read
13
+ steps:
14
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
15
+ with:
16
+ persist-credentials: false
17
+ - uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
18
+ with:
19
+ enable-cache: false # nothing cached is trusted in a publishing run
20
+ - run: uv sync
21
+ - run: uvx ruff check
22
+ - run: uv run python tests/offline.py
23
+ - name: The tag matches the package version
24
+ run: test "${GITHUB_REF_NAME#v}" = "$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")"
25
+ - run: uv build
26
+ - run: scripts/build_mcpb.sh
27
+ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
28
+ with:
29
+ name: dist
30
+ path: dist/
31
+
32
+ pypi:
33
+ needs: build
34
+ runs-on: ubuntu-latest
35
+ environment: pypi
36
+ permissions:
37
+ id-token: write
38
+ steps:
39
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
40
+ with:
41
+ name: dist
42
+ path: dist/
43
+ - uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
44
+ with:
45
+ enable-cache: false # nothing cached is trusted in a publishing run
46
+ - run: uv publish --trusted-publishing always dist/*.whl dist/*.tar.gz
47
+
48
+ github-release:
49
+ needs: pypi
50
+ runs-on: ubuntu-latest
51
+ permissions:
52
+ contents: write
53
+ steps:
54
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
55
+ with:
56
+ name: dist
57
+ path: dist/
58
+ - run: gh release create "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY" --title "$GITHUB_REF_NAME" --generate-notes
59
+ env:
60
+ GH_TOKEN: ${{ github.token }}
61
+
62
+ mcp-registry:
63
+ needs: pypi
64
+ runs-on: ubuntu-latest
65
+ permissions:
66
+ id-token: write
67
+ contents: read
68
+ env:
69
+ MCP_PUBLISHER_VERSION: v1.8.8
70
+ steps:
71
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
72
+ with:
73
+ persist-credentials: false
74
+ - uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
75
+ - name: Download and verify mcp-publisher
76
+ run: |
77
+ set -euo pipefail
78
+ archive="mcp-publisher_linux_amd64.tar.gz"
79
+ base_url="https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}"
80
+ curl --fail --location --silent --show-error --output "$archive" "$base_url/$archive"
81
+ curl --fail --location --silent --show-error --output "$archive.sigstore.json" "$base_url/$archive.sigstore.json"
82
+ cosign verify-blob \
83
+ --bundle "$archive.sigstore.json" \
84
+ --certificate-identity "https://github.com/modelcontextprotocol/registry/.github/workflows/release.yml@refs/tags/${MCP_PUBLISHER_VERSION}" \
85
+ --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
86
+ "$archive"
87
+ tar xzf "$archive" mcp-publisher
88
+ - run: ./mcp-publisher login github-oidc
89
+ - run: ./mcp-publisher publish
@@ -0,0 +1,15 @@
1
+ # private research material (Dorico binary, decompilation, spikes): never published
2
+ /re/
3
+ /spikes/
4
+ /PLAN.md
5
+ /catalog/
6
+ # local state
7
+ .venv/
8
+ .ruff_cache/
9
+ __pycache__/
10
+ *.pyc
11
+ dist/
12
+ /.claude/
13
+ /fixtures/throwaway.dorico
14
+ /doricomcp/data/confirm_last.png
15
+ .DS_Store
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "doricomcp": {
4
+ "command": "uv",
5
+ "args": ["run", "doricomcp"]
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,89 @@
1
+ # Contributing
2
+
3
+ Thanks for helping.
4
+ The project talks to a live Dorico, so the rules below keep the score of whoever runs it safe.
5
+
6
+ ## Ground rules
7
+
8
+ - Use only Dorico's own interfaces: Remote Control (WebSocket) and the Lua scripting model run through `Script.RunScript`.
9
+ No reading or patching the Dorico process, no editing `.dorico` files.
10
+ - Every write is one Lua transaction (one undo step), read back and verified; a failed check undoes it.
11
+ New write tools go through `Session.transact` with a `verify` function.
12
+ - Never run the confirmation harness on a real score: it closes the open project without saving.
13
+ - A Dorico behaviour you rely on must be measured, not assumed; add it to [docs/dorico-behaviour.md](docs/dorico-behaviour.md).
14
+
15
+ ## Running from a clone
16
+
17
+ ```sh
18
+ git clone https://github.com/mka142/doricomcp && cd doricomcp && uv sync
19
+ ```
20
+
21
+ Claude Code picks up the bundled `.mcp.json` when started in the clone.
22
+ For Claude Desktop, use `"command": "uv", "args": ["run", "--directory", "/path/to/doricomcp", "doricomcp"]` (with the full path to `uv`).
23
+ `lua/lib.lua` is read fresh on every call, so Lua changes need no restart; Python changes need the server restarted.
24
+
25
+ ## Layout and dependencies
26
+
27
+ Each module states what it depends on in its docstring.
28
+ A module imports only modules above it in this list:
29
+
30
+ 1. `model` (events, dump parsing, bar map), `catalog` (data in `doricomcp/data/`, command validation), `logtail` (change log), `rc` (Remote Control client)
31
+ 2. `analysis` (voice leading, pure Python), `windows` (screenshots, dialogs)
32
+ 3. `bridge` (Lua transactions; `lua/lib.lua` is the Lua side), `probe` (sealed-value readers)
33
+ 4. `session` (one live session: twin, caches, verified transactions, undo accounting)
34
+ 5. `reads` (composer views), then `ops/common`, `ops/dynamics`, `ops/markings`, `ops/notes` (write operations)
35
+ 6. `server` (the MCP tools)
36
+ 7. `fixture`, `confirm` (throwaway fixture and live harness)
37
+
38
+ `tests/offline.py` checks this order (`ORDER`), so an import against it fails CI.
39
+
40
+ ```
41
+ server.py MCP tools (the only module the client sees)
42
+ reads.py composer views: music per voice (full, compact, grid), markings, context at a point
43
+ ops/ write operations: common -> dynamics -> markings, common -> notes
44
+ analysis.py voice-leading check (pure Python on read_music data)
45
+ session.py one live session: twin assembly, caches, verified transactions, undo accounting
46
+ probe.py sealed-value readers (time signatures, dynamic levels, keys), cached
47
+ bridge.py Lua transaction bridge; lua/lib.lua is the Lua side (read fresh on every call)
48
+ windows.py screenshots and dialog detection (macOS)
49
+ rc.py Remote Control WebSocket client
50
+ logtail.py change detection from Dorico's application.log
51
+ catalog.py command, enum, property and library data (doricomcp/data/), command validation
52
+ model.py typed events, dump parsing, bar map, key and staff logic
53
+ fixture.py, confirm.py throwaway-fixture lifecycle and the live harness (never on a real score)
54
+ ```
55
+
56
+ `doricomcp/data/` holds Dorico's command list and property schemas (from Remote Control), enum and property names, and the confirmation matrix.
57
+
58
+ ## Adding a tool
59
+
60
+ 1. Put the operation in the matching `doricomcp/ops/` module (or `reads.py` for a read).
61
+ 2. Expose it in `server.py` with `@mcp.tool()` and `@capability("<name>")`; the first sentence of the docstring is what the README table shows.
62
+ 3. Add a live test to `doricomcp/confirm.py` (`TESTS`) that writes on the fixture and reads the result back.
63
+ 4. Run the checks below, then `uv run python scripts/readme_table.py` to refresh the README table.
64
+
65
+ ## Checks
66
+
67
+ ```sh
68
+ uvx ruff check # lint
69
+ uv run python tests/offline.py # self-checks and layer check, no Dorico needed
70
+ uv run python -m doricomcp.confirm # live harness: needs Dorico with no real project open
71
+ ```
72
+
73
+ `uv run python -m doricomcp.confirm <name>` runs only the tests whose name contains `<name>`.
74
+ The harness needs the Xcode Command Line Tools: before it touches Dorico it checks the open windows with a small Swift helper, so it never closes a real project.
75
+ The harness opens `fixtures/throwaway.dorico` (restored from `throwaway.pristine.dorico`), writes `doricomcp/data/confirmed.json` and closes the fixture without saving.
76
+
77
+ ## Releasing
78
+
79
+ 1. Set the same version in `pyproject.toml`, `manifest.json` and `server.json` (both places); `tests/offline.py` checks they agree.
80
+ 2. Push a tag `vX.Y.Z`.
81
+ `.github/workflows/release.yml` then publishes to PyPI, attaches `doricomcp.mcpb` (the Claude Desktop extension) to a GitHub release, and updates the MCP registry entry.
82
+
83
+ `scripts/build_mcpb.sh` builds the extension locally into `dist/`.
84
+
85
+ ## Style
86
+
87
+ - Comments say why, not what; keep them short.
88
+ - Never use an em dash in docs or messages.
89
+ - Long Markdown: one sentence per line.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mka142
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,249 @@
1
+ Metadata-Version: 2.5
2
+ Name: doricomcp
3
+ Version: 0.1.0
4
+ Summary: MCP server that lets Claude read and write a live Dorico 6 score
5
+ Project-URL: Homepage, https://github.com/mka142/doricomcp
6
+ Project-URL: Issues, https://github.com/mka142/doricomcp/issues
7
+ Author: mka142
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: claude,composition,dorico,mcp,music notation
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: Operating System :: MacOS
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Editors
16
+ Requires-Python: >=3.12
17
+ Requires-Dist: mcp>=2.3.0
18
+ Requires-Dist: websockets>=17.2
19
+ Description-Content-Type: text/markdown
20
+
21
+ # doricomcp
22
+
23
+ Talk to your Dorico score.
24
+ doricomcp connects Claude to a live Dorico 6 project, so you can ask about the music and have it edited for you:
25
+
26
+ - "What is in bars 12-20 of the violas?"
27
+ - "Add a crescendo from bar 40 beat 2 to the downbeat of 42 in all strings."
28
+ - "Put pizz. on the cellos in bar 33 and arco in bar 37."
29
+ - "Double the violin line an octave lower in the violas."
30
+ - "Check the voice leading in bars 20-28 against this chord plan."
31
+
32
+ Every edit appears in Dorico as one ordinary undo step, and it is read back and checked; if the check fails, the edit is undone at once.
33
+ doricomcp uses only Dorico's own interfaces (Remote Control and its built-in Lua scripting): it does not modify Dorico or your files.
34
+
35
+ > Not affiliated with or endorsed by Steinberg.
36
+ > Dorico is a trademark of Steinberg Media Technologies GmbH.
37
+ > Status: alpha, tested on Dorico 6.2.30 on macOS.
38
+ > Save your work before a session.
39
+
40
+ <!-- mcp-name: io.github.mka142/doricomcp -->
41
+
42
+ ## Install
43
+
44
+ You need a Mac with Dorico 6.2 or later and [Claude Desktop](https://claude.ai/download) or Claude Code.
45
+
46
+ 1. **Turn on Remote Control in Dorico.**
47
+ In Dorico's Preferences, enable Remote Control and keep the port at 4560.
48
+ 2. **Add doricomcp to Claude**, one of:
49
+ - **Claude Desktop:** download `doricomcp.mcpb` from the [latest release](https://github.com/mka142/doricomcp/releases/latest) and double-click it, then click Install.
50
+ Claude sets up Python by itself.
51
+ - **Claude Code:** install [uv](https://docs.astral.sh/uv/getting-started/installation/), then run `claude mcp add doricomcp -- uvx doricomcp`.
52
+ - **Any other MCP client:** install [uv](https://docs.astral.sh/uv/getting-started/installation/) and add this server to the client's configuration:
53
+
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "doricomcp": { "command": "uvx", "args": ["doricomcp"] }
58
+ }
59
+ }
60
+ ```
61
+
62
+ If the client cannot find `uvx`, use its full path (`which uvx` in Terminal; usually `/opt/homebrew/bin/uvx` or `~/.local/bin/uvx`).
63
+ 3. **Open a score in Dorico and ask Claude something about it.**
64
+ The first time, Dorico asks whether to allow the client `doricomcp`: click Allow.
65
+ You will not be asked again.
66
+ 4. Optional: to let Claude look at the score (`screenshot`) and answer Dorico's dialogs, allow Screen Recording and Accessibility for Claude in System Settings > Privacy & Security.
67
+ Both need the Xcode Command Line Tools (`xcode-select --install`).
68
+
69
+ ### Troubleshooting
70
+
71
+ - **"Dorico is not reachable":** Dorico is not running, or Remote Control is off or on another port.
72
+ - **Dorico never shows the approval prompt:** delete `~/.doricomcp/session_token` and ask again.
73
+ - **Some tools are switched off in Claude Desktop:** Claude Desktop remembers switched-off tools per server name; switch them on in the server's settings.
74
+ - Anything else: [open an issue](https://github.com/mka142/doricomcp/issues) with what you asked and what happened.
75
+
76
+ ## How to talk about the music
77
+
78
+ Claude handles these details for you; they matter when you read the tool results.
79
+
80
+ - Positions are a bar (1-based) and a beat, counted in crotchets from the start of the bar (`0`, `1`, `3/2`), or a position in crotchets from the start of the flow.
81
+ - Voices are numbered per score (piano: 2 = right hand, 4 = left hand); `get_score_overview` lists them with their instrument, staff and voice.
82
+ - Notes are written like `"Eb4+G4+C5:h. G4:e Eb5:q. C5:s r:q"`: C4 is middle C, durations are note values `w h q e s t` with dots, or crotchets (`3/2`).
83
+ - Dynamics, tempo, time signatures, clefs, ornaments and holds take the same text as Dorico's popovers (`p<f`, `pp<ff>pp`, `rit.`, `[2+2+3]/8`).
84
+ The [popover guide](https://github.com/mka142/doricomcp/blob/main/docs/popovers.md) lists every entry and what Dorico 6.2 actually creates for the undocumented ones.
85
+ - Playing techniques are given by name (`pizz.`, `con sord.`), including ones you added to the score yourself.
86
+
87
+ ## What it can do
88
+
89
+ "Confirmed live" means the test harness ran the tool on a real Dorico and read the result back.
90
+
91
+ <!-- tools:start -->
92
+ **Session & introspection**
93
+
94
+ | Tool | What it does | Status |
95
+ |---|---|---|
96
+ | `dorico_status` | Live Dorico status (mode, selection, note input, undo availability) from Remote Control. | read-only |
97
+ | `list_capabilities` | The confirmation matrix: every capability, its mechanism and whether the live harness confirmed it. | read-only |
98
+ | `describe_commands` | Search Dorico's 1,200 commands (regex on name/display name) with their parameters and enum values. | read-only |
99
+ | `describe_enums` | Exact accepted values of a Dorico enum type (or regex over enum type names). | read-only |
100
+ | `describe_property` | Type, display name and enum values of an event property (e.g. kNoteVelocity, kEventColour). | read-only |
101
+ | `list_library` | Library entities (ids + names), live from Dorico: kInstrumentCollection, kClefCollection, kPlayingTechniqueAppearanceCollection ... | read-only |
102
+ | `run_command` | Escape hatch: run any catalogued Dorico command ("Namespace.Command?Param=value&..."), validated against the catalogue. | confirmed live |
103
+ | `screenshot` | A picture of Dorico's score window, to check engraving by eye. | confirmed live |
104
+ | `list_dialogs` | Dorico's open dialogs (every window other than a project window): title, modal, the texts shown and the controls (role, title or label ... | confirmed live |
105
+ | `dialog_click` | Press a control in a Dorico dialog: a button ("OK", "Cancel", "Apply", "Close"), checkbox, radio button or tab, by its title, the label ... | confirmed live |
106
+ | `dialog_set` | Set a control in a Dorico dialog: a checkbox or radio button to true/false, a text field to text, a pop-up or combo box to one of its items ... | confirmed live |
107
+ | `refresh` | Forget cached reads (time signatures, dynamics, keys, structure); use after editing in Dorico by hand. | read-only |
108
+
109
+ **Read**
110
+
111
+ | Tool | What it does | Status |
112
+ |---|---|---|
113
+ | `get_score_overview` | Players, instruments, layouts and flows; per flow its streams and voices (voice-stream id -> instrument, staff index, voice index). | confirmed live |
114
+ | `get_bar_map` | Bar numbers <-> positions, time signatures (read by Dorico's own equality API, cached) and optionally key signatures (include_keys: a ... | confirmed live |
115
+ | `read_music` | Notes, chords, rests (explicit and implicit), grace notes, tuplets, slurs and articulations per voice, with exact positions, durations ... | confirmed live |
116
+ | `read_markings` | Dynamics (levels incl. sfz/rfz/fz, hairpins), slurs, clefs, ottavas, text, tempo (text, bpm), holds, rehearsal marks, repeats, breaks ... | confirmed live |
117
+ | `read_context_at` | What is in force at a point: time signature, key signature, clef, dynamic level (and a hairpin running through the point), ottava, the last ... | confirmed live |
118
+ | `check_voice_leading` | Voice-leading check of the score: parallel and contrary fifths/octaves/unisons, hidden fifths/octaves in the outer voices, crossings ... | confirmed live |
119
+ | `score_changes` | What changed in a flow: without since, take a snapshot and return its token; with since=<token>, list the events added, removed and changed ... | confirmed live |
120
+ | `get_selection` | The current selection in Dorico (event type and, if available, its properties). | read-only |
121
+ | `get_options` | House-style options: kind kEngraving (per score), kNotation (per flow: flow_id), kLayout (per layout: layout_id). | read-only |
122
+
123
+ **Write: notes**
124
+
125
+ | Tool | What it does | Status |
126
+ |---|---|---|
127
+ | `add_notes` | Write notes, chords and rests one after another from a position. | confirmed live |
128
+ | `delete_range` | Delete the notes, rests, grace notes and tuplets of a voice in a range (bars inclusive, or positions [from_pos, to_pos)); slurs, text and ... | confirmed live |
129
+ | `delete_events` | Delete events by id: notes, rests or markings (dynamics, hairpins, slurs, text, clefs, octave lines...). | confirmed live |
130
+ | `set_pitch` | Change one note's pitch and spelling (e.g. "F#4", "Ebb5") in place: it keeps its id, rhythm, slurs and articulations. | confirmed live |
131
+ | `set_duration` | Change a note's or rest's duration (crotchets or w h q e s t with dots). | confirmed live |
132
+ | `edit_notes` | Apply an edit to notes: pitch_up/pitch_down (diatonic steps x count), chromatic_up/down, octave_up/down, respell_above/below ... | confirmed live |
133
+ | `add_interval` | Add a note at an interval to each given note, making a chord: "3" (third above), "-3", "maj3", "min6 below", "p5", "octave". | confirmed live |
134
+ | `add_grace_note` | Add a grace note before the note at the given position (value: notated length, default quaver). | confirmed live |
135
+ | `copy_range` | Copy (or move) notes and rests of a range to another place or voice/staff (markings are not copied). | confirmed live |
136
+ | `add_tuplet` | A tuplet typed with Dorico's note input, overwriting what is there: ratio "3:2", "5:4"; unit = the tuplet's note value (e, q, s, h); notes ... | confirmed live |
137
+ | `swap_voices` | Exchange the notes and rests of two voices in a range (e.g. divisi lines trading places), one undo step. | confirmed live |
138
+ | `add_voice` | Start a new voice on the same staff as `voice` (e.g. a second, stems-down voice), typing `notes` (add_notes syntax, plain or single-dotted ... | confirmed live |
139
+
140
+ **Write: markings**
141
+
142
+ | Tool | What it does | Status |
143
+ |---|---|---|
144
+ | `add_articulation` | staccato, staccatissimo, tenuto, accent, marcato, stress, unstress, staccato_tenuto on notes. | confirmed live |
145
+ | `add_span` | A line from one note to another in the same voice: slur, cresc, dim, messa_di_voce (hairpins), 8va, 8vb, 15ma, 15mb (octave lines) ... | confirmed live |
146
+ | `add_hairpin` | A hairpin (cresc, dim, messa_di_voce) from one position to another, e.g. bar 33 beat 0 to bar 33 beat 3/2, wherever notes start (also ... | confirmed live |
147
+ | `add_dynamic` | An immediate dynamic (p, pp, mp, mf, f, ff, sfz, fp, ...) on the voice's instrument at a position, also where no note starts (inside a held ... | confirmed live |
148
+ | `add_note_marking` | kind=ornament (value tr, mordent, inv, turn), hold (fermata, breath, caesura...), playing_technique (value: a name like pizz., arco, con ... | confirmed live |
149
+ | `add_text` | Staff text (e.g. "dolce", "espress.") attached to a voice at a position. | confirmed live |
150
+ | `add_clef` | A clef change on the voice's staff: clef.treble, clef.bass, clef.alto, clef.tenor, clef.treble8ba . | confirmed live |
151
+ | `set_tempo` | A tempo marking: "q=120", "Allegro q=132", "h.=60", "rit.", "a tempo". | confirmed live |
152
+ | `set_time_signature` | Time signature from a bar on: 3/4, 6/8, 2+3/8, c, cut. | confirmed live |
153
+ | `set_key_signature` | Key signature from a bar on: "2#", "3b", "0", or names like "Eb", "F#m", "c minor". | confirmed live |
154
+ | `add_barline` | Barline at the start of a bar: "\|\|" double, "\|:" start repeat, ":\|" end repeat, ":\|:", "\|\|\|" final, ":" dashed. | confirmed live |
155
+ | `add_repeat_marker` | segno, coda, fine, "to coda", "D.C.", "D.C. | confirmed live |
156
+ | `add_rehearsal_mark` | A rehearsal mark (next letter in sequence) at the start of a bar. | confirmed live |
157
+ | `add_break` | Force a system or frame (page) break before a bar. | confirmed live |
158
+ | `set_property` | Set any event property (all layouts), e.g. kNoteVelocity=100, kEventColour=#ffff0000, kEventScale=kCue, kNoteForcedVoiceDirection. | confirmed live |
159
+
160
+ **Write: options & structure**
161
+
162
+ | Tool | What it does | Status |
163
+ |---|---|---|
164
+ | `set_option` | Set a house-style option (paths and values from get_options). | confirmed live |
165
+ | `add_player` | Add a solo (or section) player holding an instrument from the library, e.g. instrument.strings.violin, instrument.wind.flute (list_library ... | confirmed live |
166
+ | `add_instrument` | Give an existing player (index in get_score_overview players) an extra instrument (doubling). | confirmed live |
167
+ | `rename_player` | Rename a player (index in get_score_overview players). | confirmed live |
168
+ | `add_flow` | Add a new flow (movement) at the end of the project, with all players. | confirmed live |
169
+ | `rename_flow` | Rename a flow (ids from get_score_overview flows). | confirmed live |
170
+ | `delete_flow` | Delete a flow and all its music (one undo step; undo restores it). | confirmed live |
171
+ | `add_layout` | Add a custom score layout (optionally named). | confirmed live |
172
+ | `rename_layout` | Rename a layout (ids from get_score_overview layouts). | confirmed live |
173
+ | `layout_flows` | Include or exclude flows in a layout (Dorico does not expose a layout's flows for read-back). | confirmed live |
174
+ | `set_score_order` | Instrument order template, e.g. instrumentscoreorder.orchestral, instrumentscoreorder.windband, instrumentscoreorder.choral (list_library ... | confirmed live |
175
+
176
+ **Navigation, playback, history**
177
+
178
+ | Tool | What it does | Status |
179
+ |---|---|---|
180
+ | `go_to` | Scroll Dorico's view to a bar. | confirmed live |
181
+ | `select_events` | Select an event in Dorico (e.g. to show the user). | confirmed live |
182
+ | `play` | Start playback (from a bar, or from the playhead). | confirmed live |
183
+ | `stop` | Stop playback. | confirmed live |
184
+ | `undo` | Undo the last `count` edits in Dorico (every tool write is one step). | confirmed live |
185
+ | `redo` | Redo `count` steps. | confirmed live |
186
+ <!-- tools:end -->
187
+
188
+ ## Known gaps and how they could be closed
189
+
190
+ What follows is what Dorico's interfaces do not give yet, measured on 6.2.30, with the most promising way in.
191
+ Each one is a good first contribution.
192
+
193
+ - **Lyrics** (`read_markings`, no write tool).
194
+ Lyric text is not readable and `NoteInput.StartLyricInput` plus `AcceptCurrentLyricInput?LyricText=` from a script created no lyric.
195
+ Next: send the same two commands from Remote Control (not Lua) with the note selected, and try the `EventCreationLocation` parameter; then read the lyric back with the selection read used for tempo.
196
+ - **Tempo beat unit** (`read_markings`, `read_context_at`).
197
+ Text, bpm, relative and final percentages are read by selecting the tempo marking, but the beat unit is never exposed, so `h.=60` and `q=60` both read 60.
198
+ Next: record the definition when `set_tempo` writes it (as `add_voice` records staves), and compare against Dorico's playback tempo for markings made by hand.
199
+ - **fp and sffz** (`read_markings`).
200
+ sfz, sf, rfz, rf, fz and mfz are read from the dynamic's force type; fp leaves no readable property and sffz reads as sfz.
201
+ Next: extend the sealed-value equality probe that reads p/f levels to Dorico-built fp and sffz candidates.
202
+ - **Note details in voices with techniques, trills, ornaments, arpeggios or glissandi** (`read_music`).
203
+ Lua cannot list events in such a voice, so pitches and rhythms come from the stream dump, but articulations and ties do not.
204
+ Measured route: in one script, delete the voice's technique, trill or ornament events, read the notes with all their properties, then undo at once; the voice dump came back identical.
205
+ For a single note, Remote Control's `status` message carries the selected note's articulation flags (`articulationStaccato`, ...).
206
+ - **div. and unis.** (`add_text`).
207
+ They are written as staff text; Dorico's real divisi is `Edit.AddDivisi` / `Edit.RestoreUnison`, which open the Change Divisi dialog.
208
+ Next: drive that dialog with the existing dialog tools, as `delete_flow` does with its confirmation.
209
+ - **Deleting players and instruments** (not exposed).
210
+ Dorico asks for confirmation; the same dialog route as `delete_flow` would work.
211
+ - **Copy and move with markings** (`copy_range`).
212
+ Lua's `copyRange` is a no-op, so notes and rests are re-created and markings are not copied.
213
+ Next: re-create slurs, dynamics and articulations from the twin, as `add_notes(replace=True)` already does for slurs.
214
+ - **Key tonic and mode** (`get_bar_map`).
215
+ Only the signature (e.g. 2 sharps) is recoverable.
216
+ Next: infer major/minor from the music with `check_voice_leading`'s chord logic and present it as a guess.
217
+ - **Title and composer** (`get_score_overview`).
218
+ Not in Lua or Remote Control.
219
+ No route known through Dorico's own interfaces.
220
+ - **Staff of a voice** (`get_score_overview`).
221
+ Dorico does not say which staff a voice is on; the server knows the first voice per staff and the voices it created, and says "unknown" otherwise.
222
+ - **Redo after a read** (`redo`).
223
+ Any script, even a read, clears Dorico's redo stack, so redo works only directly after undo.
224
+
225
+ ## How writes stay safe
226
+
227
+ - Every write is one Lua transaction, which Dorico records as one undo step.
228
+ - The tool reads the affected range back and checks the expected result; on a mismatch it undoes the step immediately and confirms the range is restored.
229
+ - A script is never abandoned: Dorico runs Remote Control commands in between a script's own commands, so a read or undo sent while a script still runs would land in the middle of it.
230
+ The bridge waits for the script's done marker however long it takes; it stops early only for a modal dialog, and then nothing is undone.
231
+ - A tool call the client cancels still runs to the end under the session lock (verified, or undone on failure), and the next tool result reports how it ended.
232
+ - Commands that act on "the selection" always get a real selection first (an event at the position, or a temporary rest deleted in the same step), because a selection-less popover command can open a modal dialog that blocks Dorico.
233
+ - Reading a tempo selects it, and Dorico records every selection as an undo step; the server counts the selection steps its reads leave on top and `undo` skips them.
234
+
235
+ ## Contributing
236
+
237
+ Bug reports, measurements on other Dorico versions and pull requests are welcome.
238
+ [CONTRIBUTING.md](https://github.com/mka142/doricomcp/blob/main/CONTRIBUTING.md) explains the layout, the checks and how to run the live test harness.
239
+ What Dorico does and does not allow through its interfaces is recorded in [docs/dorico-behaviour.md](https://github.com/mka142/doricomcp/blob/main/docs/dorico-behaviour.md).
240
+
241
+ ## Roadmap
242
+
243
+ - Close the gaps listed above, starting with lyrics and note details in technique voices.
244
+ - Windows support: the Remote Control and Lua parts are portable; screenshots and dialogs need a Windows counterpart of `windows.py`.
245
+ - Milestone: a project website on GitHub Pages with setup, a demo video and the tool reference.
246
+
247
+ ## License
248
+
249
+ MIT, see [LICENSE](https://github.com/mka142/doricomcp/blob/main/LICENSE).