mcp-excalidraw-server 1.0.7 → 1.1.0

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 (268) hide show
  1. package/README.md +248 -194
  2. package/dist/bin.d.ts +3 -0
  3. package/dist/bin.d.ts.map +1 -0
  4. package/dist/bin.js +41 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/cli/args.d.ts +14 -0
  7. package/dist/cli/args.d.ts.map +1 -0
  8. package/dist/cli/args.js +74 -0
  9. package/dist/cli/args.js.map +1 -0
  10. package/dist/cli/commands/arrange.d.ts +2 -0
  11. package/dist/cli/commands/arrange.d.ts.map +1 -0
  12. package/dist/cli/commands/arrange.js +85 -0
  13. package/dist/cli/commands/arrange.js.map +1 -0
  14. package/dist/cli/commands/elements.d.ts +7 -0
  15. package/dist/cli/commands/elements.d.ts.map +1 -0
  16. package/dist/cli/commands/elements.js +209 -0
  17. package/dist/cli/commands/elements.js.map +1 -0
  18. package/dist/cli/commands/install-skill.d.ts +2 -0
  19. package/dist/cli/commands/install-skill.d.ts.map +1 -0
  20. package/dist/cli/commands/install-skill.js +108 -0
  21. package/dist/cli/commands/install-skill.js.map +1 -0
  22. package/dist/cli/commands/scene.d.ts +8 -0
  23. package/dist/cli/commands/scene.d.ts.map +1 -0
  24. package/dist/cli/commands/scene.js +110 -0
  25. package/dist/cli/commands/scene.js.map +1 -0
  26. package/dist/cli/commands/server.d.ts +4 -0
  27. package/dist/cli/commands/server.d.ts.map +1 -0
  28. package/dist/cli/commands/server.js +64 -0
  29. package/dist/cli/commands/server.js.map +1 -0
  30. package/dist/cli/commands/snapshot.d.ts +2 -0
  31. package/dist/cli/commands/snapshot.d.ts.map +1 -0
  32. package/dist/cli/commands/snapshot.js +41 -0
  33. package/dist/cli/commands/snapshot.js.map +1 -0
  34. package/dist/cli/run.d.ts +2 -0
  35. package/dist/cli/run.d.ts.map +1 -0
  36. package/dist/cli/run.js +99 -0
  37. package/dist/cli/run.js.map +1 -0
  38. package/dist/cli/util.d.ts +5 -0
  39. package/dist/cli/util.d.ts.map +1 -0
  40. package/dist/cli/util.js +34 -0
  41. package/dist/cli/util.js.map +1 -0
  42. package/dist/core/canvas-client.d.ts +68 -0
  43. package/dist/core/canvas-client.d.ts.map +1 -0
  44. package/dist/core/canvas-client.js +294 -0
  45. package/dist/core/canvas-client.js.map +1 -0
  46. package/dist/core/config.d.ts +5 -0
  47. package/dist/core/config.d.ts.map +1 -0
  48. package/dist/core/config.js +11 -0
  49. package/dist/core/config.js.map +1 -0
  50. package/dist/core/describe.d.ts +3 -0
  51. package/dist/core/describe.d.ts.map +1 -0
  52. package/dist/core/describe.js +94 -0
  53. package/dist/core/describe.js.map +1 -0
  54. package/dist/core/design-guide.d.ts +2 -0
  55. package/dist/core/design-guide.d.ts.map +1 -0
  56. package/dist/core/design-guide.js +95 -0
  57. package/dist/core/design-guide.js.map +1 -0
  58. package/dist/core/entry.d.ts +3 -0
  59. package/dist/core/entry.d.ts.map +1 -0
  60. package/dist/core/entry.js +35 -0
  61. package/dist/core/entry.js.map +1 -0
  62. package/dist/core/geometry.d.ts +37 -0
  63. package/dist/core/geometry.d.ts.map +1 -0
  64. package/dist/core/geometry.js +196 -0
  65. package/dist/core/geometry.js.map +1 -0
  66. package/dist/core/normalize.d.ts +24 -0
  67. package/dist/core/normalize.d.ts.map +1 -0
  68. package/dist/core/normalize.js +95 -0
  69. package/dist/core/normalize.js.map +1 -0
  70. package/dist/core/pidfile.d.ts +5 -0
  71. package/dist/core/pidfile.d.ts.map +1 -0
  72. package/dist/core/pidfile.js +51 -0
  73. package/dist/core/pidfile.js.map +1 -0
  74. package/dist/core/scene-io.d.ts +16 -0
  75. package/dist/core/scene-io.d.ts.map +1 -0
  76. package/dist/core/scene-io.js +81 -0
  77. package/dist/core/scene-io.js.map +1 -0
  78. package/dist/core/share-url.d.ts +3 -0
  79. package/dist/core/share-url.d.ts.map +1 -0
  80. package/dist/core/share-url.js +246 -0
  81. package/dist/core/share-url.js.map +1 -0
  82. package/dist/core/spawn.d.ts +40 -0
  83. package/dist/core/spawn.d.ts.map +1 -0
  84. package/dist/core/spawn.js +151 -0
  85. package/dist/core/spawn.js.map +1 -0
  86. package/dist/core/version.d.ts +2 -0
  87. package/dist/core/version.d.ts.map +1 -0
  88. package/dist/core/version.js +14 -0
  89. package/dist/core/version.js.map +1 -0
  90. package/dist/frontend/assets/{advancedFormat-BB0p-EFm.js → advancedFormat-Cu4RdwYX.js} +1 -1
  91. package/dist/frontend/assets/{ar-SA-G6X2FPQ2-DQjC7E2l.js → ar-SA-G6X2FPQ2-BrG9D5mB.js} +1 -1
  92. package/dist/frontend/assets/{arc-DeeplnFI.js → arc-CzN7s4I_.js} +1 -1
  93. package/dist/frontend/assets/{az-AZ-76LH7QW2-i2mid_KF.js → az-AZ-76LH7QW2-CBmyqnOx.js} +1 -1
  94. package/dist/frontend/assets/{bg-BG-XCXSNQG7-DEeQGR6G.js → bg-BG-XCXSNQG7-D6Jn9Jka.js} +1 -1
  95. package/dist/frontend/assets/{blockDiagram-38ab4fdb-ft3Qmbnk.js → blockDiagram-38ab4fdb-D-xprr1O.js} +1 -1
  96. package/dist/frontend/assets/{blockDiagram-68f4deed-BhATEkwK.js → blockDiagram-68f4deed-CuasSwoS.js} +1 -1
  97. package/dist/frontend/assets/{bn-BD-2XOGV67Q-Cyoi_9HX.js → bn-BD-2XOGV67Q-B-xVQHpa.js} +1 -1
  98. package/dist/frontend/assets/{c4Diagram-15b5d702-D9y4gbPI.js → c4Diagram-15b5d702-DngzuSSz.js} +1 -1
  99. package/dist/frontend/assets/{c4Diagram-3d4e48cf-JFijLclV.js → c4Diagram-3d4e48cf-UI2vKyjh.js} +1 -1
  100. package/dist/frontend/assets/{ca-ES-6MX7JW3Y-BVVWU1rs.js → ca-ES-6MX7JW3Y-CXxzVHI2.js} +1 -1
  101. package/dist/frontend/assets/channel-DHpR-e5t.js +1 -0
  102. package/dist/frontend/assets/{classDiagram-70f12bd4-Ca9Kd1Ds.js → classDiagram-70f12bd4-B-W1h0ye.js} +1 -1
  103. package/dist/frontend/assets/{classDiagram-d40c83e7-Bq3MDvmx.js → classDiagram-d40c83e7-CHgATOtg.js} +1 -1
  104. package/dist/frontend/assets/{classDiagram-v2-d5a6b087-o29qZ8vi.js → classDiagram-v2-d5a6b087-CrVxqaxV.js} +1 -1
  105. package/dist/frontend/assets/{classDiagram-v2-f2320105-C9ex7BCO.js → classDiagram-v2-f2320105-DeNcMPNN.js} +1 -1
  106. package/dist/frontend/assets/clone-lup5BMBm.js +1 -0
  107. package/dist/frontend/assets/{createText-2e5e7dd3-FTBPE3EK.js → createText-2e5e7dd3-BCvKSdde.js} +1 -1
  108. package/dist/frontend/assets/{createText-d213de94-5nVTf_jC.js → createText-d213de94-C1e-WoOI.js} +1 -1
  109. package/dist/frontend/assets/{cs-CZ-2BRQDIVT-BhMjw9tI.js → cs-CZ-2BRQDIVT-D985JfJM.js} +1 -1
  110. package/dist/frontend/assets/{cytoscape-cose-bilkent-D2omlyvD.js → cytoscape-cose-bilkent-BpNex8hm.js} +1 -1
  111. package/dist/frontend/assets/{da-DK-5WZEPLOC-MfLFmlD6.js → da-DK-5WZEPLOC-DnO8UYdw.js} +1 -1
  112. package/dist/frontend/assets/{de-DE-XR44H4JA-JhYak0I3.js → de-DE-XR44H4JA-DpLEycXf.js} +1 -1
  113. package/dist/frontend/assets/{edges-332bd1c7-DRJZgTC2.js → edges-332bd1c7-BTWqXXOh.js} +1 -1
  114. package/dist/frontend/assets/{edges-e0da2a9e-BDwG7z0K.js → edges-e0da2a9e-DB5hSRMS.js} +1 -1
  115. package/dist/frontend/assets/{el-GR-BZB4AONW-Cdt2Ptk6.js → el-GR-BZB4AONW-CxD2fU_-.js} +1 -1
  116. package/dist/frontend/assets/{elk.bundled-D6I4pvAp.js → elk.bundled-BdkkLQ9v.js} +1 -1
  117. package/dist/frontend/assets/{erDiagram-880f2ed8-C8waXJ0r.js → erDiagram-880f2ed8-CcFsVKbm.js} +1 -1
  118. package/dist/frontend/assets/{erDiagram-9861fffd-F9WuyAYm.js → erDiagram-9861fffd-CesvXcG3.js} +1 -1
  119. package/dist/frontend/assets/{es-ES-U4NZUMDT-C2-CtGrr.js → es-ES-U4NZUMDT-eLkUAGrd.js} +1 -1
  120. package/dist/frontend/assets/{eu-ES-A7QVB2H4-CU_zCaYP.js → eu-ES-A7QVB2H4-C5So4PTb.js} +1 -1
  121. package/dist/frontend/assets/{fa-IR-HGAKTJCU-Ck3uNCF1.js → fa-IR-HGAKTJCU-8SlB6qKf.js} +1 -1
  122. package/dist/frontend/assets/{fi-FI-Z5N7JZ37-B095Plv2.js → fi-FI-Z5N7JZ37-BomDdmSm.js} +1 -1
  123. package/dist/frontend/assets/{flowDb-7c981674-DuBfksmG.js → flowDb-7c981674-DUYo8xot.js} +1 -1
  124. package/dist/frontend/assets/{flowDb-956e92f1-CeLnP8Y5.js → flowDb-956e92f1-BJgXZYDf.js} +1 -1
  125. package/dist/frontend/assets/{flowDiagram-66a62f08-Bm4RJknB.js → flowDiagram-66a62f08-4g_Edke8.js} +1 -1
  126. package/dist/frontend/assets/{flowDiagram-cbd28bf7-DGIWJa28.js → flowDiagram-cbd28bf7-BlrPxNWv.js} +1 -1
  127. package/dist/frontend/assets/flowDiagram-v2-96b9c2cf-Czu9PPGk.js +1 -0
  128. package/dist/frontend/assets/flowDiagram-v2-ffc7f31a-BXmTKhDc.js +1 -0
  129. package/dist/frontend/assets/{flowchart-elk-definition-36e2d292-Dpo4AMxk.js → flowchart-elk-definition-36e2d292-Ci2E7lRB.js} +1 -1
  130. package/dist/frontend/assets/{flowchart-elk-definition-4a651766-ChOn_l6T.js → flowchart-elk-definition-4a651766-C58ugksC.js} +1 -1
  131. package/dist/frontend/assets/{fr-FR-RHASNOE6-BqyLXGYl.js → fr-FR-RHASNOE6-CISuwHIw.js} +1 -1
  132. package/dist/frontend/assets/{ganttDiagram-04f9e578-CkdnwMOW.js → ganttDiagram-04f9e578-DtN69sC0.js} +1 -1
  133. package/dist/frontend/assets/{ganttDiagram-c361ad54-CJzn5gXR.js → ganttDiagram-c361ad54-uoOAidYg.js} +1 -1
  134. package/dist/frontend/assets/{gitGraphDiagram-21fc4d3e-CIOFS-AG.js → gitGraphDiagram-21fc4d3e-BeTO0_jl.js} +1 -1
  135. package/dist/frontend/assets/{gitGraphDiagram-72cf32ee-Bcto3HlW.js → gitGraphDiagram-72cf32ee-BReQlBMg.js} +1 -1
  136. package/dist/frontend/assets/{gl-ES-HMX3MZ6V-B7bR1uHP.js → gl-ES-HMX3MZ6V-7cWOAJGF.js} +1 -1
  137. package/dist/frontend/assets/{graph-BHaTz2pM.js → graph-BATMMMJj.js} +1 -1
  138. package/dist/frontend/assets/{graph-DsUM2NHp.js → graph-Dlrlf4lh.js} +1 -1
  139. package/dist/frontend/assets/{he-IL-6SHJWFNN-DwXoH57J.js → he-IL-6SHJWFNN-DL7AZuDJ.js} +1 -1
  140. package/dist/frontend/assets/{hi-IN-IWLTKZ5I-D7SfqhT6.js → hi-IN-IWLTKZ5I-DmD9bUM1.js} +1 -1
  141. package/dist/frontend/assets/{hu-HU-A5ZG7DT2-GZMnh_86.js → hu-HU-A5ZG7DT2-CRtguMHd.js} +1 -1
  142. package/dist/frontend/assets/{id-ID-SAP4L64H-CKj2F_pf.js → id-ID-SAP4L64H-DtFfu6C-.js} +1 -1
  143. package/dist/frontend/assets/{index-3862675e-Bsb9vcL0.js → index-3862675e-DeYQrklP.js} +1 -1
  144. package/dist/frontend/assets/{index-6079d271-Bvcb58DE.js → index-6079d271-Bf_wfFkO.js} +1 -1
  145. package/dist/frontend/assets/{index-C1JelwHC.js → index-CJ8IXn8v.js} +69 -69
  146. package/dist/frontend/assets/{index-CkitXLJb.js → index-DEiTON1j.js} +4 -4
  147. package/dist/frontend/assets/{infoDiagram-4a4f5b27-DYMh8eXF.js → infoDiagram-4a4f5b27-WzbAum_g.js} +1 -1
  148. package/dist/frontend/assets/{infoDiagram-f8f76790-B2YXmH0v.js → infoDiagram-f8f76790-C961YhU4.js} +1 -1
  149. package/dist/frontend/assets/{it-IT-JPQ66NNP-woTcXUdD.js → it-IT-JPQ66NNP-BvUrFdLL.js} +1 -1
  150. package/dist/frontend/assets/{ja-JP-DBVTYXUO-CGJZIn_N.js → ja-JP-DBVTYXUO-bTtjENx1.js} +1 -1
  151. package/dist/frontend/assets/{journeyDiagram-29694f62-20n3n2ey.js → journeyDiagram-29694f62-Cv8OEe7W.js} +1 -1
  152. package/dist/frontend/assets/{journeyDiagram-49397b02-Df2fBEZG.js → journeyDiagram-49397b02-tYl_lKi9.js} +1 -1
  153. package/dist/frontend/assets/{kaa-6HZHGXH3-BtBBG4jh.js → kaa-6HZHGXH3-Bv2KyQYW.js} +1 -1
  154. package/dist/frontend/assets/{kab-KAB-ZGHBKWFO-CbxAj5W8.js → kab-KAB-ZGHBKWFO-BADb-eTr.js} +1 -1
  155. package/dist/frontend/assets/{kk-KZ-P5N5QNE5-fS-Upvvh.js → kk-KZ-P5N5QNE5-Bf7oZ_PX.js} +1 -1
  156. package/dist/frontend/assets/{km-KH-HSX4SM5Z-BA1j7Xmb.js → km-KH-HSX4SM5Z-Dl89KnDo.js} +1 -1
  157. package/dist/frontend/assets/{ko-KR-MTYHY66A-CFvLJngn.js → ko-KR-MTYHY66A-KJMINqTm.js} +1 -1
  158. package/dist/frontend/assets/{ku-TR-6OUDTVRD-BkE-_tGQ.js → ku-TR-6OUDTVRD-C3XIFH4f.js} +1 -1
  159. package/dist/frontend/assets/{layout-D56ApGxy.js → layout-Cz8myur7.js} +1 -1
  160. package/dist/frontend/assets/{layout-D3_N-32k.js → layout-DB62LdLJ.js} +1 -1
  161. package/dist/frontend/assets/{line-Dq_sNFvr.js → line-CBrVjdDC.js} +1 -1
  162. package/dist/frontend/assets/{linear-BaWzW4O4.js → linear-BqYCMXJr.js} +1 -1
  163. package/dist/frontend/assets/{lt-LT-XHIRWOB4-BSnb0UTH.js → lt-LT-XHIRWOB4-Oj2fWkIx.js} +1 -1
  164. package/dist/frontend/assets/{lv-LV-5QDEKY6T-CLjiMRc2.js → lv-LV-5QDEKY6T-Bh0Mah1s.js} +1 -1
  165. package/dist/frontend/assets/{mindmap-definition-ac74a2e8-BY3Tg6Pe.js → mindmap-definition-ac74a2e8-4n3cEnEy.js} +1 -1
  166. package/dist/frontend/assets/{mindmap-definition-fc14e90a-CLKKSvyA.js → mindmap-definition-fc14e90a-BET0ZXH5.js} +1 -1
  167. package/dist/frontend/assets/{mr-IN-CRQNXWMA-D9DBZK36.js → mr-IN-CRQNXWMA-Dashya6c.js} +1 -1
  168. package/dist/frontend/assets/{my-MM-5M5IBNSE-DpU38Yme.js → my-MM-5M5IBNSE-B_azhrE2.js} +1 -1
  169. package/dist/frontend/assets/{nb-NO-T6EIAALU-C510_VhX.js → nb-NO-T6EIAALU-Bdg2vJB0.js} +1 -1
  170. package/dist/frontend/assets/{nl-NL-IS3SIHDZ-CTxHa7fQ.js → nl-NL-IS3SIHDZ-Bh0k8Kbj.js} +1 -1
  171. package/dist/frontend/assets/{nn-NO-6E72VCQL-BrJEF_cT.js → nn-NO-6E72VCQL-BLjsiv6i.js} +1 -1
  172. package/dist/frontend/assets/{oc-FR-POXYY2M6-BQ6jh9ah.js → oc-FR-POXYY2M6-Dw9C6QDS.js} +1 -1
  173. package/dist/frontend/assets/{pa-IN-N4M65BXN-DHhO4NEC.js → pa-IN-N4M65BXN-mJNVnYBQ.js} +1 -1
  174. package/dist/frontend/assets/{pica-CofPkJ36.js → pica-BpgspmBQ.js} +1 -1
  175. package/dist/frontend/assets/{pie-lyWsw7iq.js → pie-n8S5fYo4.js} +1 -1
  176. package/dist/frontend/assets/{pieDiagram-421022e6-CT-muZCn.js → pieDiagram-421022e6-Dl8pALsT.js} +1 -1
  177. package/dist/frontend/assets/{pieDiagram-8a3498a8-DtYj6G3V.js → pieDiagram-8a3498a8-rBzfDh4o.js} +1 -1
  178. package/dist/frontend/assets/{pl-PL-T2D74RX3-CwxEKsFG.js → pl-PL-T2D74RX3-CjZaoK9w.js} +1 -1
  179. package/dist/frontend/assets/{pt-BR-5N22H2LF-MbElHXpG.js → pt-BR-5N22H2LF-s3ixCOkJ.js} +1 -1
  180. package/dist/frontend/assets/{pt-PT-UZXXM6DQ-DM4vWcwF.js → pt-PT-UZXXM6DQ-CoUBIa6j.js} +1 -1
  181. package/dist/frontend/assets/{quadrantDiagram-0957ecba-CblbtN7K.js → quadrantDiagram-0957ecba-EksbVhl6.js} +1 -1
  182. package/dist/frontend/assets/{quadrantDiagram-120e2f19-jzz3ehZq.js → quadrantDiagram-120e2f19-CktkC7UT.js} +1 -1
  183. package/dist/frontend/assets/{requirementDiagram-23d650b8-C-JoH6A7.js → requirementDiagram-23d650b8-DEopC6db.js} +1 -1
  184. package/dist/frontend/assets/{requirementDiagram-deff3bca-Ctl4rNQu.js → requirementDiagram-deff3bca-CC80WbpO.js} +1 -1
  185. package/dist/frontend/assets/{ro-RO-JPDTUUEW-DdMtPkP_.js → ro-RO-JPDTUUEW-Bbw9iCSN.js} +1 -1
  186. package/dist/frontend/assets/{ru-RU-B4JR7IUQ-DFOiB9Jg.js → ru-RU-B4JR7IUQ-CZHHqw73.js} +1 -1
  187. package/dist/frontend/assets/{sankeyDiagram-04a897e0-CUAS8b8U.js → sankeyDiagram-04a897e0-_Xj8bCQC.js} +1 -1
  188. package/dist/frontend/assets/{sankeyDiagram-23345273-CjwxDsME.js → sankeyDiagram-23345273-CEXemcPc.js} +1 -1
  189. package/dist/frontend/assets/{selectAll-BMyQi_9w.js → selectAll-D-n6T_f8.js} +1 -1
  190. package/dist/frontend/assets/{sequenceDiagram-17ac3bff-BhnIexBX.js → sequenceDiagram-17ac3bff-GH91EKYV.js} +1 -1
  191. package/dist/frontend/assets/{sequenceDiagram-704730f1-DZhrMzp5.js → sequenceDiagram-704730f1-CVkxSLd8.js} +1 -1
  192. package/dist/frontend/assets/{si-LK-N5RQ5JYF-CoNWh4qU.js → si-LK-N5RQ5JYF-DwmyP-Mo.js} +1 -1
  193. package/dist/frontend/assets/{sk-SK-C5VTKIMK-Cv5NV02v.js → sk-SK-C5VTKIMK-DV1bZenk.js} +1 -1
  194. package/dist/frontend/assets/{sl-SI-NN7IZMDC-C_vlgIOB.js → sl-SI-NN7IZMDC-BK2Zi_zn.js} +1 -1
  195. package/dist/frontend/assets/{stateDiagram-587899a1-CACHP_Jt.js → stateDiagram-587899a1-BeYLYWNF.js} +1 -1
  196. package/dist/frontend/assets/{stateDiagram-9c5f0230-DsuPkPjh.js → stateDiagram-9c5f0230-Cxuwv8Kd.js} +1 -1
  197. package/dist/frontend/assets/{stateDiagram-v2-51a3dcff-B5h534aI.js → stateDiagram-v2-51a3dcff-CNFwMiQ0.js} +1 -1
  198. package/dist/frontend/assets/{stateDiagram-v2-d93cdb3a-Dm93b3N0.js → stateDiagram-v2-d93cdb3a-5aVWGtU-.js} +1 -1
  199. package/dist/frontend/assets/{styles-2ab5d517-DsYBO0WP.js → styles-2ab5d517-Cpfmvcp5.js} +1 -1
  200. package/dist/frontend/assets/{styles-5f03d8d2-LS13RtPA.js → styles-5f03d8d2-qddx0_9K.js} +1 -1
  201. package/dist/frontend/assets/{styles-6aaf32cf-KUcsVvLX.js → styles-6aaf32cf-B-2WTBc4.js} +1 -1
  202. package/dist/frontend/assets/{styles-9a916d00-BjTkeUBK.js → styles-9a916d00-CN0F6be-.js} +1 -1
  203. package/dist/frontend/assets/{styles-c10674c1-0477ds-x.js → styles-c10674c1-CEEfSl05.js} +1 -1
  204. package/dist/frontend/assets/{styles-edf9a4b0-DxfsUCVO.js → styles-edf9a4b0-DHXM7msa.js} +1 -1
  205. package/dist/frontend/assets/subset-shared.chunk.js +1 -1
  206. package/dist/frontend/assets/subset-worker.chunk.js +1 -1
  207. package/dist/frontend/assets/{sv-SE-XGPEYMSR-BILGi8-a.js → sv-SE-XGPEYMSR-DTYa1sJx.js} +1 -1
  208. package/dist/frontend/assets/{svgDrawCommon-08f97a94-DK3eIkMD.js → svgDrawCommon-08f97a94-CHwlzhLZ.js} +1 -1
  209. package/dist/frontend/assets/{svgDrawCommon-3ba9043b-CnkFvHbE.js → svgDrawCommon-3ba9043b-n85eSiYv.js} +1 -1
  210. package/dist/frontend/assets/{ta-IN-2NMHFXQM-B2-G7tUs.js → ta-IN-2NMHFXQM-EsNqKJyl.js} +1 -1
  211. package/dist/frontend/assets/{th-TH-HPSO5L25-BaOUPhiZ.js → th-TH-HPSO5L25-Ca6GHTm_.js} +1 -1
  212. package/dist/frontend/assets/{timeline-definition-7e6b55e7-ChAZUdsQ.js → timeline-definition-7e6b55e7-BTKVtcIE.js} +1 -1
  213. package/dist/frontend/assets/{timeline-definition-85554ec2-FT1qcwfh.js → timeline-definition-85554ec2-CNR3gaJX.js} +1 -1
  214. package/dist/frontend/assets/{tr-TR-DEFEU3FU-_3NLP7we.js → tr-TR-DEFEU3FU-Cx33dqUv.js} +1 -1
  215. package/dist/frontend/assets/{uk-UA-QMV73CPH-e9ZZsONo.js → uk-UA-QMV73CPH-CgyIgoqy.js} +1 -1
  216. package/dist/frontend/assets/{union-j7EoioKl.js → union-ByT_sNuE.js} +1 -1
  217. package/dist/frontend/assets/{vi-VN-M7AON7JQ-Bl1etnNc.js → vi-VN-M7AON7JQ-bbYYfwkp.js} +1 -1
  218. package/dist/frontend/assets/{xychartDiagram-b6496bcd-DpRHtxW2.js → xychartDiagram-b6496bcd-B19I2K2s.js} +1 -1
  219. package/dist/frontend/assets/{xychartDiagram-e933f94c-CePJDM-w.js → xychartDiagram-e933f94c-R1AdCL9O.js} +1 -1
  220. package/dist/frontend/assets/{zh-CN-LNUGB5OW-BVkMlvEs.js → zh-CN-LNUGB5OW-C5YxrJBz.js} +1 -1
  221. package/dist/frontend/assets/{zh-HK-E62DVLB3-BMvPopwA.js → zh-HK-E62DVLB3-Bh25UqeW.js} +1 -1
  222. package/dist/frontend/assets/{zh-TW-RAJ6MFWO-D_Eu0QQx.js → zh-TW-RAJ6MFWO-DWbjYFDi.js} +1 -1
  223. package/dist/frontend/assets/{zipObject-DKSN1jwq.js → zipObject-BNcQvyjX.js} +1 -1
  224. package/dist/frontend/index.html +1 -1
  225. package/dist/index.d.ts +1 -0
  226. package/dist/index.d.ts.map +1 -1
  227. package/dist/index.js +93 -1010
  228. package/dist/index.js.map +1 -1
  229. package/dist/server.d.ts +2 -0
  230. package/dist/server.d.ts.map +1 -1
  231. package/dist/server.js +69 -5
  232. package/dist/server.js.map +1 -1
  233. package/dist/utils/logger.d.ts.map +1 -1
  234. package/dist/utils/logger.js +42 -2
  235. package/dist/utils/logger.js.map +1 -1
  236. package/package.json +13 -6
  237. package/skills/excalidraw-skill/SKILL.md +265 -0
  238. package/skills/excalidraw-skill/evals/evals.json +29 -0
  239. package/skills/excalidraw-skill/references/cheatsheet.md +192 -0
  240. package/src/bin.ts +45 -0
  241. package/src/cli/args.ts +92 -0
  242. package/src/cli/commands/arrange.ts +97 -0
  243. package/src/cli/commands/elements.ts +230 -0
  244. package/src/cli/commands/install-skill.ts +116 -0
  245. package/src/cli/commands/scene.ts +135 -0
  246. package/src/cli/commands/server.ts +69 -0
  247. package/src/cli/commands/snapshot.ts +46 -0
  248. package/src/cli/run.ts +107 -0
  249. package/src/cli/util.ts +38 -0
  250. package/src/core/canvas-client.ts +366 -0
  251. package/src/core/config.ts +14 -0
  252. package/src/core/describe.ts +100 -0
  253. package/src/core/design-guide.ts +94 -0
  254. package/src/core/entry.ts +37 -0
  255. package/src/core/geometry.ts +250 -0
  256. package/src/core/normalize.ts +124 -0
  257. package/src/core/pidfile.ts +52 -0
  258. package/src/core/scene-io.ts +109 -0
  259. package/src/core/share-url.ts +285 -0
  260. package/src/core/spawn.ts +182 -0
  261. package/src/core/version.ts +13 -0
  262. package/src/index.ts +143 -1191
  263. package/src/server.ts +70 -5
  264. package/src/utils/logger.ts +47 -3
  265. package/dist/frontend/assets/channel-Cb5NStnu.js +0 -1
  266. package/dist/frontend/assets/clone-90Lq8jWj.js +0 -1
  267. package/dist/frontend/assets/flowDiagram-v2-96b9c2cf-FcyWkMPn.js +0 -1
  268. package/dist/frontend/assets/flowDiagram-v2-ffc7f31a-BpjLoFsq.js +0 -1
package/README.md CHANGED
@@ -1,20 +1,23 @@
1
- # Excalidraw MCP Server & Agent Skill
1
+ # Excalidraw MCP Server, CLI & Agent Skill
2
2
 
3
3
  [![CI](https://github.com/yctimlin/mcp_excalidraw/actions/workflows/ci.yml/badge.svg)](https://github.com/yctimlin/mcp_excalidraw/actions/workflows/ci.yml)
4
4
  [![Docker Build & Push](https://github.com/yctimlin/mcp_excalidraw/actions/workflows/docker.yml/badge.svg)](https://github.com/yctimlin/mcp_excalidraw/actions/workflows/docker.yml)
5
5
  [![NPM Version](https://img.shields.io/npm/v/mcp-excalidraw-server)](https://www.npmjs.com/package/mcp-excalidraw-server)
6
6
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
7
 
8
- Run a live Excalidraw canvas and control it from AI agents. This repo provides:
8
+ **mcp-excalidraw-server** gives AI agents a live [Excalidraw](https://excalidraw.com) canvas they can draw on, look at, refine, and save into your repo. Your agent creates architecture diagrams and flowcharts programmatically, **sees its own work via screenshots**, fixes layout problems, and exports `.excalidraw` files you can commit next to your code.
9
9
 
10
- - **MCP Server**: Connect via Model Context Protocol (Claude Desktop, Cursor, Codex CLI, etc.)
11
- - **Agent Skill**: Portable skill for Claude Code, Codex CLI, and other skill-enabled agents
10
+ One canvas, three ways to drive it:
12
11
 
13
- Keywords: Excalidraw agent skill, Excalidraw MCP server, AI diagramming, Claude Code skill, Codex CLI skill, Claude Desktop MCP, Cursor MCP, Mermaid to Excalidraw.
12
+ - **Agent Skill + CLI** recommended for coding agents (Claude Code, Codex CLI, Cursor, OpenCode): `npx -y mcp-excalidraw-server <command>`. Zero config, auto-starts the canvas, composable JSON in/out.
13
+ - **MCP Server** — 26 tools over stdio for any Model Context Protocol client (Claude Desktop, Cursor, Codex CLI, Antigravity, ...).
14
+ - **REST API** — plain HTTP for LangChain and custom frameworks.
15
+
16
+ Core drawing runs fully local (Node ≥ 18, MIT licensed) — no API keys. Mermaid conversion runs in the local browser canvas; `share` is optional and uploads an encrypted scene to excalidraw.com.
14
17
 
15
18
  ## Demo
16
19
 
17
- ![MCP Excalidraw Demo](demo.gif)
20
+ ![AI agent drawing an architecture diagram on a live Excalidraw canvas via MCP](demo.gif)
18
21
 
19
22
  *AI agent creates a complete architecture diagram from a single prompt (4x speed). [Watch full video on YouTube](https://youtu.be/ufW78Amq5qA)*
20
23
 
@@ -24,8 +27,9 @@ Keywords: Excalidraw agent skill, Excalidraw MCP server, AI diagramming, Claude
24
27
  - [What It Is](#what-it-is)
25
28
  - [How We Differ from the Official Excalidraw MCP](#how-we-differ-from-the-official-excalidraw-mcp)
26
29
  - [What's New](#whats-new)
27
- - [Quick Start (Local)](#quick-start-local)
28
- - [Quick Start (Docker)](#quick-start-docker)
30
+ - [Installation](#installation)
31
+ - [Agent Skill](#agent-skill)
32
+ - [CLI Reference](#cli-reference)
29
33
  - [Configure MCP Clients](#configure-mcp-clients)
30
34
  - [Claude Desktop](#claude-desktop)
31
35
  - [Claude Code](#claude-code)
@@ -33,99 +37,173 @@ Keywords: Excalidraw agent skill, Excalidraw MCP server, AI diagramming, Claude
33
37
  - [Codex CLI](#codex-cli)
34
38
  - [OpenCode](#opencode)
35
39
  - [Antigravity (Google)](#antigravity-google)
36
- - [Agent Skill (Optional)](#agent-skill-optional)
37
40
  - [MCP Tools (26 Total)](#mcp-tools-26-total)
41
+ - [Quick Start (From Source / Docker)](#quick-start-from-source--docker)
38
42
  - [Testing](#testing)
43
+ - [FAQ](#faq)
39
44
  - [Troubleshooting](#troubleshooting)
40
45
  - [Known Issues / TODO](#known-issues--todo)
41
46
  - [Development](#development)
47
+ - [License](#license)
42
48
 
43
49
  ## What It Is
44
50
 
45
- This repo contains two separate processes:
51
+ Ask your agent to *"draw the architecture of this service"* and it produces a real, editable Excalidraw diagram — not a one-shot image. Because the agent can query, screenshot, and update individual elements, it iterates until labels fit, nothing overlaps, and arrows route cleanly; then it exports the result as a `.excalidraw` file that lives in your repo and gets updated when the code changes.
52
+
53
+ Under the hood there are two processes, one product:
54
+
55
+ - **Canvas server**: Excalidraw web UI + REST API + WebSocket real-time sync (default `http://127.0.0.1:3000`)
56
+ - **A thin front-end of your choice**: the CLI, the MCP stdio server, or raw HTTP — all drive the same canvas
46
57
 
47
- - Canvas server: web UI + REST API + WebSocket updates (default `http://127.0.0.1:3000`)
48
- - MCP server: exposes MCP tools over stdio; syncs to the canvas via `EXPRESS_SERVER_URL`
58
+ Since v1.1 the canvas server starts itself: canvas-driving CLI commands (and the MCP server on launch) auto-spawn it if nothing is listening. `status` only inspects the current server state. Set `EXCALIDRAW_NO_AUTOSTART=1` to opt out.
49
59
 
50
60
  ## How We Differ from the Official Excalidraw MCP
51
61
 
52
- Excalidraw now has an [official MCP](https://github.com/excalidraw/excalidraw-mcp) — it's great for quick, prompt-to-diagram generation rendered inline in chat. We solve a different problem.
62
+ Excalidraw has an [official MCP](https://github.com/excalidraw/excalidraw-mcp) — a chat widget that streams a diagram inline from a single prompt (the model gets two tools: a format reference and `create_view`). It's great for "draw me a cat" in Claude or ChatGPT. We solve a different problem: giving *coding agents* a persistent canvas workbench.
53
63
 
54
64
  | | Official Excalidraw MCP | This Project |
55
65
  |---|---|---|
56
- | **Approach** | Prompt in, diagram out (one-shot) | Programmatic element-level control (26 tools) |
57
- | **State** | Stateless each call is independent | Persistent live canvas with real-time sync |
58
- | **Element CRUD** | No | Full create / read / update / delete per element |
59
- | **AI sees the canvas** | No | `describe_scene` (structured text) + `get_canvas_screenshot` (image) |
60
- | **Iterative refinement** | No regenerate the whole diagram | Draw → look → adjust → look again, element by element |
61
- | **Layout tools** | No | `align_elements`, `distribute_elements`, `group / ungroup` |
62
- | **File I/O** | No | `export_scene` / `import_scene` (.excalidraw JSON) |
63
- | **Snapshot & rollback** | No | `snapshot_scene` / `restore_snapshot` |
64
- | **Mermaid conversion** | No | `create_from_mermaid` |
65
- | **Shareable URLs** | Yes | Yes `export_to_excalidraw_url` |
66
- | **Design guide** | `read_me` cheat sheet | `read_diagram_guide` (colors, sizing, layout, anti-patterns) |
67
- | **Viewport control** | Camera animations | `set_viewport` (zoom-to-fit, center on element, manual zoom) |
68
- | **Live canvas UI** | Rendered inline in chat | Standalone Excalidraw app synced via WebSocket |
69
- | **Multi-agent** | Single user | Multiple agents can draw on the same canvas concurrently |
70
- | **Works without MCP** | No | Yes — REST API fallback via agent skill |
71
-
72
- **TL;DR** — The official MCP generates diagrams. We give AI agents a full canvas toolkit to build, inspect, and iteratively refine diagrams — including the ability to see what they drew.
66
+ | **Approach** | Prompt in, diagram out (one-shot widget) | Programmatic element-level control (CLI + 26 MCP tools) |
67
+ | **State** | Checkpoints inside the chat widget | Persistent live canvas with real-time sync |
68
+ | **Element CRUD** | Declarative re-send with delete markers | Full create / read / update / delete per element |
69
+ | **AI sees the canvas** | No | `describe` (structured text) + `screenshot` (image) |
70
+ | **Iterative refinement** | Regenerate from checkpoint | Draw → look → adjust → look again, element by element |
71
+ | **Layout tools** | No | align, distribute, group / ungroup, lock, duplicate |
72
+ | **File I/O** | No model-facing export | `.excalidraw` export/import diagrams as repo artifacts |
73
+ | **Snapshot & rollback** | Widget-side checkpoints | Named server-side snapshots |
74
+ | **Mermaid conversion** | No | `mermaid` / `create_from_mermaid` |
75
+ | **Shareable URLs** | Widget-only | `share` / `export_to_excalidraw_url` |
76
+ | **Works without MCP** | No | Yes CLI + agent skill + REST API |
77
+ | **Multi-agent** | Single chat | Multiple agents on the same canvas concurrently |
78
+
79
+ **TL;DR** The official MCP shows Excalidraw diagrams in your chat. This project gives your coding agent a full Excalidraw workbench: a canvas it can draw on, inspect, refine, and commit to your repo.
73
80
 
74
81
  ## What's New
75
82
 
76
- ### v2.0 — Canvas Toolkit
83
+ Current package version: **1.1.0**. The current release line is **v1.1 CLI-First**.
77
84
 
78
- - 13 new MCP tools (26 total): `get_element`, `clear_canvas`, `export_scene`, `import_scene`, `export_to_image`, `duplicate_elements`, `snapshot_scene`, `restore_snapshot`, `describe_scene`, `get_canvas_screenshot`, `read_diagram_guide`, `export_to_excalidraw_url`, `set_viewport`
79
- - **Closed feedback loop**: AI can now inspect the canvas (`describe_scene`) and see it (`get_canvas_screenshot` returns an image) — enabling iterative refinement
80
- - **Design guide**: `read_diagram_guide` returns best-practice color palettes, sizing rules, layout patterns, and anti-patterns — dramatically improves AI-generated diagram quality
81
- - **Shareable URLs**: `export_to_excalidraw_url` encrypts and uploads the scene to excalidraw.com, returns a shareable link anyone can open
82
- - **Viewport control**: `set_viewport` with `scrollToContent`, `scrollToElementId`, or manual zoom/offset — agents can auto-fit diagrams after creation
83
- - **File I/O**: export/import full `.excalidraw` JSON files
84
- - **Snapshots**: save and restore named canvas states
85
- - **Skill fallback**: Agent skill auto-detects MCP vs REST API mode, gracefully falls back to HTTP endpoints when MCP server isn't configured
86
- - Fixed all previously known issues: `align_elements` / `distribute_elements` fully implemented, points type normalization, removed invalid `label` type, removed HTTP transport dead code, `ungroup_elements` now errors on failure
85
+ ### v1.1 CLI-First
87
86
 
88
- ### v1.x
87
+ - **First-class CLI**: every capability is now a composable command — `npx -y mcp-excalidraw-server add|query|describe|screenshot|export|import|mermaid|snapshot|arrange|share|...` — JSON on stdout, meaningful exit codes. Also installed as the `excalidraw-canvas` alias.
88
+ - **Zero-setup**: canvas-driving CLI commands and the MCP server **auto-start the canvas server** if it isn't running (closes #66). Opt out with `EXCALIDRAW_NO_AUTOSTART=1`.
89
+ - **`apply`**: multi-op patches (`{"create":[...],"update":[{"id":"a","set":{...}}],"delete":[...]}`) in a single invocation.
90
+ - **`install-skill`**: `npx -y mcp-excalidraw-server install-skill --dir <skills-root>` copies the portable agent skill into the directory your agent chooses (project or global), cleanly replacing older versions.
91
+ - **Skill is now CLI-first** and no longer needs a cloned repo or configured MCP server to work.
92
+ - **Typed queries**: `query --filter locked=true --filter label.text=API` — booleans, numbers, and nested keys work.
93
+ - **Internals**: shared core library (`src/core/`) behind both the CLI and MCP server; canvas `groupIds` are the source of truth for grouping (ungroup now works across restarts); `node-fetch` dropped; MCP version metadata derived from `package.json`; canvas server writes a pidfile and shuts down cleanly.
89
94
 
90
- - Agent skill: `skills/excalidraw-skill/` (portable instructions + helper scripts for export/import and repeatable CRUD)
91
- - Better testing loop: MCP Inspector CLI examples + browser screenshot checks (`agent-browser`)
92
- - Bugfixes: batch create now preserves element ids (fixes update/delete after batch); frontend entrypoint fixed (`main.tsx`)
95
+ ## Installation
93
96
 
94
- ## Quick Start (Local)
97
+ The only prerequisite is **Node.js ≥ 18**.
95
98
 
96
- Prereqs: Node >= 18, npm
99
+ ### Easiest: let your agent install it
97
100
 
98
- ```bash
99
- npm ci
100
- npm run build
101
+ Copy this into your coding agent — it installs the portable skill into the project/global skill directory that agent already knows how to use, then verifies it by drawing a test diagram:
102
+
103
+ ```text
104
+ Install the Excalidraw canvas toolkit so you can draw diagrams for me:
105
+
106
+ 1. Choose the right skill directory for this agent and scope (project or global).
107
+ 2. Run: npx -y mcp-excalidraw-server install-skill --dir <that-skills-directory>
108
+ 3. Read the installed excalidraw-skill/SKILL.md so you know the drawing workflow.
109
+ 4. Start the canvas with: npx -y mcp-excalidraw-server start
110
+ then tell me to open http://127.0.0.1:3000 in my browser (screenshots need an open tab).
111
+ 5. Draw a small test diagram — two labeled boxes connected by an arrow — take a
112
+ screenshot, and show me the result to confirm everything works.
101
113
  ```
102
114
 
103
- Terminal 1: start the canvas
115
+ ### Manual install
116
+
117
+ | You are... | Install with | Then |
118
+ |---|---|---|
119
+ | **Modern coding agent** | `npx -y mcp-excalidraw-server install-skill --dir <skills-root>` | Let the agent choose project/global scope and its skill root |
120
+ | **Claude Code shortcut** | `npx -y mcp-excalidraw-server install-skill` | Installs to `~/.claude/skills` for backward compatibility |
121
+ | **Codex shortcut** | `npx -y mcp-excalidraw-server install-skill --target codex` | Installs to `~/.codex/skills` for backward compatibility |
122
+ | **MCP client user** (Claude Desktop, Cursor, ...) | Add the npx config below | See [Configure MCP Clients](#configure-mcp-clients) |
123
+ | **CLI user / scripting** | Nothing — `npx -y mcp-excalidraw-server <command>` | See [CLI Reference](#cli-reference) |
124
+ | **Contributor / from source** | `git clone` + `npm ci` + `npm run build` | See [Quick Start (From Source / Docker)](#quick-start-from-source--docker) |
125
+
126
+ There is no separate server setup: any drawing command auto-starts the local canvas server on `http://127.0.0.1:3000`.
127
+
128
+ ### 60-Second Quick Start (CLI)
129
+
130
+ No clone, no config:
131
+
104
132
  ```bash
105
- PORT=3000 npm run canvas
133
+ # start the canvas (drawing commands auto-start it too) and open it
134
+ npx -y mcp-excalidraw-server start
135
+ open http://127.0.0.1:3000 # browser tab enables screenshots & mermaid
136
+
137
+ # draw something
138
+ echo '[
139
+ {"id":"api","type":"rectangle","x":100,"y":100,"width":160,"height":80,"text":"API Server","backgroundColor":"#a5d8ff"},
140
+ {"id":"db","type":"rectangle","x":400,"y":100,"width":160,"height":80,"text":"Database","backgroundColor":"#99e9f2"},
141
+ {"type":"arrow","x":0,"y":0,"startElementId":"api","endElementId":"db","text":"SQL"}
142
+ ]' | npx -y mcp-excalidraw-server add
143
+
144
+ # let your agent see its work
145
+ npx -y mcp-excalidraw-server describe
146
+ npx -y mcp-excalidraw-server screenshot --out diagram.png
147
+
148
+ # diagrams as repo artifacts
149
+ mkdir -p docs
150
+ npx -y mcp-excalidraw-server export --out docs/architecture.excalidraw
106
151
  ```
107
152
 
108
- > **Security note:** The server defaults to binding on `127.0.0.1` only. If you need to expose it on a network interface (e.g. Docker, remote access), set `HOST=0.0.0.0` — but ensure you have network-level access controls in place, as the API has no built-in authentication.
109
-
110
- Open `http://127.0.0.1:3000`.
153
+ Give your agent the full playbook:
111
154
 
112
- Terminal 2: run the MCP server (stdio)
113
155
  ```bash
114
- EXPRESS_SERVER_URL=http://127.0.0.1:3000 node dist/index.js
156
+ npx -y mcp-excalidraw-server install-skill --dir <skills-root>
157
+ npx -y mcp-excalidraw-server install-skill --print-source # inspect bundled source path
115
158
  ```
116
159
 
117
- ## Quick Start (Docker)
160
+ > **Security note:** The canvas server binds `127.0.0.1` only by default. If you expose it on a network interface (`HOST=0.0.0.0`), put network-level access controls in front — the API has no built-in authentication.
161
+
162
+ ## Agent Skill
163
+
164
+ The skill at `skills/excalidraw-skill/` teaches agents the full workflow — layout planning, the screenshot-verify-fix quality loop, arrow routing, anti-patterns, snapshots, and file I/O. It works through the CLI (preferred, zero setup), MCP tools (if configured), or raw REST — in that order.
118
165
 
119
- Canvas server:
120
166
  ```bash
121
- docker run -d -p 3000:3000 --name mcp-excalidraw-canvas ghcr.io/yctimlin/mcp_excalidraw-canvas:latest
167
+ npx -y mcp-excalidraw-server install-skill --dir <skills-root>
122
168
  ```
123
169
 
124
- MCP server (stdio) is typically launched by your MCP client (Claude Desktop/Cursor/etc.). If you want a local container for it, use the image `ghcr.io/yctimlin/mcp_excalidraw:latest` and set `EXPRESS_SERVER_URL` to point at the canvas.
170
+ The command copies the bundled `excalidraw-skill/` directory into `<skills-root>/excalidraw-skill`. Let your agent choose whether that root should be project-level or global. Re-running `install-skill` upgrades in place it replaces the target directory, so files removed upstream don't linger.
171
+
172
+ Where the skill shines:
173
+
174
+ - **Diagrams as code artifacts**: export `.excalidraw` files into the repo, commit them, re-import + refine when the architecture changes.
175
+ - **Self-verifying diagrams**: the agent screenshots its own work and fixes truncation/overlap before calling it done.
176
+ - **No-MCP environments**: CI jobs, plain shells, and frameworks get the same capabilities through the CLI.
177
+
178
+ ## CLI Reference
179
+
180
+ `npx -y mcp-excalidraw-server <command>` or (after `npm i -g mcp-excalidraw-server`) `excalidraw-canvas <command>`.
181
+
182
+ Conventions: JSON results on stdout — except `describe` (plain text by design) and raw-content output when `--out` is omitted (`export` prints the scene JSON, `screenshot --format svg` prints SVG). Diagnostics on stderr. Exit codes: `0` ok, `1` error, `2` usage, `3` canvas unreachable, `4` browser tab required. Canvas URL from `EXPRESS_SERVER_URL` or `--url`. Canvas-driving commands auto-start the server; `status` only reports current state. Explicit `start` overrides the `EXCALIDRAW_NO_AUTOSTART=1` opt-out (it's user intent, not auto-start).
183
+
184
+ | Command | Description |
185
+ |---------|-------------|
186
+ | `start` / `stop` / `status` | Manage the canvas server (detached; `stop` identity-checks the live server via `/health` before signaling) |
187
+ | `add [file\|-]` | Batch-create elements from a JSON array (file or stdin); `--one '{...}'` for a single element |
188
+ | `apply [file\|-]` | One-call multi-op patch: `{"create":[...],"update":[{"id":"a","set":{...}}],"delete":["id"]}` |
189
+ | `get <id>` / `delete <id...>` | Read / remove elements |
190
+ | `update <id> --set '{...}'` | Update an element |
191
+ | `query` | `--type`, `--bbox x0,y0,x1,y1`, `--filter k=v` (typed, nested keys), `--filter-json '{...}'` |
192
+ | `describe` | AI-readable scene summary (plain text) |
193
+ | `screenshot` | `--out f.png`, `--format png\|svg`, `--no-background` (browser tab required) |
194
+ | `export [--out f.excalidraw]` / `import [file\|-] [--replace]` | Scene file I/O |
195
+ | `mermaid [file\|-]` | Mermaid → canvas (browser tab required) |
196
+ | `snapshot save\|list\|restore <name>` | Named snapshots |
197
+ | `arrange align\|distribute\|group\|ungroup\|lock\|unlock\|duplicate` | Layout ops (`--ids a,b,c`, `--to left\|horizontal\|...`) |
198
+ | `share` | Encrypted upload → shareable excalidraw.com URL |
199
+ | `clear --yes` | Wipe the canvas |
200
+ | `install-skill [--dir <skills-root>]` | Install the portable agent skill |
201
+
202
+ Labels and arrow bindings use the agent-friendly format everywhere in the CLI: `"text"` on any shape, `"startElementId"`/`"endElementId"` on arrows — normalization is automatic.
125
203
 
126
204
  ## Configure MCP Clients
127
205
 
128
- The MCP server runs over stdio and can be configured with any MCP-compatible client. Below are configurations for both **local** (requires cloning and building) and **Docker** (pull-and-run) setups.
206
+ The MCP server runs over stdio. Since v1.1 the simplest config is `npx` no clone, no absolute paths, and the canvas auto-starts:
129
207
 
130
208
  ### Environment Variables
131
209
 
@@ -133,6 +211,9 @@ The MCP server runs over stdio and can be configured with any MCP-compatible cli
133
211
  |----------|-------------|---------|
134
212
  | `EXPRESS_SERVER_URL` | URL of the canvas server | `http://127.0.0.1:3000` |
135
213
  | `ENABLE_CANVAS_SYNC` | Enable real-time canvas sync | `true` |
214
+ | `EXCALIDRAW_NO_AUTOSTART` | Set `1` to disable canvas auto-start | (unset) |
215
+ | `EXCALIDRAW_EXPORT_DIR` | Base directory MCP file exports may write to | current working dir |
216
+ | `PORT` / `HOST` | Canvas server bind address | `3000` / `127.0.0.1` |
136
217
 
137
218
  ---
138
219
 
@@ -143,6 +224,18 @@ Config location:
143
224
  - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
144
225
  - Linux: `~/.config/Claude/claude_desktop_config.json`
145
226
 
227
+ **npx (recommended)**
228
+ ```json
229
+ {
230
+ "mcpServers": {
231
+ "excalidraw": {
232
+ "command": "npx",
233
+ "args": ["-y", "mcp-excalidraw-server"]
234
+ }
235
+ }
236
+ }
237
+ ```
238
+
146
239
  **Local (node)**
147
240
  ```json
148
241
  {
@@ -180,19 +273,16 @@ Config location:
180
273
 
181
274
  ### Claude Code
182
275
 
183
- Use the `claude mcp add` command to register the MCP server.
184
-
185
- **Local (node)** - User-level (available across all projects):
276
+ **npx (recommended)**
186
277
  ```bash
187
- claude mcp add excalidraw --scope user \
188
- -e EXPRESS_SERVER_URL=http://127.0.0.1:3000 \
189
- -e ENABLE_CANVAS_SYNC=true \
190
- -- node /absolute/path/to/mcp_excalidraw/dist/index.js
278
+ claude mcp add excalidraw --scope user -- npx -y mcp-excalidraw-server
191
279
  ```
192
280
 
193
- **Local (node)** - Project-level (shared via `.mcp.json`):
281
+ > Tip: for coding agents, the skill + CLI often beats MCP config entirely — let the agent pick its skill root, then run `npx -y mcp-excalidraw-server install-skill --dir <skills-root>`.
282
+
283
+ **Local (node)** - User-level (available across all projects):
194
284
  ```bash
195
- claude mcp add excalidraw --scope project \
285
+ claude mcp add excalidraw --scope user \
196
286
  -e EXPRESS_SERVER_URL=http://127.0.0.1:3000 \
197
287
  -e ENABLE_CANVAS_SYNC=true \
198
288
  -- node /absolute/path/to/mcp_excalidraw/dist/index.js
@@ -219,17 +309,13 @@ claude mcp remove excalidraw # Remove a server
219
309
 
220
310
  Config location: `.cursor/mcp.json` in your project root (or `~/.cursor/mcp.json` for global config)
221
311
 
222
- **Local (node)**
312
+ **npx (recommended)**
223
313
  ```json
224
314
  {
225
315
  "mcpServers": {
226
316
  "excalidraw": {
227
- "command": "node",
228
- "args": ["/absolute/path/to/mcp_excalidraw/dist/index.js"],
229
- "env": {
230
- "EXPRESS_SERVER_URL": "http://127.0.0.1:3000",
231
- "ENABLE_CANVAS_SYNC": "true"
232
- }
317
+ "command": "npx",
318
+ "args": ["-y", "mcp-excalidraw-server"]
233
319
  }
234
320
  }
235
321
  }
@@ -256,14 +342,9 @@ Config location: `.cursor/mcp.json` in your project root (or `~/.cursor/mcp.json
256
342
 
257
343
  ### Codex CLI
258
344
 
259
- Use the `codex mcp add` command to register the MCP server.
260
-
261
- **Local (node)**
345
+ **npx (recommended)**
262
346
  ```bash
263
- codex mcp add excalidraw \
264
- --env EXPRESS_SERVER_URL=http://127.0.0.1:3000 \
265
- --env ENABLE_CANVAS_SYNC=true \
266
- -- node /absolute/path/to/mcp_excalidraw/dist/index.js
347
+ codex mcp add excalidraw -- npx -y mcp-excalidraw-server
267
348
  ```
268
349
 
269
350
  **Docker**
@@ -287,32 +368,13 @@ codex mcp remove excalidraw # Remove a server
287
368
 
288
369
  Config location: `~/.config/opencode/opencode.json` or project-level `opencode.json`
289
370
 
290
- **Local (node)**
291
371
  ```json
292
372
  {
293
373
  "$schema": "https://opencode.ai/config.json",
294
374
  "mcp": {
295
375
  "excalidraw": {
296
376
  "type": "local",
297
- "command": ["node", "/absolute/path/to/mcp_excalidraw/dist/index.js"],
298
- "enabled": true,
299
- "environment": {
300
- "EXPRESS_SERVER_URL": "http://127.0.0.1:3000",
301
- "ENABLE_CANVAS_SYNC": "true"
302
- }
303
- }
304
- }
305
- }
306
- ```
307
-
308
- **Docker**
309
- ```json
310
- {
311
- "$schema": "https://opencode.ai/config.json",
312
- "mcp": {
313
- "excalidraw": {
314
- "type": "local",
315
- "command": ["docker", "run", "-i", "--rm", "-e", "EXPRESS_SERVER_URL=http://host.docker.internal:3000", "-e", "ENABLE_CANVAS_SYNC=true", "ghcr.io/yctimlin/mcp_excalidraw:latest"],
377
+ "command": ["npx", "-y", "mcp-excalidraw-server"],
316
378
  "enabled": true
317
379
  }
318
380
  }
@@ -325,34 +387,12 @@ Config location: `~/.config/opencode/opencode.json` or project-level `opencode.j
325
387
 
326
388
  Config location: `~/.gemini/antigravity/mcp_config.json`
327
389
 
328
- **Local (node)**
329
- ```json
330
- {
331
- "mcpServers": {
332
- "excalidraw": {
333
- "command": "node",
334
- "args": ["/absolute/path/to/mcp_excalidraw/dist/index.js"],
335
- "env": {
336
- "EXPRESS_SERVER_URL": "http://127.0.0.1:3000",
337
- "ENABLE_CANVAS_SYNC": "true"
338
- }
339
- }
340
- }
341
- }
342
- ```
343
-
344
- **Docker**
345
390
  ```json
346
391
  {
347
392
  "mcpServers": {
348
393
  "excalidraw": {
349
- "command": "docker",
350
- "args": [
351
- "run", "-i", "--rm",
352
- "-e", "EXPRESS_SERVER_URL=http://host.docker.internal:3000",
353
- "-e", "ENABLE_CANVAS_SYNC=true",
354
- "ghcr.io/yctimlin/mcp_excalidraw:latest"
355
- ]
394
+ "command": "npx",
395
+ "args": ["-y", "mcp-excalidraw-server"]
356
396
  }
357
397
  }
358
398
  }
@@ -362,66 +402,8 @@ Config location: `~/.gemini/antigravity/mcp_config.json`
362
402
 
363
403
  ### Notes
364
404
 
365
- - **Docker networking**: Use `host.docker.internal` to reach the canvas server running on your host machine. On Linux, you may need `--add-host=host.docker.internal:host-gateway` or use `172.17.0.1`.
366
- - **Canvas server**: Must be running before the MCP server connects. Start it with `npm run canvas` (local) or `docker run -d -p 3000:3000 ghcr.io/yctimlin/mcp_excalidraw-canvas:latest` (Docker).
367
- - **Absolute paths**: When using local node setup, replace `/absolute/path/to/mcp_excalidraw` with the actual path where you cloned and built the repo.
368
- - **In-memory storage**: The canvas server stores elements in memory. Restarting the server will clear all elements. Use the export/import scripts if you need persistence.
369
-
370
- ## Agent Skill (Optional)
371
-
372
- This repo includes a skill at `skills/excalidraw-skill/` that provides:
373
-
374
- - **Workflow playbook** (`SKILL.md`): step-by-step guidance for drawing, refining, and exporting diagrams
375
- - **Cheatsheet** (`references/cheatsheet.md`): MCP tool and REST API reference
376
- - **Helper scripts** (`scripts/*.cjs`): export, import, clear, healthcheck, CRUD operations
377
-
378
- The skill complements the MCP server by giving your AI agent structured workflows to follow.
379
-
380
- ### Install The Skill (Codex CLI example)
381
-
382
- ```bash
383
- mkdir -p ~/.codex/skills
384
- cp -R skills/excalidraw-skill ~/.codex/skills/excalidraw-skill
385
- ```
386
-
387
- To update an existing installation, remove the old folder first (`rm -rf ~/.codex/skills/excalidraw-skill`) then re-copy.
388
-
389
- ### Install The Skill (Claude Code)
390
-
391
- **User-level** (available across all your projects):
392
- ```bash
393
- mkdir -p ~/.claude/skills
394
- cp -R skills/excalidraw-skill ~/.claude/skills/excalidraw-skill
395
- ```
396
-
397
- **Project-level** (scoped to a specific project, can be committed to the repo):
398
- ```bash
399
- mkdir -p /path/to/your/project/.claude/skills
400
- cp -R skills/excalidraw-skill /path/to/your/project/.claude/skills/excalidraw-skill
401
- ```
402
-
403
- Then invoke the skill in Claude Code with `/excalidraw-skill`.
404
-
405
- To update an existing installation, remove the old folder first then re-copy.
406
-
407
- ### Use The Skill Scripts
408
-
409
- All scripts respect `EXPRESS_SERVER_URL` (default `http://127.0.0.1:3000`) or accept `--url`.
410
-
411
- ```bash
412
- EXPRESS_SERVER_URL=http://127.0.0.1:3000 node skills/excalidraw-skill/scripts/healthcheck.cjs
413
- EXPRESS_SERVER_URL=http://127.0.0.1:3000 node skills/excalidraw-skill/scripts/export-elements.cjs --out diagram.elements.json
414
- EXPRESS_SERVER_URL=http://127.0.0.1:3000 node skills/excalidraw-skill/scripts/import-elements.cjs --in diagram.elements.json --mode batch
415
- ```
416
-
417
- ### When The Skill Is Useful
418
-
419
- - Repository workflow: export elements as JSON, commit it, and re-import later.
420
- - Reliable refactors: clear + re-import in `sync` mode to make canvas match a file.
421
- - Automated smoke tests: create/update/delete a known element to validate a deployment.
422
- - Repeatable diagrams: keep a library of element JSON snippets and import them.
423
-
424
- See `skills/excalidraw-skill/SKILL.md` and `skills/excalidraw-skill/references/cheatsheet.md`.
405
+ - **Docker networking**: Use `host.docker.internal` to reach the canvas server running on your host machine. On Linux, you may need `--add-host=host.docker.internal:host-gateway` or use `172.17.0.1`. The Docker MCP image sets `EXCALIDRAW_NO_AUTOSTART=1` (it has no frontend build) — run the canvas as its own container.
406
+ - **In-memory storage**: The canvas server stores elements in memory. Restarting the server clears all elements use `export` / `snapshot` for persistence.
425
407
 
426
408
  ## MCP Tools (26 Total)
427
409
 
@@ -438,8 +420,36 @@ See `skills/excalidraw-skill/SKILL.md` and `skills/excalidraw-skill/references/c
438
420
 
439
421
  Full schemas are discoverable via `tools/list` or in `skills/excalidraw-skill/references/cheatsheet.md`.
440
422
 
423
+ ## Quick Start (From Source / Docker)
424
+
425
+ From source (Node >= 18):
426
+
427
+ ```bash
428
+ npm ci
429
+ npm run build
430
+ PORT=3000 npm run canvas # canvas server (terminal 1)
431
+ node dist/index.js # MCP server over stdio (terminal 2, usually launched by your MCP client)
432
+ node dist/bin.js status # or drive the CLI straight from the build
433
+ ```
434
+
435
+ Docker canvas server:
436
+ ```bash
437
+ docker run -d -p 3000:3000 --name mcp-excalidraw-canvas ghcr.io/yctimlin/mcp_excalidraw-canvas:latest
438
+ ```
439
+
440
+ MCP server image: `ghcr.io/yctimlin/mcp_excalidraw:latest` (stdio; point `EXPRESS_SERVER_URL` at the canvas container).
441
+
441
442
  ## Testing
442
443
 
444
+ ### CLI Smoke Test
445
+
446
+ ```bash
447
+ npx -y mcp-excalidraw-server start
448
+ npx -y mcp-excalidraw-server status
449
+ npx -y mcp-excalidraw-server add --one '{"type":"rectangle","x":100,"y":100,"width":300,"height":200}'
450
+ npx -y mcp-excalidraw-server describe
451
+ ```
452
+
443
453
  ### Canvas Smoke Test (HTTP)
444
454
 
445
455
  ```bash
@@ -482,17 +492,51 @@ agent-browser wait --load networkidle
482
492
  agent-browser screenshot /tmp/canvas.png
483
493
  ```
484
494
 
495
+ ## FAQ
496
+
497
+ ### How is this different from the official Excalidraw MCP?
498
+
499
+ The [official Excalidraw MCP](https://github.com/excalidraw/excalidraw-mcp) is a chat widget: you prompt, it streams a diagram into the conversation (the model gets two tools). This project is a **workbench for coding agents**: a persistent local canvas with element-level create/read/update/delete, layout tools, screenshots the model can see, snapshots, and `.excalidraw` file I/O — driveable via CLI, MCP, or REST. See the [full comparison table](#how-we-differ-from-the-official-excalidraw-mcp).
500
+
501
+ ### Which AI tools does it work with?
502
+
503
+ Claude Code, Claude Desktop, Cursor, Codex CLI, OpenCode, and Google Antigravity are documented below — but any agent that can run shell commands can use the CLI, any MCP client can use the MCP server, and anything else (LangChain, custom apps) can use the REST API.
504
+
505
+ ### Can the AI actually see the diagram it drew?
506
+
507
+ Yes — that's the core feature. `describe` returns a structured text summary (ids, positions, labels, connections) and `screenshot` returns a rendered PNG. Agents use both to catch truncated labels, overlaps, and bad arrow routing, then fix them element by element.
508
+
509
+ ### Do I need a browser open?
510
+
511
+ Only for rendering-dependent features: screenshots, PNG/SVG export, viewport control, and Mermaid conversion (they render in the Excalidraw frontend). Creating, querying, updating elements and exporting `.excalidraw` JSON all work headless. The CLI exits with code `4` and tells you when a browser tab is needed.
512
+
513
+ ### Are my diagrams persistent?
514
+
515
+ The canvas is in-memory by design (restart = blank canvas). Persist by exporting `.excalidraw` files into your repo (`export --out docs/architecture.excalidraw`) or with named `snapshot`s while working. Re-`import` a file to keep refining it later.
516
+
517
+ ### Are excalidraw.com share links private?
518
+
519
+ `share` encrypts the scene locally with AES-GCM before uploading; the decryption key is only in the URL fragment, which excalidraw.com's server never sees. Anyone you give the full link to can view the diagram.
520
+
521
+ ### Does it need an API key or cloud service?
522
+
523
+ No API key is required. Core drawing runs locally under MIT license. The only outbound call is the optional `share` upload to excalidraw.com.
524
+
525
+ ### Can I use it without configuring MCP?
526
+
527
+ Yes — that's the recommended path for coding agents: `npx -y mcp-excalidraw-server install-skill --dir <skills-root>` and the agent drives everything through the CLI. MCP configuration is only needed for chat clients like Claude Desktop.
528
+
485
529
  ## Troubleshooting
486
530
 
487
- - Canvas not updating: confirm `EXPRESS_SERVER_URL` points at the running canvas server.
488
- - Updates/deletes fail after batch creation: ensure you are on a build that includes the batch id preservation fix (merged via PR #34).
531
+ - **CLI exit code 3** (canvas unreachable): the server is not running for an inspecting command such as `status`, auto-start is disabled (`EXCALIDRAW_NO_AUTOSTART=1`), or `EXPRESS_SERVER_URL` points at a non-loopback host. Run `start` explicitly or fix the env.
532
+ - **CLI exit code 4** (browser required): screenshots, image export, viewport, and mermaid conversion render in the frontend open `http://127.0.0.1:3000` in a browser and retry.
533
+ - **Canvas not updating**: confirm `EXPRESS_SERVER_URL` points at the running canvas server (`status` shows the URL in use).
534
+ - **Updates/deletes fail after batch creation**: ensure you are on a build that includes the batch id preservation fix (merged via PR #34).
489
535
 
490
536
  ## Known Issues / TODO
491
537
 
492
- All previously listed bugs have been fixed in v2.0. Remaining items:
493
-
494
- - [ ] **Persistent storage**: Elements are stored in-memory — restarting the server clears everything. Use `export_scene` / snapshots as a workaround.
495
- - [ ] **Image export requires a browser**: `export_to_image` and `get_canvas_screenshot` rely on the frontend doing the actual rendering. The canvas UI must be open in a browser.
538
+ - [ ] **Persistent storage**: Elements are stored in-memory — restarting the server clears everything. Use `export` / snapshots as a workaround.
539
+ - [ ] **Image export requires a browser**: screenshots and image export rely on the frontend doing the actual rendering. A headless rendering mode is planned.
496
540
 
497
541
  Contributions welcome!
498
542
 
@@ -501,4 +545,14 @@ Contributions welcome!
501
545
  ```bash
502
546
  npm run type-check
503
547
  npm run build
548
+ npm run cli -- status # run the CLI from the local build
549
+ npm run sync:skills # after editing skills/excalidraw-skill, sync the repo-local agent copy
504
550
  ```
551
+
552
+ Bug reports and pull requests are welcome on [GitHub issues](https://github.com/yctimlin/mcp_excalidraw/issues). If this project helps you, a ⭐ helps others find it.
553
+
554
+ ## License
555
+
556
+ [MIT](LICENSE) © [yctimlin](https://github.com/yctimlin) — not affiliated with the Excalidraw team. [Excalidraw](https://github.com/excalidraw/excalidraw) is its own MIT-licensed project; this toolkit builds on it with love.
557
+
558
+ **Links:** [npm package](https://www.npmjs.com/package/mcp-excalidraw-server) · [GitHub](https://github.com/yctimlin/mcp_excalidraw) · [Issues](https://github.com/yctimlin/mcp_excalidraw/issues) · [Demo video](https://youtu.be/ufW78Amq5qA)
package/dist/bin.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AA4CA,OAAO,EAAE,CAAC"}