@seamward/setup-mcp 0.1.0-alpha.9
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 +31 -0
- package/README.md +270 -0
- package/dist/contracts.d.ts +15922 -0
- package/dist/contracts.js +931 -0
- package/dist/contracts.js.map +1 -0
- package/dist/credentials.d.ts +51 -0
- package/dist/credentials.js +237 -0
- package/dist/credentials.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +30 -0
- package/dist/server.js +1959 -0
- package/dist/server.js.map +1 -0
- package/dist/stdio.d.ts +2 -0
- package/dist/stdio.js +62 -0
- package/dist/stdio.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +8 -0
- package/dist/version.js.map +1 -0
- package/package.json +56 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Seamward Setup MCP Proprietary License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Seamward. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software and its accompanying documentation are proprietary to Seamward.
|
|
6
|
+
Possession, installation, or availability through a package registry does not
|
|
7
|
+
grant a licence to use, copy, modify, distribute, sublicense, sell, or create
|
|
8
|
+
derivative works from the software.
|
|
9
|
+
|
|
10
|
+
You may use the software only to the extent expressly permitted by a written
|
|
11
|
+
agreement with Seamward, including an applicable customer, evaluation, pilot,
|
|
12
|
+
or partner agreement. If that agreement conflicts with this notice, the
|
|
13
|
+
written agreement controls.
|
|
14
|
+
|
|
15
|
+
Except where applicable law does not permit the restriction, you may not:
|
|
16
|
+
|
|
17
|
+
1. redistribute, publish, sublicense, lease, sell, or transfer the software;
|
|
18
|
+
2. reverse engineer, decompile, disassemble, or attempt to derive source code
|
|
19
|
+
from any distributed binary or package; or
|
|
20
|
+
3. remove or alter proprietary notices.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS" TO THE MAXIMUM EXTENT PERMITTED BY LAW,
|
|
23
|
+
WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF
|
|
24
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND
|
|
25
|
+
NON-INFRINGEMENT. TO THE MAXIMUM EXTENT PERMITTED BY LAW, SEAMWARD IS NOT
|
|
26
|
+
LIABLE FOR INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR EXEMPLARY DAMAGES,
|
|
27
|
+
OR FOR LOSS OF DATA, REVENUE, PROFITS, OR BUSINESS OPPORTUNITY, ARISING FROM OR
|
|
28
|
+
RELATED TO THE SOFTWARE.
|
|
29
|
+
|
|
30
|
+
No trademark rights are granted. All rights not expressly granted in a written
|
|
31
|
+
agreement with Seamward are reserved.
|
package/README.md
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# Seamward local setup MCP
|
|
2
|
+
|
|
3
|
+
`@seamward/setup-mcp` is a repository-scoped stdio server for coding agents.
|
|
4
|
+
It analyzes one backend service, identifies its independent integration
|
|
5
|
+
boundaries, proposes collector instrumentation, verifies the reviewed source,
|
|
6
|
+
and connects each binding to the matching Seamward Integration.
|
|
7
|
+
|
|
8
|
+
The normal experience starts with one request:
|
|
9
|
+
|
|
10
|
+
> Set up Seamward in this project.
|
|
11
|
+
|
|
12
|
+
That is the entire customer prompt. The MCP owns repository analysis, boundary
|
|
13
|
+
and contract discovery, change previews, repository verification, environment
|
|
14
|
+
file safety, and remote status checks. The customer does not name a provider,
|
|
15
|
+
protocol, contract path, setup action, or verification command.
|
|
16
|
+
|
|
17
|
+
The coding agent handles discovery and setup sequencing. You approve only two
|
|
18
|
+
meaningful trust boundaries:
|
|
19
|
+
|
|
20
|
+
1. Apply the proposed local dependency, generated file, and source changes.
|
|
21
|
+
2. Connect the reviewed contract to Seamward. This either registers and
|
|
22
|
+
activates a new version or links an exact already-active version to the
|
|
23
|
+
reviewed local evidence without a remote write.
|
|
24
|
+
|
|
25
|
+
The server never reads or edits environment files. It does not return source
|
|
26
|
+
contents, credential values, absolute paths, or customer data.
|
|
27
|
+
|
|
28
|
+
## Install and configure a client
|
|
29
|
+
|
|
30
|
+
Use the project installer from one deployable backend service:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx @seamward/setup@alpha
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The installer completes browser authorization, stores the short-lived
|
|
37
|
+
credential outside the repository, installs this package at an exact version,
|
|
38
|
+
and adds project-scoped configuration for Claude Code, Cursor, and Codex. It
|
|
39
|
+
previews every project file before applying the changes. Node.js 22 or newer is
|
|
40
|
+
required.
|
|
41
|
+
|
|
42
|
+
The project root and approved application environment cannot be changed through
|
|
43
|
+
an MCP tool call. Run one setup server per deployable service. Manual stdio configuration
|
|
44
|
+
remains supported for embedded and headless clients, but it is not the default
|
|
45
|
+
customer path.
|
|
46
|
+
|
|
47
|
+
## What the agent does
|
|
48
|
+
|
|
49
|
+
The default server exposes five high-level operations:
|
|
50
|
+
|
|
51
|
+
| Operation | Effect |
|
|
52
|
+
| ---------------------- | --------------------------------------------------------------------- |
|
|
53
|
+
| `prepare_setup` | Read-only analysis and a readable proposal |
|
|
54
|
+
| `apply_local_setup` | One approved local apply and deterministic source verification |
|
|
55
|
+
| `review_remote_setup` | Preview Integration create/reuse decisions and exact contract effects |
|
|
56
|
+
| `connect_remote_setup` | Apply the approved Integration and contract lifecycle idempotently |
|
|
57
|
+
| `check_setup_status` | Read-only local, contract, and first-observation status |
|
|
58
|
+
|
|
59
|
+
Internal plan records remain inside `.seamward/`. A user does not copy setup
|
|
60
|
+
identifiers or protocol confirmation phrases between calls.
|
|
61
|
+
|
|
62
|
+
If discovery finds clear integration boundaries and contract candidates,
|
|
63
|
+
preparation proceeds automatically for all of them. Each business boundary gets
|
|
64
|
+
its own plan, generated collector binding, runtime Connection key and ingest
|
|
65
|
+
token variable names, contract lifecycle, and first-observation status. Bindings
|
|
66
|
+
that share one application source may use the same token value under their
|
|
67
|
+
separate generated variable names. If a boundary is ambiguous, the tool
|
|
68
|
+
returns readable choices such as `inbound webhooks`, `outbound HTTP API`, `queue
|
|
69
|
+
consumer`, or `scheduled feed`, then waits for the user to choose. Unsupported
|
|
70
|
+
service shapes stop with a manual-setup explanation.
|
|
71
|
+
|
|
72
|
+
The read-only preparation output includes stable local binding identifiers for
|
|
73
|
+
the coding agent. A reviewer may include or exclude bindings before local
|
|
74
|
+
approval without copying those identifiers. Scripts, tests, fixtures, mocks,
|
|
75
|
+
tools, build output, and provider simulators are excluded from automatic
|
|
76
|
+
service discovery.
|
|
77
|
+
|
|
78
|
+
Automatic source transformation currently supports outbound Node.js HTTP
|
|
79
|
+
client calls and inbound Node.js webhook handlers. The same one-line prompt can
|
|
80
|
+
discover inbound HTTP servers, queue publishers, queue consumers, and scheduled
|
|
81
|
+
feeds, but preparation stops before approval and gives the manual integration
|
|
82
|
+
path for those boundaries. It never labels discovery-only coverage as an
|
|
83
|
+
automatic setup.
|
|
84
|
+
|
|
85
|
+
During the local approval, the server installs the exact supported collector,
|
|
86
|
+
writes plan-owned files, applies supported JavaScript or TypeScript source
|
|
87
|
+
instrumentation, runs the project's verification scripts, and records evidence
|
|
88
|
+
that binds the resulting source files to that successful run. The operation
|
|
89
|
+
restores package metadata, lockfiles, generated files, setup state, and source
|
|
90
|
+
files if verification fails. Unsupported or uncertain source shapes stop with
|
|
91
|
+
manual guidance instead of leaving partial edits or asking the coding agent to
|
|
92
|
+
bypass the reviewed plan with separate editing tools.
|
|
93
|
+
|
|
94
|
+
Verification receives an allowlisted child-process environment with no
|
|
95
|
+
application credentials. The setup engine supplies an internal
|
|
96
|
+
verification-only mode so the generated collector cannot start or transmit an
|
|
97
|
+
observation while existing handler results and errors remain testable. The
|
|
98
|
+
generated collector is also inert when `NODE_ENV=test`, so a project's ordinary
|
|
99
|
+
test suite does not require production credentials or transmit observations.
|
|
100
|
+
The setup engine does not open environment files. Project verification scripts
|
|
101
|
+
still run exactly as the repository defines them, including any file or network
|
|
102
|
+
access those scripts perform. Outside setup verification and test processes, an
|
|
103
|
+
observed operation fails clearly when its Connection key or ingest token is
|
|
104
|
+
missing or invalid, rather than silently running without monitoring.
|
|
105
|
+
|
|
106
|
+
Repeating the same reviewed setup reuses the verified plan and leaves source
|
|
107
|
+
unchanged. Replanning a contract does not wrap an already observed webhook
|
|
108
|
+
boundary again. Existing collector-backed webhook files are recorded as
|
|
109
|
+
already instrumented rather than wrapped with a second collector.
|
|
110
|
+
|
|
111
|
+
During the remote approval, the server proposes a readable name and provider for
|
|
112
|
+
every reviewed local binding. It reuses one exact existing Integration when the
|
|
113
|
+
business identity and scope match, otherwise it previews creating a new
|
|
114
|
+
Integration in the approved application environment. The reviewer can edit the
|
|
115
|
+
name and provider or select a preferred existing Integration before applying the
|
|
116
|
+
remote operation. No customer copies an internal Integration ID into a prompt.
|
|
117
|
+
It then connects each exact reviewed OpenAPI contract. When no exact active version
|
|
118
|
+
exists, it registers one immutable draft and activates that version. When the
|
|
119
|
+
active version already matches, it links the existing version without a remote
|
|
120
|
+
write. Identical retries reconcile safely. An ambiguous mapping stops before
|
|
121
|
+
any remote change and asks the user to choose in plain language.
|
|
122
|
+
|
|
123
|
+
An exact Integration command remains available as compatibility mode. The
|
|
124
|
+
normal source-scoped authorization lets the setup API create or reuse reviewed
|
|
125
|
+
Integrations without broad workspace write access.
|
|
126
|
+
|
|
127
|
+
JSON Schema requires an explicit operation binding. Automatic setup reports
|
|
128
|
+
that limitation before local approval and routes the user to the manual CLI
|
|
129
|
+
contract workflow, where the binding can be reviewed explicitly.
|
|
130
|
+
|
|
131
|
+
## Authorization and runtime configuration
|
|
132
|
+
|
|
133
|
+
The project installer uses OAuth with PKCE and binds its grant to one user,
|
|
134
|
+
workspace, and one application environment source. Access tokens are short-lived and refresh only
|
|
135
|
+
while the grant remains active. The credential file is stored in the user's
|
|
136
|
+
configuration directory with owner-only permissions. The MCP receives a
|
|
137
|
+
credential reference, not the token value.
|
|
138
|
+
|
|
139
|
+
The installer and MCP never open `.env` files, and no MCP operation accepts a
|
|
140
|
+
credential value. A workspace API key and process environment remain available
|
|
141
|
+
only as an advanced compatibility path for headless automation.
|
|
142
|
+
|
|
143
|
+
Runtime observation delivery is a separate boundary. The deployed service
|
|
144
|
+
needs every binding's public Connection key and its source ingest token in the
|
|
145
|
+
generated secret-environment variable names. The setup MCP does not read,
|
|
146
|
+
write, or manage those entries.
|
|
147
|
+
|
|
148
|
+
Package installation receives a reduced environment that excludes Seamward and
|
|
149
|
+
common credential variables. Project verification receives a strict allowlist
|
|
150
|
+
of operating-system process variables plus the internal verification flag.
|
|
151
|
+
Credentials are never printed in tool output.
|
|
152
|
+
|
|
153
|
+
## Status and recovery
|
|
154
|
+
|
|
155
|
+
`check_setup_status` is read-only. It reports one of these states:
|
|
156
|
+
|
|
157
|
+
| State | Meaning |
|
|
158
|
+
| ------------------------ | -------------------------------------------------------------------- |
|
|
159
|
+
| `not_prepared` | Run setup preparation |
|
|
160
|
+
| `local_changes_required` | Apply or finish the proposed source changes |
|
|
161
|
+
| `ready_to_connect` | Local verification passed; review or reconcile the remote connection |
|
|
162
|
+
| `waiting_for_traffic` | Current contract evidence is active; send an instrumented request |
|
|
163
|
+
| `partially_connected` | At least one binding is connected while another still needs action |
|
|
164
|
+
| `connected` | Seamward accepted traffic from this setup |
|
|
165
|
+
| `stale` | Verified source changed; review and apply local setup again |
|
|
166
|
+
| `conflict` | Local or remote state changed and needs a fresh review |
|
|
167
|
+
|
|
168
|
+
A failed remote connection can be retried through the same approved operation.
|
|
169
|
+
If draft registration succeeded before activation failed, the retry uses the
|
|
170
|
+
recorded draft instead of creating another one.
|
|
171
|
+
|
|
172
|
+
For a multi-Integration connection, each binding reports its own outcome. If a
|
|
173
|
+
remote service failure interrupts the batch, completed bindings stay recorded,
|
|
174
|
+
the failed binding reports its stable error code, and later bindings report
|
|
175
|
+
`not_attempted`. Retrying the same approved operation reconciles completed
|
|
176
|
+
work instead of creating duplicate contract versions.
|
|
177
|
+
|
|
178
|
+
An interrupted exact-active reconciliation is also safe to retry. If local
|
|
179
|
+
registration evidence was recorded before local activation evidence, the retry
|
|
180
|
+
revalidates the current source, contract, setup state, and active version, then
|
|
181
|
+
converges without a remote mutation. `waiting_for_traffic` is reported only
|
|
182
|
+
when current source evidence is verified and the locally recorded activation
|
|
183
|
+
still matches Seamward's active version.
|
|
184
|
+
|
|
185
|
+
Multi-binding plans are loaded from `.seamward/integrations/` when the MCP
|
|
186
|
+
process restarts. Status therefore reports every prepared binding rather than
|
|
187
|
+
falling back to `not_prepared` after the coding agent is reopened.
|
|
188
|
+
|
|
189
|
+
If an Integration boundary is removed from the source, the next setup preview
|
|
190
|
+
lists that binding as a removal. Seamward snapshots current and retired binding
|
|
191
|
+
files together, applies the reviewed changes, removes only unchanged generated
|
|
192
|
+
files and local state that it owns, then verifies the final project tree. Any
|
|
193
|
+
failure restores the full snapshot. The remote Integration and contract stay
|
|
194
|
+
active deliberately so deleting local source cannot silently destroy remote
|
|
195
|
+
evidence. A customer can retire the remote Integration separately after
|
|
196
|
+
reviewing its retention requirements.
|
|
197
|
+
|
|
198
|
+
## Error contract
|
|
199
|
+
|
|
200
|
+
Every failed operation returns `schemaVersion` plus an `error` object with
|
|
201
|
+
`code`, `message`, `retryable`, and `recovery`. `retryable: true` means the same
|
|
202
|
+
request may succeed after waiting or restoring network health. It never means
|
|
203
|
+
that an agent may bypass a fresh review when local or remote state changed.
|
|
204
|
+
|
|
205
|
+
| Code | Retryable | Recovery |
|
|
206
|
+
| ------------------------------ | --------- | ------------------------------------------------------------------------------------------------------- |
|
|
207
|
+
| `plan_not_found` | No | Run `prepare_setup` |
|
|
208
|
+
| `legacy_plan_requires_replan` | No | Run `prepare_setup` and review the replacement plan |
|
|
209
|
+
| `confirmation_required` | No | Approve the requested trust boundary |
|
|
210
|
+
| `no_matching_actions` | No | Prepare again and choose a proposed operation |
|
|
211
|
+
| `invalid_input` | No | Correct the request to match the tool schema |
|
|
212
|
+
| `scan_limit_exceeded` | No | Narrow the service root, then prepare again |
|
|
213
|
+
| `generated_file_conflict` | No | Review the changed generated file before preparing again |
|
|
214
|
+
| `apply_in_progress` | Yes | Wait for the active local apply, then retry |
|
|
215
|
+
| `setup_preview_stale` | No | Run `review_remote_setup` again and approve the current Integration preview |
|
|
216
|
+
| `idempotency_conflict` | No | Use the original request for that key, or review again before applying a different request |
|
|
217
|
+
| `verification_failed` | No | Fix the source or project checks, then prepare and apply again |
|
|
218
|
+
| `setup_state_conflict` | No | Check status, then prepare and review current state |
|
|
219
|
+
| `stale_setup_lock` | No | Confirm no apply is running, remove only the reported lock, then prepare |
|
|
220
|
+
| `configuration_required` | No | Run `npx @seamward/setup@alpha` to authorize the application environment, then restart the coding agent |
|
|
221
|
+
| `contract_preview_expired` | No | Run `review_remote_setup` again |
|
|
222
|
+
| `contract_activation_conflict` | No | Read contract state and run `review_remote_setup` again |
|
|
223
|
+
| `authentication_required` | No | Run `npx @seamward/setup@alpha` and approve the application environment again |
|
|
224
|
+
| `insufficient_scope` | No | Reauthorize the application environment with `npx @seamward/setup@alpha`, then restart the coding agent |
|
|
225
|
+
| `integration_scope_mismatch` | No | Choose the correct boundary and prepare again |
|
|
226
|
+
| `integration_mapping_required` | No | Select the matching existing Integration or adjust the proposal, then review again |
|
|
227
|
+
| `contract_version_conflict` | No | Choose a new version or review the existing immutable version |
|
|
228
|
+
| `source_verification_required` | No | Run `apply_local_setup` and resolve source verification |
|
|
229
|
+
| `not_found` | No | Verify workspace and Integration access, then review again |
|
|
230
|
+
| `remote_conflict` | No | Read remote state and run `review_remote_setup` again |
|
|
231
|
+
| `rate_limited` | Yes | Wait for the retry interval, then repeat the same request |
|
|
232
|
+
| `service_unavailable` | Yes | Wait for service recovery, then repeat the same request |
|
|
233
|
+
| `remote_request_failed` | No | Verify the request and access configuration, then review again |
|
|
234
|
+
| `remote_response_invalid` | No | Report the invalid service response before trying again |
|
|
235
|
+
| `plan_conflict` | No | Run `prepare_setup` and review the current plan |
|
|
236
|
+
| `internal_error` | No | Inspect local logs and report the failure |
|
|
237
|
+
|
|
238
|
+
Older alpha setup state is migrated only during an approved local apply. If an
|
|
239
|
+
existing generated target cannot be proven safe, migration stops without
|
|
240
|
+
overwriting it.
|
|
241
|
+
|
|
242
|
+
## Privacy and trust boundaries
|
|
243
|
+
|
|
244
|
+
- Repository analysis is local and read-only.
|
|
245
|
+
- Environment files are neither read nor changed.
|
|
246
|
+
- Source contents, literal private URLs, credentials, and absolute paths are
|
|
247
|
+
not returned from operations.
|
|
248
|
+
- Current-file evidence is stored locally in `.seamward/setup-state.json`.
|
|
249
|
+
- Editing a verified source file makes its evidence stale.
|
|
250
|
+
- Seamward Cloud receives only an explicitly registered contract and redacted
|
|
251
|
+
collector observations. Exact-active reconciliation changes local evidence
|
|
252
|
+
only and creates no remote audit event.
|
|
253
|
+
- The local and remote writes remain distinct host approval boundaries.
|
|
254
|
+
|
|
255
|
+
## CLI fallback
|
|
256
|
+
|
|
257
|
+
`@seamward/cli` uses the same discovery, planning, verification, and remote API
|
|
258
|
+
implementation. Use the CLI for terminal automation and CI when a coding agent
|
|
259
|
+
cannot run a local MCP server. The CLI is an advanced interface; the MCP is the
|
|
260
|
+
recommended interactive setup experience.
|
|
261
|
+
|
|
262
|
+
## Compatibility
|
|
263
|
+
|
|
264
|
+
The default stdio server publishes setup schema `seamward.setup-mcp/4` and only
|
|
265
|
+
the five high-level operations above. The legacy alpha registry is supported
|
|
266
|
+
through `@seamward/setup-mcp` 0.1.x for migration only. Applications embedding
|
|
267
|
+
the package can enable it with `legacyTools: true` while they move to the
|
|
268
|
+
high-level operations and per-Integration state under
|
|
269
|
+
`.seamward/integrations/`. The legacy registry will be removed in the first
|
|
270
|
+
`0.2.0` release. It is not the default and must not be presented to new users.
|