@subseam/mcp 0.3.4 → 0.4.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/README.md +62 -15
- package/dist/main.js +21928 -3931
- package/package.json +7 -25
package/README.md
CHANGED
|
@@ -1,28 +1,75 @@
|
|
|
1
1
|
# @subseam/mcp
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
subseam reads your repository's history and checks every pull request against the rules your
|
|
4
|
+
team writes down: "this package never imports that one", "only this module talks to the
|
|
5
|
+
database". You write a rule as a one-line note, subseam turns it into a definition you approve,
|
|
6
|
+
and from then on each PR shows where it breaks the rule, with the file, the line and the cause.
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
This package is the MCP server that gives your coding agent (Claude Code, or any MCP host) the
|
|
9
|
+
subseam tools: `capture` a note, `define` it as a rule, `define_inbox` to see what waits on you,
|
|
10
|
+
and the rest. It runs on your machine and talks to the subseam service over HTTPS.
|
|
11
|
+
|
|
12
|
+
## What you need
|
|
13
|
+
|
|
14
|
+
- Node.js 22 or later, and npm.
|
|
15
|
+
- A GitHub account, and a subseam organization that someone has added you to. The org's owner
|
|
16
|
+
gives you its id (a UUID); that is your **tenant id**.
|
|
17
|
+
- The subseam API URL: `https://subseam.theconstructory.com/api`.
|
|
18
|
+
|
|
19
|
+
## 1. Sign in
|
|
20
|
+
|
|
21
|
+
Open <https://subseam.theconstructory.com/auth/github/start> in your browser and approve the
|
|
22
|
+
GitHub prompt. That creates your subseam account, named after your GitHub login. Tell the org's
|
|
23
|
+
owner your GitHub login so they can add you.
|
|
24
|
+
|
|
25
|
+
## 2. Get a token
|
|
26
|
+
|
|
27
|
+
The MCP server authenticates with a token tied to your account. There is no token page yet, so
|
|
28
|
+
you mint one with your browser session:
|
|
29
|
+
|
|
30
|
+
1. In the browser where you signed in, open the developer tools, then Application (Storage in
|
|
31
|
+
Firefox) → Cookies → `https://subseam.theconstructory.com`, and copy the value of
|
|
32
|
+
`__Host-subseam_session`.
|
|
33
|
+
2. Run, pasting that value:
|
|
7
34
|
|
|
8
35
|
```
|
|
9
|
-
|
|
10
|
-
|
|
36
|
+
S='<the cookie value>'; C=$(openssl rand -hex 16)
|
|
37
|
+
mkdir -p ~/.subseam && curl -s -X POST https://subseam.theconstructory.com/tokens \
|
|
38
|
+
-H "cookie: __Host-subseam_session=$S; subseam_csrf=$C" -H "x-csrf-token: $C" \
|
|
39
|
+
-H 'content-type: application/json' -d '{"label":"my-machine"}' \
|
|
40
|
+
| node -e 'process.stdin.on("data",d=>process.stdout.write(JSON.parse(d).token))' > ~/.subseam/token
|
|
41
|
+
chmod 600 ~/.subseam/token
|
|
11
42
|
```
|
|
12
43
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
`
|
|
44
|
+
`~/.subseam/token` now holds one line starting `cpt_`. If it is empty, the session cookie was
|
|
45
|
+
wrong or expired: sign in again and repeat. The server also accepts the token in the
|
|
46
|
+
`SUBSEAM_TOKEN` environment variable instead of the file.
|
|
16
47
|
|
|
17
|
-
|
|
48
|
+
## 3. Install
|
|
18
49
|
|
|
19
50
|
```
|
|
20
|
-
|
|
21
|
-
|
|
51
|
+
mkdir -p ~/.subseam/mcp && cd ~/.subseam/mcp
|
|
52
|
+
npm install @subseam/mcp
|
|
22
53
|
```
|
|
23
54
|
|
|
24
|
-
|
|
25
|
-
|
|
55
|
+
## 4. Register it with your agent
|
|
56
|
+
|
|
57
|
+
For Claude Code, with your tenant id in place of `<tenant id>`:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
claude mcp add-json --scope user subseam '{"command":"node","args":["'"$HOME"'/.subseam/mcp/node_modules/@subseam/mcp/dist/main.js"],"env":{"SUBSEAM_URL":"https://subseam.theconstructory.com/api","SUBSEAM_TENANT":"<tenant id>"}}'
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`claude mcp list` should show `subseam ... Connected`. Any other MCP host: run
|
|
64
|
+
`node ~/.subseam/mcp/node_modules/@subseam/mcp/dist/main.js` over stdio with the same two
|
|
65
|
+
environment variables.
|
|
66
|
+
|
|
67
|
+
## 5. Check it works
|
|
68
|
+
|
|
69
|
+
Ask your agent to call `define_inbox`. It answers with what is waiting on you in your org, or
|
|
70
|
+
says plainly that nothing is. If the server cannot reach subseam, every session mounts a single
|
|
71
|
+
tool, `subseam_unavailable`, whose description says what failed and which URL it tried.
|
|
72
|
+
|
|
73
|
+
## Updating
|
|
26
74
|
|
|
27
|
-
|
|
28
|
-
on the registry, and `install.sh` stops there rather than continuing.
|
|
75
|
+
`npm install @subseam/mcp@latest` in `~/.subseam/mcp`, then restart your agent.
|