@macula-io/mcp 0.3.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.
- package/LICENSE +201 -0
- package/README.md +192 -0
- package/dist/bin/install.d.ts +2 -0
- package/dist/bin/install.js +146 -0
- package/dist/bin/install.js.map +1 -0
- package/dist/bin/status.d.ts +2 -0
- package/dist/bin/status.js +86 -0
- package/dist/bin/status.js.map +1 -0
- package/dist/bin/uninstall.d.ts +2 -0
- package/dist/bin/uninstall.js +81 -0
- package/dist/bin/uninstall.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/dist/install/config_merge.d.ts +24 -0
- package/dist/install/config_merge.js +141 -0
- package/dist/install/config_merge.js.map +1 -0
- package/dist/install/existing_cli.d.ts +6 -0
- package/dist/install/existing_cli.js +24 -0
- package/dist/install/existing_cli.js.map +1 -0
- package/dist/install/mcp_clients/claude_code.d.ts +7 -0
- package/dist/install/mcp_clients/claude_code.js +51 -0
- package/dist/install/mcp_clients/claude_code.js.map +1 -0
- package/dist/install/mcp_clients/claude_desktop.d.ts +7 -0
- package/dist/install/mcp_clients/claude_desktop.js +40 -0
- package/dist/install/mcp_clients/claude_desktop.js.map +1 -0
- package/dist/install/mcp_clients/cursor.d.ts +7 -0
- package/dist/install/mcp_clients/cursor.js +30 -0
- package/dist/install/mcp_clients/cursor.js.map +1 -0
- package/dist/install/mcp_clients/index.d.ts +11 -0
- package/dist/install/mcp_clients/index.js +12 -0
- package/dist/install/mcp_clients/index.js.map +1 -0
- package/dist/install/mcp_clients/windsurf.d.ts +7 -0
- package/dist/install/mcp_clients/windsurf.js +30 -0
- package/dist/install/mcp_clients/windsurf.js.map +1 -0
- package/dist/install/platform.d.ts +9 -0
- package/dist/install/platform.js +34 -0
- package/dist/install/platform.js.map +1 -0
- package/dist/macula_cli.d.ts +88 -0
- package/dist/macula_cli.js +189 -0
- package/dist/macula_cli.js.map +1 -0
- package/dist/mesh_artifact.d.ts +2 -0
- package/dist/mesh_artifact.js +63 -0
- package/dist/mesh_artifact.js.map +1 -0
- package/dist/mesh_call.d.ts +2 -0
- package/dist/mesh_call.js +45 -0
- package/dist/mesh_call.js.map +1 -0
- package/dist/mesh_identity.d.ts +2 -0
- package/dist/mesh_identity.js +28 -0
- package/dist/mesh_identity.js.map +1 -0
- package/dist/mesh_publish.d.ts +2 -0
- package/dist/mesh_publish.js +33 -0
- package/dist/mesh_publish.js.map +1 -0
- package/dist/mesh_watch.d.ts +2 -0
- package/dist/mesh_watch.js +53 -0
- package/dist/mesh_watch.js.map +1 -0
- package/dist/reply.d.ts +16 -0
- package/dist/reply.js +24 -0
- package/dist/reply.js.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Support. While redistributing the Work or
|
|
166
|
+
Derivative Works thereof, You may choose to offer, and charge a
|
|
167
|
+
fee for, acceptance of support, warranty, indemnity, or other
|
|
168
|
+
liability obligations and/or rights consistent with this License.
|
|
169
|
+
However, in accepting such obligations, You may act only on Your
|
|
170
|
+
own behalf and on Your sole responsibility, not on behalf of any
|
|
171
|
+
other Contributor, and only if You agree to indemnify, defend,
|
|
172
|
+
and hold each Contributor harmless for any liability incurred by,
|
|
173
|
+
or claims asserted against, such Contributor by reason of your
|
|
174
|
+
accepting any such warranty or support.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Hecate contributors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# macula-mcp
|
|
2
|
+
|
|
3
|
+
[](https://github.com/macula-io/macula-mcp/actions/workflows/ci.yml)
|
|
4
|
+
[](#license)
|
|
5
|
+
[](https://nodejs.org)
|
|
6
|
+
[](https://buymeacoffee.com/rlefever)
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<picture>
|
|
10
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/macula-mcp-full-dark.svg">
|
|
11
|
+
<img src="assets/macula-mcp-full-light.svg" alt="Macula MCP" width="320">
|
|
12
|
+
</picture>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
A [Model Context Protocol](https://modelcontextprotocol.io) server that
|
|
16
|
+
exposes the Macula mesh to any agent harness: Claude Code, Cursor, Cline,
|
|
17
|
+
Continue, and anything else that speaks MCP.
|
|
18
|
+
|
|
19
|
+
```jsonc
|
|
20
|
+
// .mcp.json (or your harness's MCP config)
|
|
21
|
+
{
|
|
22
|
+
"mcpServers": {
|
|
23
|
+
"macula": { "command": "macula-mcp" }
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## What it is
|
|
29
|
+
|
|
30
|
+
The 2026 equivalent of "an editor plugin" is an MCP server: editor- and
|
|
31
|
+
harness-agnostic, agent-native. `macula-mcp` is deliberately thin — it does
|
|
32
|
+
**not** speak QUIC, DHT, or Macula RPC itself. It speaks MCP over stdio to
|
|
33
|
+
the agent, and shells out to
|
|
34
|
+
[`macula-cli`](https://github.com/macula-io/macula-cli), a one-shot
|
|
35
|
+
scriptable CLI built directly on `macula-go-sdk`, for every mesh operation.
|
|
36
|
+
`macula-cli` does the actual QUIC handshake/call/publish/watch/content
|
|
37
|
+
transfer as a subprocess per tool call; `macula-mcp` carries no mesh logic
|
|
38
|
+
of its own.
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
┌───────────────┐ MCP/stdio ┌────────────┐ spawns, parses stdout ┌────────────┐ QUIC ┌──────────────┐
|
|
42
|
+
│ agent harness │ ────────────▶ │ macula-mcp │ ──────────────────────▶ │ macula-cli │ ─────────▶│ Macula mesh │
|
|
43
|
+
└───────────────┘ └────────────┘ └────────────┘ └──────────────┘
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Reworked 2026-08-29** from an earlier design that proxied to a local
|
|
47
|
+
`hecate-daemon` over a Unix socket. `hecate-daemon` is a leftover of an
|
|
48
|
+
abandoned local browser/UI plan and is no longer something this server
|
|
49
|
+
depends on. This is a deliberately **lean** rework, not a like-for-like
|
|
50
|
+
swap: `macula-cli` is a one-shot process with no daemon and no storage, so
|
|
51
|
+
a few things the daemon-backed version had don't carry over — see
|
|
52
|
+
[Status](#status).
|
|
53
|
+
|
|
54
|
+
## Why a mesh-MCP at all
|
|
55
|
+
|
|
56
|
+
As agents do more of the typing, the scarce resources stop being "code
|
|
57
|
+
completion" and become **federated shared memory** and **cross-party agent
|
|
58
|
+
coordination** — exactly what Macula provides and what a centralised,
|
|
59
|
+
US-owned AI coding tool structurally cannot. `mesh_call`/`mesh_publish`/
|
|
60
|
+
`mesh_watch`/`mesh_put`/`mesh_get` let an agent reach a peer's advertised
|
|
61
|
+
capability, emit a fact other parties' agents can react to, watch for
|
|
62
|
+
inbound facts, and exchange content-addressed artifacts — all over real
|
|
63
|
+
QUIC/DHT wire protocol, not a mock.
|
|
64
|
+
|
|
65
|
+
## Tools
|
|
66
|
+
|
|
67
|
+
| Tool | Primitive | What it does |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| `mesh_call` | RPC | Invoke a capability a peer advertises (build, test, search, deploy) over the mesh. Returns the result + `duration_ms`. |
|
|
70
|
+
| `mesh_put` | Content Sharing | Publish a content-addressed artifact; returns its MCID hex. |
|
|
71
|
+
| `mesh_get` | Content Sharing | Fetch a content-addressed artifact by MCID hex. |
|
|
72
|
+
| `mesh_publish` | Pub/Sub | Emit an integration fact to a topic (business verbs only, never CRUD). Returns `topic`/`seq`. |
|
|
73
|
+
| `mesh_watch` | Pub/Sub | Watch a topic for up to `duration_seconds` (max 120) and return whatever arrived. **Blocks for the call's duration** — there's no standing background subscription; call again to keep watching. |
|
|
74
|
+
|
|
75
|
+
Every tool takes an optional `host` (`"host[:port]"`) to pick which station
|
|
76
|
+
to connect through; all default to `MACULA_MESH_STATION` (see
|
|
77
|
+
[Environment](#environment)).
|
|
78
|
+
|
|
79
|
+
## Resources
|
|
80
|
+
|
|
81
|
+
| Resource | Content |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `mesh://identity` | This node's Ed25519 identity (node ID), minted and persisted locally by `macula-cli`. |
|
|
84
|
+
|
|
85
|
+
## Prerequisites
|
|
86
|
+
|
|
87
|
+
- Node.js 20+ (the one thing the installer below checks but won't install for
|
|
88
|
+
you — get it from [nodejs.org](https://nodejs.org), nvm, fnm, or volta).
|
|
89
|
+
|
|
90
|
+
Everything else — [`macula-cli`](https://github.com/macula-io/macula-cli),
|
|
91
|
+
the `@macula-io/mcp` package itself, and registering with your MCP client — is
|
|
92
|
+
handled by the installer.
|
|
93
|
+
|
|
94
|
+
## Install
|
|
95
|
+
|
|
96
|
+
**Linux / macOS:**
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
curl -fsSL https://raw.githubusercontent.com/macula-io/macula-mcp/main/install.sh | bash
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Windows (PowerShell):**
|
|
103
|
+
|
|
104
|
+
```powershell
|
|
105
|
+
irm https://raw.githubusercontent.com/macula-io/macula-mcp/main/install.ps1 | iex
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Both check Node.js, install `macula-cli` if it isn't already on `PATH`,
|
|
109
|
+
`npm install -g @macula-io/mcp`, then run `macula-mcp-install` to register the
|
|
110
|
+
`macula` MCP server with every detected client (Claude Code, Claude Desktop,
|
|
111
|
+
Cursor, Windsurf) — safe-merges into existing configs and backs them up
|
|
112
|
+
first. Idempotent; re-running is a no-op if everything's already current.
|
|
113
|
+
|
|
114
|
+
To uninstall (unregisters from every MCP client, then removes the `npm`
|
|
115
|
+
package — leaves `macula-cli` untouched, that has its own
|
|
116
|
+
[install/uninstall](https://github.com/macula-io/macula-cli#quick-start)):
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
curl -fsSL https://raw.githubusercontent.com/macula-io/macula-mcp/main/uninstall.sh | bash
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```powershell
|
|
123
|
+
irm https://raw.githubusercontent.com/macula-io/macula-mcp/main/uninstall.ps1 | iex
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**From source** (contributing, or before a version is published):
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npm install
|
|
130
|
+
npm run build
|
|
131
|
+
npm link # puts `macula-mcp` on PATH
|
|
132
|
+
macula-mcp-install # register with detected MCP clients
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
See the [guide](guides/HOWTO.md) for env var overrides (pinning a version,
|
|
136
|
+
skipping the `macula-cli` step, installing without registering any client)
|
|
137
|
+
and troubleshooting.
|
|
138
|
+
|
|
139
|
+
## Environment
|
|
140
|
+
|
|
141
|
+
| Variable | Purpose | Default |
|
|
142
|
+
|---|---|---|
|
|
143
|
+
| `MACULA_CLI_BIN` | Override the `macula-cli` binary path/name. | `macula-cli` (resolved via `PATH`) |
|
|
144
|
+
| `MACULA_MESH_STATION` | Default station every tool connects through when a call doesn't override `host`. | `station-de-frankfurt.macula.io:4433` |
|
|
145
|
+
| `MACULA_MCP_WATCH_IDENTITY` | Override `mesh_watch`'s dedicated identity file path (kept separate from every other tool's default identity — see the [guide](guides/HOWTO.md) §2). | `~/.macula-mcp/watch-identity.seed` |
|
|
146
|
+
|
|
147
|
+
## Status
|
|
148
|
+
|
|
149
|
+
**v0.3.0 — reworked onto `macula-cli`, 2026-08-29.** Every tool shells out
|
|
150
|
+
to a real `macula-cli` subprocess and has been exercised against the live
|
|
151
|
+
demo fleet through `macula-cli` itself (see that repo's own README/HOWTO
|
|
152
|
+
guide for the underlying live verification). `npm run typecheck`/`build`
|
|
153
|
+
are clean; `parseWatchOutput`'s NDJSON-vs-error-envelope parsing has a real
|
|
154
|
+
unit test (`src/macula_cli.test.ts`) guarding a bug caught while writing
|
|
155
|
+
it — a naive try/catch around `JSON.parse` never distinguishes a
|
|
156
|
+
wrong-shape-but-valid-JSON error envelope from a real event, so it needs
|
|
157
|
+
an explicit shape check.
|
|
158
|
+
|
|
159
|
+
**Dropped in this rework, not carried over from the daemon-backed
|
|
160
|
+
design** — `macula-cli` is a one-shot process with no daemon and no
|
|
161
|
+
storage, so none of these have an honest equivalent without `macula-mcp`
|
|
162
|
+
itself becoming a stateful daemon (a real design fork that was deliberately
|
|
163
|
+
not taken; see `macula-io/macula-cli`'s own project memory for the
|
|
164
|
+
tradeoff):
|
|
165
|
+
- **Standing subscriptions + inbox.** The old `mesh_subscribe`/
|
|
166
|
+
`mesh_unsubscribe`/`mesh_subscriptions`/`mesh_inbox` quartet relied on
|
|
167
|
+
the daemon's own event-sourced background subscription that outlived any
|
|
168
|
+
one call. Replaced by `mesh_watch`, which blocks for a bounded duration
|
|
169
|
+
and returns what arrived — call it again to keep watching.
|
|
170
|
+
- **Activity audit log** (`mesh://activity/{realm}`, `fact_id` on every
|
|
171
|
+
write). That was hecate-daemon's own ReckonDB-backed accountability
|
|
172
|
+
trail. Writes still happen for real on the mesh; there's just no local
|
|
173
|
+
log of them anymore.
|
|
174
|
+
- **`mesh://peers`.** Already an admitted stub even under the old
|
|
175
|
+
design ("v1 surfaces an empty list until `hecate_mesh:get_peers/0`
|
|
176
|
+
returns real data") — `macula-go-sdk` has no peer-listing API either, so
|
|
177
|
+
there was nothing real to carry forward.
|
|
178
|
+
|
|
179
|
+
Known mesh limits, unchanged from before (memory:
|
|
180
|
+
`project_inter_station_routing_unshipped`): cross-station DHT replication
|
|
181
|
+
is not fully shipped — `mesh_put`/`mesh_get` is reliable same-station,
|
|
182
|
+
best-effort cross-station.
|
|
183
|
+
|
|
184
|
+
## Documentation
|
|
185
|
+
|
|
186
|
+
| Guide | Description |
|
|
187
|
+
|---|---|
|
|
188
|
+
| [HOW-TO Guide](guides/HOWTO.md) | Install/uninstall env var reference, each tool's exact behavior, troubleshooting a failed tool call, the two real gotchas found live-testing this rework |
|
|
189
|
+
|
|
190
|
+
## License
|
|
191
|
+
|
|
192
|
+
Apache-2.0. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// macula-mcp install — wire macula-cli into every detected MCP client's
|
|
3
|
+
// config in one shot.
|
|
4
|
+
//
|
|
5
|
+
// Scope:
|
|
6
|
+
// * Detects an installed macula-cli binary (identity probe, no
|
|
7
|
+
// network), prints its node ID for visual confirmation.
|
|
8
|
+
// * Detects installed MCP clients (Claude Code, Claude Desktop,
|
|
9
|
+
// Cursor, Windsurf) by their canonical paths.
|
|
10
|
+
// * Safe-merges a `macula` mcpServers entry into each — idempotent
|
|
11
|
+
// re-runs are no-ops; conflicting entries skip with a remediation
|
|
12
|
+
// hint unless --force is passed.
|
|
13
|
+
// * Backs up any existing config to `<path>.macula-bak-<timestamp>`
|
|
14
|
+
// before writing.
|
|
15
|
+
//
|
|
16
|
+
// Reworked 2026-08-29: this used to detect a running hecate-daemon and
|
|
17
|
+
// offer to fetch+launch one; hecate-daemon is now treated as obsolete
|
|
18
|
+
// and macula-mcp shells out to macula-cli instead (src/macula_cli.ts).
|
|
19
|
+
// If macula-cli isn't found, this prints the install command rather
|
|
20
|
+
// than fetching a binary itself -- macula-cli already ships its own
|
|
21
|
+
// tested cross-platform install.sh/install.ps1, no reason to duplicate
|
|
22
|
+
// that fetch/verify logic here.
|
|
23
|
+
//
|
|
24
|
+
// Exit codes: 0 = ok, 1 = bad input, 2 = no MCP clients detected.
|
|
25
|
+
import { detect } from "../install/platform.js";
|
|
26
|
+
import { probe } from "../install/existing_cli.js";
|
|
27
|
+
import { ALL, detected } from "../install/mcp_clients/index.js";
|
|
28
|
+
const VERSION = "0.3.0";
|
|
29
|
+
function parseArgs(argv) {
|
|
30
|
+
const a = { force: false, help: false, only: [] };
|
|
31
|
+
for (let i = 0; i < argv.length; i++) {
|
|
32
|
+
const arg = argv[i];
|
|
33
|
+
if (arg === "--help" || arg === "-h")
|
|
34
|
+
a.help = true;
|
|
35
|
+
else if (arg === "--force")
|
|
36
|
+
a.force = true;
|
|
37
|
+
else if (arg === "--only")
|
|
38
|
+
a.only = (argv[++i] ?? "").split(",").filter(Boolean);
|
|
39
|
+
else if (arg.startsWith("--")) {
|
|
40
|
+
err(`unknown flag: ${arg}`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return a;
|
|
45
|
+
}
|
|
46
|
+
function help() {
|
|
47
|
+
console.log(`macula-mcp install ${VERSION}
|
|
48
|
+
|
|
49
|
+
Usage: npx @macula-io/mcp install [--force] [--only <client[,client,...]>]
|
|
50
|
+
|
|
51
|
+
Detects installed MCP clients and registers the 'macula' MCP server,
|
|
52
|
+
which shells out to macula-cli for mesh operations. Idempotent;
|
|
53
|
+
safe-merges into existing configs and backs up first.
|
|
54
|
+
|
|
55
|
+
Supported MCP clients:
|
|
56
|
+
claude-code, claude-desktop, cursor, windsurf
|
|
57
|
+
|
|
58
|
+
Flags:
|
|
59
|
+
--force Replace an existing 'macula' entry that
|
|
60
|
+
differs from the new one. Without --force
|
|
61
|
+
conflicting entries are left alone.
|
|
62
|
+
--only <a,b,c> Only configure the listed clients.
|
|
63
|
+
--help, -h This message.
|
|
64
|
+
|
|
65
|
+
After install: restart your MCP client; ask your LLM to read the
|
|
66
|
+
mesh://identity resource or call mesh_publish on any topic.
|
|
67
|
+
`);
|
|
68
|
+
}
|
|
69
|
+
function ok(msg) {
|
|
70
|
+
console.log(`[macula-mcp install] ✓ ${msg}`);
|
|
71
|
+
}
|
|
72
|
+
function info(msg) {
|
|
73
|
+
console.log(`[macula-mcp install] ${msg}`);
|
|
74
|
+
}
|
|
75
|
+
function warn(msg) {
|
|
76
|
+
console.warn(`[macula-mcp install] ! ${msg}`);
|
|
77
|
+
}
|
|
78
|
+
function err(msg) {
|
|
79
|
+
console.error(`[macula-mcp install] ✗ ${msg}`);
|
|
80
|
+
}
|
|
81
|
+
async function main() {
|
|
82
|
+
const args = parseArgs(process.argv.slice(2));
|
|
83
|
+
if (args.help) {
|
|
84
|
+
help();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const p = detect();
|
|
88
|
+
info(`platform: ${p.label}`);
|
|
89
|
+
// 1) Probe for an installed macula-cli binary.
|
|
90
|
+
const cp = await probe();
|
|
91
|
+
if (cp.available && cp.nodeId) {
|
|
92
|
+
ok(`macula-cli found`);
|
|
93
|
+
info(`node id: ${cp.nodeId}`);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
warn(`macula-cli not found on PATH`);
|
|
97
|
+
info("macula-mcp shells out to macula-cli for every mesh operation --");
|
|
98
|
+
info("install it before the registered MCP entry will actually work:");
|
|
99
|
+
info(" curl -fsSL https://raw.githubusercontent.com/macula-io/macula-cli/master/install.sh | bash");
|
|
100
|
+
info(" (Windows: irm https://raw.githubusercontent.com/macula-io/macula-cli/master/install.ps1 | iex)");
|
|
101
|
+
info("Continuing with MCP-config registration anyway.");
|
|
102
|
+
}
|
|
103
|
+
// 2) Detect MCP clients.
|
|
104
|
+
const requested = args.only.length > 0 ? args.only : null;
|
|
105
|
+
const targets = (requested ? ALL.filter((c) => requested.includes(c.CLIENT_ID)) : detected());
|
|
106
|
+
if (targets.length === 0) {
|
|
107
|
+
err("no MCP clients detected.");
|
|
108
|
+
info("install Claude Code, Claude Desktop, Cursor, or Windsurf and re-run.");
|
|
109
|
+
info("or pass --only <id> to force configuration anyway.");
|
|
110
|
+
process.exit(2);
|
|
111
|
+
}
|
|
112
|
+
info(`detected MCP clients: ${targets.map((c) => c.CLIENT_LABEL).join(", ")}`);
|
|
113
|
+
// 3) Register macula entry in each.
|
|
114
|
+
for (const client of targets) {
|
|
115
|
+
await configureOne(client);
|
|
116
|
+
}
|
|
117
|
+
console.log("");
|
|
118
|
+
ok("done.");
|
|
119
|
+
console.log(`\nRestart your MCP client(s). To test, ask your LLM:\n` +
|
|
120
|
+
` "Read the mesh://identity resource and tell me my node ID."\n`);
|
|
121
|
+
}
|
|
122
|
+
async function configureOne(c) {
|
|
123
|
+
try {
|
|
124
|
+
const result = await c.install();
|
|
125
|
+
const tag = result.outcome === "added"
|
|
126
|
+
? "added"
|
|
127
|
+
: result.outcome === "replaced"
|
|
128
|
+
? "replaced"
|
|
129
|
+
: result.outcome === "unchanged"
|
|
130
|
+
? "unchanged"
|
|
131
|
+
: "skipped";
|
|
132
|
+
info(`${c.CLIENT_LABEL}: ${tag} (${result.configPath})`);
|
|
133
|
+
if (result.backupPath)
|
|
134
|
+
info(` backup: ${result.backupPath}`);
|
|
135
|
+
if (result.outcome === "skipped_conflict")
|
|
136
|
+
warn(` ${result.message}`);
|
|
137
|
+
}
|
|
138
|
+
catch (e) {
|
|
139
|
+
err(`${c.CLIENT_LABEL}: ${e instanceof Error ? e.message : String(e)}`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
main().catch((e) => {
|
|
143
|
+
err(`fatal: ${e instanceof Error ? e.stack ?? e.message : String(e)}`);
|
|
144
|
+
process.exit(1);
|
|
145
|
+
});
|
|
146
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/bin/install.ts"],"names":[],"mappings":";AACA,wEAAwE;AACxE,sBAAsB;AACtB,EAAE;AACF,SAAS;AACT,iEAAiE;AACjE,4DAA4D;AAC5D,kEAAkE;AAClE,kDAAkD;AAClD,qEAAqE;AACrE,sEAAsE;AACtE,qCAAqC;AACrC,sEAAsE;AACtE,sBAAsB;AACtB,EAAE;AACF,uEAAuE;AACvE,sEAAsE;AACtE,uEAAuE;AACvE,oEAAoE;AACpE,oEAAoE;AACpE,uEAAuE;AACvE,gCAAgC;AAChC,EAAE;AACF,kEAAkE;AAElE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAsB,MAAM,iCAAiC,CAAC;AAEpF,MAAM,OAAO,GAAG,OAAO,CAAC;AAQxB,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,CAAC,GAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IACxD,KAAK,IAAI,CAAC,GAA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O,EAAE,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,GAAG,CAAC,GAAG,CAAC,CAAC,YAAY,KAAK,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,GAAG,CAAC,UAAU,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// macula-mcp status — at-a-glance report of:
|
|
3
|
+
// * whether macula-cli is installed and functional
|
|
4
|
+
// * which MCP clients are installed
|
|
5
|
+
// * which already have a `macula` entry configured
|
|
6
|
+
//
|
|
7
|
+
// Read-only: never writes config, never touches the mesh. Safe to
|
|
8
|
+
// run any time.
|
|
9
|
+
import { readFile } from "node:fs/promises";
|
|
10
|
+
import { existsSync } from "node:fs";
|
|
11
|
+
import { detect } from "../install/platform.js";
|
|
12
|
+
import { probe } from "../install/existing_cli.js";
|
|
13
|
+
import { ALL } from "../install/mcp_clients/index.js";
|
|
14
|
+
const VERSION = "0.3.0";
|
|
15
|
+
function help() {
|
|
16
|
+
console.log(`macula-mcp status ${VERSION}
|
|
17
|
+
|
|
18
|
+
Usage: npx @macula-io/mcp status
|
|
19
|
+
|
|
20
|
+
Read-only diagnostic. Reports macula-cli availability and MCP-client
|
|
21
|
+
configuration state.
|
|
22
|
+
`);
|
|
23
|
+
}
|
|
24
|
+
async function main() {
|
|
25
|
+
const argv = process.argv.slice(2);
|
|
26
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
27
|
+
help();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const p = detect();
|
|
31
|
+
line("platform", p.label);
|
|
32
|
+
const cp = await probe();
|
|
33
|
+
if (cp.available && cp.nodeId) {
|
|
34
|
+
line("macula-cli", "available");
|
|
35
|
+
line(" node id", cp.nodeId);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
line("macula-cli", "NOT found on PATH");
|
|
39
|
+
if (cp.reason)
|
|
40
|
+
line(" reason", cp.reason);
|
|
41
|
+
}
|
|
42
|
+
console.log("");
|
|
43
|
+
console.log("MCP clients:");
|
|
44
|
+
for (const client of ALL) {
|
|
45
|
+
await reportClient(client);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async function reportClient(c) {
|
|
49
|
+
const installed = c.isInstalled();
|
|
50
|
+
const cfgPath = c.configPath();
|
|
51
|
+
if (!installed) {
|
|
52
|
+
console.log(` ${pad(c.CLIENT_LABEL)} not installed`);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const configured = await hasMaculaEntry(cfgPath);
|
|
56
|
+
if (!existsSync(cfgPath)) {
|
|
57
|
+
console.log(` ${pad(c.CLIENT_LABEL)} installed, no config file (${cfgPath})`);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
console.log(` ${pad(c.CLIENT_LABEL)} installed, ${configured ? "✓ macula registered" : "✗ macula NOT registered"} (${cfgPath})`);
|
|
61
|
+
}
|
|
62
|
+
async function hasMaculaEntry(path) {
|
|
63
|
+
if (!existsSync(path))
|
|
64
|
+
return false;
|
|
65
|
+
try {
|
|
66
|
+
const raw = await readFile(path, "utf8");
|
|
67
|
+
if (raw.trim().length === 0)
|
|
68
|
+
return false;
|
|
69
|
+
const parsed = JSON.parse(raw);
|
|
70
|
+
return Boolean(parsed.mcpServers && "macula" in parsed.mcpServers);
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function line(k, v) {
|
|
77
|
+
console.log(`${pad(k)} ${v}`);
|
|
78
|
+
}
|
|
79
|
+
function pad(s) {
|
|
80
|
+
return (s + " ".repeat(18)).slice(0, 18);
|
|
81
|
+
}
|
|
82
|
+
main().catch((e) => {
|
|
83
|
+
console.error(`[macula-mcp status] fatal: ${e instanceof Error ? e.message : String(e)}`);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/bin/status.ts"],"names":[],"mappings":";AACA,6CAA6C;AAC7C,qDAAqD;AACrD,sCAAsC;AACtC,qDAAqD;AACrD,EAAE;AACF,kEAAkE;AAClE,gBAAgB;AAEhB,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,GAAG,EAAsB,MAAM,iCAAiC,CAAC;AAE1E,MAAM,OAAO,GAAG,OAAO,CAAC;AAExB,SAAS,IAAI;IACX,OAAO,CAAC,GAAG,CAAC,qBAAqB,OAAO;;;;;;CAMzC,CAAC,CAAC;AACH,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACnD,IAAI,EAAE,CAAC;QACP,OAAO;IACT,CAAC;IAED,MAAM,CAAC,GAAG,MAAM,EAAE,CAA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