@systemdox/mcp-server 0.1.11
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 +138 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +1891 -0
- package/dist/http.d.ts +30 -0
- package/dist/http.js +1623 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1561 -0
- package/dist/lib/api-client.d.ts +14 -0
- package/dist/lib/api-client.js +118 -0
- package/dist/lib/cache.d.ts +9 -0
- package/dist/lib/config.d.ts +7 -0
- package/dist/lib/context-builder.d.ts +78 -0
- package/dist/lib/context-builder.js +575 -0
- package/dist/lib/deprecation.d.ts +11 -0
- package/dist/lib/language.d.ts +7 -0
- package/dist/lib/scoring.d.ts +35 -0
- package/dist/server.d.ts +8 -0
- package/dist/tools/create-guardrail.d.ts +3 -0
- package/dist/tools/create-project-rule.d.ts +3 -0
- package/dist/tools/create-prompt-template.d.ts +3 -0
- package/dist/tools/get-context.d.ts +3 -0
- package/dist/tools/get-docs.d.ts +3 -0
- package/dist/tools/get-guardrails.d.ts +15 -0
- package/dist/tools/get-planning-context.d.ts +3 -0
- package/dist/tools/get-project-rules.d.ts +9 -0
- package/dist/tools/get-prompt-templates.d.ts +10 -0
- package/dist/tools/get-specs.d.ts +3 -0
- package/dist/tools/get-tech-stack.d.ts +3 -0
- package/dist/tools/report-decision.d.ts +3 -0
- package/dist/tools/update-spec.d.ts +3 -0
- package/package.json +65 -0
package/README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# @systemdox/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP server that exposes your SystemDox context — checks, specs, docs, tech
|
|
4
|
+
stack, project rules, and prompt templates — to AI coding tools (Claude Code,
|
|
5
|
+
Cursor, and any MCP-compatible client).
|
|
6
|
+
|
|
7
|
+
There are two ways to run it. Both authenticate with a SystemDox API key
|
|
8
|
+
(generate one on your SystemDox settings page) and act strictly as the caller —
|
|
9
|
+
every tool call is scoped to that key's tenant.
|
|
10
|
+
|
|
11
|
+
## Option A — Hosted endpoint (no install)
|
|
12
|
+
|
|
13
|
+
SystemDox hosts the server at a per-tenant subdomain, speaking MCP Streamable
|
|
14
|
+
HTTP. Point any HTTP-capable MCP client at it — nothing to install or update.
|
|
15
|
+
|
|
16
|
+
```jsonc
|
|
17
|
+
{
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"systemdox": {
|
|
20
|
+
"type": "http",
|
|
21
|
+
"url": "https://<your-workspace>.mcp.systemdox.com/mcp",
|
|
22
|
+
"headers": {
|
|
23
|
+
"Authorization": "Bearer pweb_prod_key_..."
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- **URL** — `https://<your-workspace>.mcp.systemdox.com/mcp`. `<your-workspace>`
|
|
31
|
+
is your tenant's **slug**; it must match the tenant that owns the API key, or
|
|
32
|
+
the request is rejected `403`. Set a slug on the workspace first (owner/admin →
|
|
33
|
+
workspace settings) if you don't have one.
|
|
34
|
+
- **Auth** — the key must be sent as `Authorization: Bearer <key>`. (An
|
|
35
|
+
`X-API-Key`-only request is rejected at the gateway.)
|
|
36
|
+
- **Transport** — stateless request/response (JSON); each call is independent,
|
|
37
|
+
which suits serverless hosting. There is no long-lived SSE stream.
|
|
38
|
+
|
|
39
|
+
## Option B — Local (stdio) via npx
|
|
40
|
+
|
|
41
|
+
Run the server locally as a stdio subprocess of your MCP client. Useful offline,
|
|
42
|
+
or when you'd rather not depend on the hosted endpoint.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx @systemdox/mcp-server setup
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
…or configure it directly:
|
|
49
|
+
|
|
50
|
+
```jsonc
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"systemdox": {
|
|
54
|
+
"command": "npx",
|
|
55
|
+
"args": ["@systemdox/mcp-server"],
|
|
56
|
+
"env": {
|
|
57
|
+
"SYSTEMDOX_API_KEY": "pweb_prod_key_..."
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
> The package is published to the public npm registry — `npx` resolves it with no
|
|
65
|
+
> registry configuration and no credentials.
|
|
66
|
+
|
|
67
|
+
## Environment variables (stdio mode)
|
|
68
|
+
|
|
69
|
+
| Variable | Required | Default | Purpose |
|
|
70
|
+
|----------|----------|---------|---------|
|
|
71
|
+
| `SYSTEMDOX_API_KEY` | yes | — | Your SystemDox API key |
|
|
72
|
+
| `SYSTEMDOX_API_URL` | no | `https://api.puglieseweb.com/systemdox` | REST API base URL |
|
|
73
|
+
| `SYSTEMDOX_CACHE_TTL` | no | `300` | Response cache TTL (seconds) |
|
|
74
|
+
|
|
75
|
+
## Tools
|
|
76
|
+
|
|
77
|
+
Read: `get_checks`, `get_specs`, `get_docs`, `get_tech_stack`,
|
|
78
|
+
`get_planning_context`, `get_context`, `get_project_rules`,
|
|
79
|
+
`get_prompt_templates`. Write: `create_check`, `update_spec`,
|
|
80
|
+
`report_decision`, `create_project_rule`, `create_prompt_template`. Write tools
|
|
81
|
+
require an API key with `editor`+ role.
|
|
82
|
+
|
|
83
|
+
### `get_context`
|
|
84
|
+
|
|
85
|
+
The aggregator. It ranks checks, specs and docs against the task, then
|
|
86
|
+
spends the token budget **fetching the bodies** of the highest-ranked specs and
|
|
87
|
+
docs (`/v1/specs/{id}`, `/v1/docs/{id}/content`) — concurrently, clipped to a
|
|
88
|
+
fair share of what's left. Every item carries the `spec_id` / `doc_id` needed to
|
|
89
|
+
fetch it in full, so nothing is a dead end: items whose body did not fit, or
|
|
90
|
+
whose fetch failed, still appear as a title + ID. Tech stack and project rules
|
|
91
|
+
are always included; the budget is spent on bodies, never on truncating the
|
|
92
|
+
list. Retrieval quality is measured by `eval/` — see [eval/README.md](./eval/README.md).
|
|
93
|
+
|
|
94
|
+
### Deprecated tool names
|
|
95
|
+
|
|
96
|
+
`get_guardrails` and `create_guardrail` were renamed to `get_checks` and
|
|
97
|
+
`create_check`. **The old names still work.** They are registered as aliases of
|
|
98
|
+
the same handlers and accept the same arguments, so an `.mcp.json` or agent
|
|
99
|
+
permission allowlist that pins them keeps working unchanged.
|
|
100
|
+
|
|
101
|
+
| Old name | New name | Removed no earlier than |
|
|
102
|
+
|----------|----------|-------------------------|
|
|
103
|
+
| `get_guardrails` | `get_checks` | 2027-01-31 |
|
|
104
|
+
| `create_guardrail` | `create_check` | 2027-01-31 |
|
|
105
|
+
|
|
106
|
+
Removal also requires usage telemetry showing no calls against the old name.
|
|
107
|
+
The `/guardrails/*` REST routes are **not** deprecated and are not changing.
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
pnpm install # from the monorepo root (pnpm workspace)
|
|
113
|
+
pnpm --filter @systemdox/mcp-server build # tsup + tsc
|
|
114
|
+
pnpm --filter @systemdox/mcp-server test # unit tests (node:test)
|
|
115
|
+
pnpm --filter @systemdox/mcp-server test:http # offline handler smoke test
|
|
116
|
+
pnpm --filter @systemdox/mcp-server eval # get_context retrieval eval
|
|
117
|
+
node scripts/mcp-release-gate.mjs # from the monorepo root
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Entry points: `src/index.ts` (stdio), `src/http.ts` (hosted HTTP handler),
|
|
121
|
+
`src/cli.ts` (`setup` command). Tool registration is shared via
|
|
122
|
+
`src/server.ts` (`createServer`). The hosted handler is deployed as a Lambda by
|
|
123
|
+
the product-systemdox backend stack (`systemdox-backend-prod`), reached through
|
|
124
|
+
the `*.mcp.systemdox.com` custom domain.
|
|
125
|
+
|
|
126
|
+
## Publishing
|
|
127
|
+
|
|
128
|
+
`.github/workflows/mcp-server-publish.yml` publishes to **registry.npmjs.org**
|
|
129
|
+
under the public `@systemdox` scope, authenticating with the `NPM_TOKEN` repo
|
|
130
|
+
secret. The publish step uses a throwaway npmrc containing only the public
|
|
131
|
+
registry: the repo-root `.npmrc` maps `@puglieseweb` to GitHub Packages (needed
|
|
132
|
+
for *installing* the org's private packages) and must never leak into a publish
|
|
133
|
+
of this package — that is how it previously landed in a private registry that
|
|
134
|
+
`npx` 404s for every customer.
|
|
135
|
+
|
|
136
|
+
`scripts/mcp-release-gate.mjs` is the standing guard: it reads the install
|
|
137
|
+
command out of the product source and runs it against the public registry with
|
|
138
|
+
no org credentials.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|