@opentriologue/depsight-mcp 0.2.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 +137 -0
- package/dist/client.d.ts +27 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +89 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +30 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +35 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/ci.d.ts +4 -0
- package/dist/tools/ci.d.ts.map +1 -0
- package/dist/tools/ci.js +39 -0
- package/dist/tools/ci.js.map +1 -0
- package/dist/tools/cves.d.ts +4 -0
- package/dist/tools/cves.d.ts.map +1 -0
- package/dist/tools/cves.js +70 -0
- package/dist/tools/cves.js.map +1 -0
- package/dist/tools/deps.d.ts +4 -0
- package/dist/tools/deps.d.ts.map +1 -0
- package/dist/tools/deps.js +22 -0
- package/dist/tools/deps.js.map +1 -0
- package/dist/tools/history.d.ts +4 -0
- package/dist/tools/history.d.ts.map +1 -0
- package/dist/tools/history.js +29 -0
- package/dist/tools/history.js.map +1 -0
- package/dist/tools/license.d.ts +4 -0
- package/dist/tools/license.d.ts.map +1 -0
- package/dist/tools/license.js +22 -0
- package/dist/tools/license.js.map +1 -0
- package/dist/tools/policy.d.ts +4 -0
- package/dist/tools/policy.d.ts.map +1 -0
- package/dist/tools/policy.js +22 -0
- package/dist/tools/policy.js.map +1 -0
- package/dist/tools/repos.d.ts +4 -0
- package/dist/tools/repos.d.ts.map +1 -0
- package/dist/tools/repos.js +25 -0
- package/dist/tools/repos.js.map +1 -0
- package/dist/tools/shared.d.ts +10 -0
- package/dist/tools/shared.d.ts.map +1 -0
- package/dist/tools/shared.js +22 -0
- package/dist/tools/shared.js.map +1 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# depsight-mcp
|
|
2
|
+
|
|
3
|
+
Model Context Protocol server for [depsight](https://github.com/LanNguyenSi/depsight) — query CVE scans, license reports, dependency age, policy evaluation, and CI analytics from Claude (or any MCP-capable agent).
|
|
4
|
+
|
|
5
|
+
This is a thin wrapper around depsight's existing Next.js REST API. It does not talk to the database directly.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Name | Purpose |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `depsight_list_repos` | List the user's GitHub repos (source of `repoId` values) |
|
|
12
|
+
| `depsight_get_overview` | Team-health dashboard summary across all tracked repos |
|
|
13
|
+
| `depsight_get_cves` | Get the latest CVE scan for a repo, with optional min-severity / since-date filters |
|
|
14
|
+
| `depsight_get_license_report` | Per-package license compatibility + policy violations |
|
|
15
|
+
| `depsight_get_deps` | Dependency-age analysis (up-to-date / outdated / major-behind / deprecated) |
|
|
16
|
+
| `depsight_get_history` | Time series of CVE scan results for a repo |
|
|
17
|
+
| `depsight_evaluate_policy` | Run enabled policies against a specific scan (read-only) |
|
|
18
|
+
| `depsight_ci_analytics` | GitHub Actions CI insights — per-repo (with `repoId`) or cross-repo (without) |
|
|
19
|
+
|
|
20
|
+
All tools are **read-only** in v1. Scan triggers, webhook management, and policy mutation are not exposed.
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
1. **A running depsight instance.** Either local (`npm run dev`, default `http://localhost:3000`) or hosted.
|
|
25
|
+
2. **A depsight API token (`dsat_…`).** See [minting a token](#minting-a-token) below.
|
|
26
|
+
|
|
27
|
+
## Install + run
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# One-off via npx (published on npm via the release workflow; see Releasing below)
|
|
31
|
+
npx -y @opentriologue/depsight-mcp
|
|
32
|
+
|
|
33
|
+
# Or locally from this repo after `npm run build`
|
|
34
|
+
node /path/to/depsight/mcp/dist/index.js
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The server speaks MCP over stdio — launch it via your agent's MCP client config, not directly from a terminal.
|
|
38
|
+
|
|
39
|
+
### Claude Desktop / Claude Code config
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"mcpServers": {
|
|
44
|
+
"depsight": {
|
|
45
|
+
"command": "npx",
|
|
46
|
+
"args": ["-y", "@opentriologue/depsight-mcp"],
|
|
47
|
+
"env": {
|
|
48
|
+
"DEPSIGHT_URL": "https://depsight.opentriologue.ai",
|
|
49
|
+
"DEPSIGHT_API_TOKEN": "dsat_..."
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Both env vars are **required**; the server aborts on startup otherwise.
|
|
57
|
+
|
|
58
|
+
## Minting a token
|
|
59
|
+
|
|
60
|
+
API tokens live in the `ApiToken` Prisma model and are scoped to a single depsight user. Inside the depsight repo:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# ensure DATABASE_URL is set in your shell
|
|
64
|
+
npx tsx scripts/mint-api-token.ts --user <userId> --name claude-desktop
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The raw `dsat_…` value is printed **once**. Store it in your agent config (env var, secret manager) — there is no retrieve-existing endpoint. To rotate, mint a new one and `UPDATE "ApiToken" SET "revokedAt" = NOW() WHERE id = '…';` on the old row.
|
|
68
|
+
|
|
69
|
+
All data is scoped to the minting user: tools only see repos that user owns.
|
|
70
|
+
|
|
71
|
+
## Smoke test
|
|
72
|
+
|
|
73
|
+
After setting env vars:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# From the mcp/ directory
|
|
77
|
+
npm run build
|
|
78
|
+
|
|
79
|
+
# 1) Discover tools (handshake + tools/list)
|
|
80
|
+
printf '%s\n' \
|
|
81
|
+
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"0"}}}' \
|
|
82
|
+
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
|
|
83
|
+
| DEPSIGHT_URL=http://localhost:3000 DEPSIGHT_API_TOKEN=dsat_... node dist/index.js
|
|
84
|
+
|
|
85
|
+
# 2) Real round-trip against the depsight API — lists repos
|
|
86
|
+
printf '%s\n' \
|
|
87
|
+
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"0"}}}' \
|
|
88
|
+
'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"depsight_list_repos","arguments":{}}}' \
|
|
89
|
+
| DEPSIGHT_URL=http://localhost:3000 DEPSIGHT_API_TOKEN=dsat_... node dist/index.js
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Should print a JSON-RPC response listing the 8 tools, then a second response with the user's GitHub repos. In Claude Code, ask *"list my depsight repos with critical CVEs"* — the agent should call `depsight_list_repos` then `depsight_get_cves` with `minSeverity: "CRITICAL"` per repo.
|
|
93
|
+
|
|
94
|
+
## Error handling
|
|
95
|
+
|
|
96
|
+
Tool handlers never throw. On any failure (network, HTTP non-2xx, parse error), they return:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"content": [{ "type": "text", "text": "{\"success\":false,\"error\":\"…\"}" }],
|
|
101
|
+
"isError": true
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
HTTP errors carry the upstream status code and response body so you can tell a 401 (bad token) apart from a 404 (wrong `repoId`).
|
|
106
|
+
|
|
107
|
+
## Scope / limitations
|
|
108
|
+
|
|
109
|
+
- Read-only. v1 intentionally omits write operations (scan triggers, policy mutation, Slack config).
|
|
110
|
+
- No per-tool ACL. A token with the `dsat_` prefix can call any read tool for its user's data.
|
|
111
|
+
- No pagination beyond what the underlying REST endpoints already expose. Very large repos may produce large JSON responses.
|
|
112
|
+
- Tokens never expire automatically. Operators must rotate manually.
|
|
113
|
+
|
|
114
|
+
## Development
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm install
|
|
118
|
+
npm run dev # runs against DEPSIGHT_URL + DEPSIGHT_API_TOKEN via tsx
|
|
119
|
+
npm test # vitest
|
|
120
|
+
npm run build # emits dist/
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Releasing
|
|
124
|
+
|
|
125
|
+
Publishing is tag-driven via [`.github/workflows/publish-npm.yml`](../.github/workflows/publish-npm.yml),
|
|
126
|
+
kept separate from the app's `v*` releases so the two never collide.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# 1. Bump the version in mcp/package.json (e.g. 0.2.0 -> 0.2.1)
|
|
130
|
+
# 2. Commit, then push a tag whose suffix matches that version:
|
|
131
|
+
git tag depsight-mcp-v0.2.1
|
|
132
|
+
git push origin depsight-mcp-v0.2.1
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The workflow checks `mcp/package.json` version against the tag, builds, and runs
|
|
136
|
+
`npm publish --access public --provenance`. It requires a repo secret `NPM_TOKEN`
|
|
137
|
+
with publish rights to the `@opentriologue` npm org (operator one-time setup).
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Config } from "./config.js";
|
|
2
|
+
export declare class HttpError extends Error {
|
|
3
|
+
readonly status: number;
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly body: unknown;
|
|
6
|
+
constructor(status: number, path: string, body: unknown);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Thin HTTP client around depsight's Next.js API. Every request
|
|
10
|
+
* carries `Authorization: Bearer <dsat_...>` — the token is minted
|
|
11
|
+
* per user and scopes every tool call to that user's repos.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DepsightClient {
|
|
14
|
+
private readonly config;
|
|
15
|
+
constructor(config: Config);
|
|
16
|
+
private request;
|
|
17
|
+
listRepos(): Promise<unknown>;
|
|
18
|
+
getOverview(): Promise<unknown>;
|
|
19
|
+
getScan(repoId: string): Promise<unknown>;
|
|
20
|
+
getDeps(repoId: string): Promise<unknown>;
|
|
21
|
+
getLicense(repoId: string): Promise<unknown>;
|
|
22
|
+
getHistory(repoId: string, limit?: number): Promise<unknown>;
|
|
23
|
+
evaluatePolicy(scanId: string): Promise<unknown>;
|
|
24
|
+
getCiAnalytics(repoId: string, type: "fail-rate" | "build-times" | "flaky" | "bottleneck", period: 1 | 7 | 30): Promise<unknown>;
|
|
25
|
+
getCiAnalyticsCrossRepo(period: 1 | 7 | 30): Promise<unknown>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,SAAU,SAAQ,KAAK;aAEhB,MAAM,EAAE,MAAM;aACd,IAAI,EAAE,MAAM;aACZ,IAAI,EAAE,OAAO;gBAFb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO;CAIhC;AAED;;;;GAIG;AACH,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;YAE7B,OAAO;IAwCrB,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAI7B,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIzC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIzC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5C,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5D,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIhD,cAAc,CACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,WAAW,GAAG,aAAa,GAAG,OAAO,GAAG,YAAY,EAC1D,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GACjB,OAAO,CAAC,OAAO,CAAC;IAMnB,uBAAuB,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAK9D"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DepsightClient = exports.HttpError = void 0;
|
|
4
|
+
class HttpError extends Error {
|
|
5
|
+
constructor(status, path, body) {
|
|
6
|
+
super(`Depsight ${path} → HTTP ${status}: ${JSON.stringify(body)}`);
|
|
7
|
+
this.status = status;
|
|
8
|
+
this.path = path;
|
|
9
|
+
this.body = body;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.HttpError = HttpError;
|
|
13
|
+
/**
|
|
14
|
+
* Thin HTTP client around depsight's Next.js API. Every request
|
|
15
|
+
* carries `Authorization: Bearer <dsat_...>` — the token is minted
|
|
16
|
+
* per user and scopes every tool call to that user's repos.
|
|
17
|
+
*/
|
|
18
|
+
class DepsightClient {
|
|
19
|
+
constructor(config) {
|
|
20
|
+
this.config = config;
|
|
21
|
+
}
|
|
22
|
+
async request(method, path, init) {
|
|
23
|
+
const url = new URL(this.config.gatewayUrl + path);
|
|
24
|
+
if (init?.query) {
|
|
25
|
+
for (const [k, v] of Object.entries(init.query)) {
|
|
26
|
+
if (v === undefined || v === null || v === "")
|
|
27
|
+
continue;
|
|
28
|
+
url.searchParams.set(k, String(v));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const res = await fetch(url.toString(), {
|
|
32
|
+
method,
|
|
33
|
+
headers: {
|
|
34
|
+
"Content-Type": "application/json",
|
|
35
|
+
Accept: "application/json",
|
|
36
|
+
Authorization: `Bearer ${this.config.apiToken}`,
|
|
37
|
+
},
|
|
38
|
+
body: init?.body !== undefined ? JSON.stringify(init.body) : undefined,
|
|
39
|
+
});
|
|
40
|
+
const text = await res.text();
|
|
41
|
+
let parsed = null;
|
|
42
|
+
if (text.length > 0) {
|
|
43
|
+
try {
|
|
44
|
+
parsed = JSON.parse(text);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
parsed = text;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (!res.ok) {
|
|
51
|
+
throw new HttpError(res.status, path, parsed);
|
|
52
|
+
}
|
|
53
|
+
return parsed;
|
|
54
|
+
}
|
|
55
|
+
// ── Read tools (v1) ─────────────────────────────────────────
|
|
56
|
+
listRepos() {
|
|
57
|
+
return this.request("GET", "/api/repos");
|
|
58
|
+
}
|
|
59
|
+
getOverview() {
|
|
60
|
+
return this.request("GET", "/api/overview");
|
|
61
|
+
}
|
|
62
|
+
getScan(repoId) {
|
|
63
|
+
return this.request("GET", "/api/scan", { query: { repoId } });
|
|
64
|
+
}
|
|
65
|
+
getDeps(repoId) {
|
|
66
|
+
return this.request("GET", "/api/deps", { query: { repoId } });
|
|
67
|
+
}
|
|
68
|
+
getLicense(repoId) {
|
|
69
|
+
return this.request("GET", "/api/license", { query: { repoId } });
|
|
70
|
+
}
|
|
71
|
+
getHistory(repoId, limit) {
|
|
72
|
+
return this.request("GET", "/api/history", { query: { repoId, limit } });
|
|
73
|
+
}
|
|
74
|
+
evaluatePolicy(scanId) {
|
|
75
|
+
return this.request("POST", "/api/policies/evaluate", { body: { scanId } });
|
|
76
|
+
}
|
|
77
|
+
getCiAnalytics(repoId, type, period) {
|
|
78
|
+
return this.request("GET", `/api/ci/analytics/${encodeURIComponent(repoId)}`, {
|
|
79
|
+
query: { type, period },
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
getCiAnalyticsCrossRepo(period) {
|
|
83
|
+
return this.request("GET", "/api/ci/analytics/cross-repo", {
|
|
84
|
+
query: { period },
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.DepsightClient = DepsightClient;
|
|
89
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAEA,MAAa,SAAU,SAAQ,KAAK;IAClC,YACkB,MAAc,EACd,IAAY,EACZ,IAAa;QAE7B,KAAK,CAAC,YAAY,IAAI,WAAW,MAAM,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAJpD,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAS;IAG/B,CAAC;CACF;AARD,8BAQC;AAED;;;;GAIG;AACH,MAAa,cAAc;IACzB,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAEvC,KAAK,CAAC,OAAO,CACnB,MAAsB,EACtB,IAAY,EACZ,IAA8E;QAE9E,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;QACnD,IAAI,IAAI,EAAE,KAAK,EAAE,CAAC;YAChB,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBAChD,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE;oBAAE,SAAS;gBACxD,GAAG,CAAC,YAA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
|
5
|
+
/**
|
|
6
|
+
* Load runtime config from env vars.
|
|
7
|
+
*
|
|
8
|
+
* `DEPSIGHT_URL` — base URL of the depsight Next.js app (e.g.
|
|
9
|
+
* `https://depsight.opentriologue.ai` or `http://localhost:3000`).
|
|
10
|
+
* Required. Trailing slashes are stripped.
|
|
11
|
+
* `DEPSIGHT_API_TOKEN` — `dsat_` prefixed API token minted via
|
|
12
|
+
* `scripts/mint-api-token.ts`. Required. Scopes to the user who
|
|
13
|
+
* minted it; depsight has no per-tool ACL today.
|
|
14
|
+
*/
|
|
15
|
+
export declare function loadConfig(): Config;
|
|
16
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAqBnC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadConfig = loadConfig;
|
|
4
|
+
/**
|
|
5
|
+
* Load runtime config from env vars.
|
|
6
|
+
*
|
|
7
|
+
* `DEPSIGHT_URL` — base URL of the depsight Next.js app (e.g.
|
|
8
|
+
* `https://depsight.opentriologue.ai` or `http://localhost:3000`).
|
|
9
|
+
* Required. Trailing slashes are stripped.
|
|
10
|
+
* `DEPSIGHT_API_TOKEN` — `dsat_` prefixed API token minted via
|
|
11
|
+
* `scripts/mint-api-token.ts`. Required. Scopes to the user who
|
|
12
|
+
* minted it; depsight has no per-tool ACL today.
|
|
13
|
+
*/
|
|
14
|
+
function loadConfig() {
|
|
15
|
+
const gatewayUrl = process.env.DEPSIGHT_URL;
|
|
16
|
+
if (!gatewayUrl) {
|
|
17
|
+
throw new Error("DEPSIGHT_URL environment variable is required.\n" +
|
|
18
|
+
"Set it to the URL of your depsight instance, e.g. https://depsight.opentriologue.ai");
|
|
19
|
+
}
|
|
20
|
+
const apiToken = process.env.DEPSIGHT_API_TOKEN;
|
|
21
|
+
if (!apiToken) {
|
|
22
|
+
throw new Error("DEPSIGHT_API_TOKEN environment variable is required.\n" +
|
|
23
|
+
"Mint one with `npx tsx scripts/mint-api-token.ts --user <id>` inside the depsight repo.");
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
gatewayUrl: gatewayUrl.replace(/\/$/, ""),
|
|
27
|
+
apiToken,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;AAeA,gCAqBC;AA/BD;;;;;;;;;GASG;AACH,SAAgB,UAAU;IACxB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IAC5C,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,kDAAkD;YAChD,qFAAqF,CACxF,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;IAChD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,wDAAwD;YACtD,yFAAyF,CAC5F,CAAC;IACJ,CAAC;IAED,OAAO;QACL,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;QACzC,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const config_js_1 = require("./config.js");
|
|
5
|
+
const server_js_1 = require("./server.js");
|
|
6
|
+
async function main() {
|
|
7
|
+
try {
|
|
8
|
+
const config = (0, config_js_1.loadConfig)();
|
|
9
|
+
await (0, server_js_1.startServer)(config);
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
console.error("[depsight-mcp] Fatal error:", err);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
main();
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,2CAAyC;AACzC,2CAA0C;AAE1C,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,sBAAU,GAAE,CAAC;QAC5B,MAAM,IAAA,uBAAW,EAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;QAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { Config } from "./config.js";
|
|
3
|
+
export declare function createServer(config: Config): McpServer;
|
|
4
|
+
export declare function startServer(config: Config): Promise<void>;
|
|
5
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAU1C,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAiBtD;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/D"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createServer = createServer;
|
|
4
|
+
exports.startServer = startServer;
|
|
5
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
6
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
7
|
+
const client_js_1 = require("./client.js");
|
|
8
|
+
const repos_js_1 = require("./tools/repos.js");
|
|
9
|
+
const cves_js_1 = require("./tools/cves.js");
|
|
10
|
+
const deps_js_1 = require("./tools/deps.js");
|
|
11
|
+
const license_js_1 = require("./tools/license.js");
|
|
12
|
+
const history_js_1 = require("./tools/history.js");
|
|
13
|
+
const policy_js_1 = require("./tools/policy.js");
|
|
14
|
+
const ci_js_1 = require("./tools/ci.js");
|
|
15
|
+
function createServer(config) {
|
|
16
|
+
const server = new mcp_js_1.McpServer({
|
|
17
|
+
name: "depsight",
|
|
18
|
+
version: "0.1.0",
|
|
19
|
+
});
|
|
20
|
+
const client = new client_js_1.DepsightClient(config);
|
|
21
|
+
(0, repos_js_1.registerRepoTools)(server, client);
|
|
22
|
+
(0, cves_js_1.registerCveTools)(server, client);
|
|
23
|
+
(0, deps_js_1.registerDepsTools)(server, client);
|
|
24
|
+
(0, license_js_1.registerLicenseTools)(server, client);
|
|
25
|
+
(0, history_js_1.registerHistoryTools)(server, client);
|
|
26
|
+
(0, policy_js_1.registerPolicyTools)(server, client);
|
|
27
|
+
(0, ci_js_1.registerCiTools)(server, client);
|
|
28
|
+
return server;
|
|
29
|
+
}
|
|
30
|
+
async function startServer(config) {
|
|
31
|
+
const server = createServer(config);
|
|
32
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
33
|
+
await server.connect(transport);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;AAYA,oCAiBC;AAED,kCAIC;AAnCD,oEAAoE;AACpE,wEAAiF;AAEjF,2CAA6C;AAC7C,+CAAqD;AACrD,6CAAmD;AACnD,6CAAoD;AACpD,mDAA0D;AAC1D,mDAA0D;AAC1D,iDAAwD;AACxD,yCAAgD;AAEhD,SAAgB,YAAY,CAAC,MAAc;IACzC,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QAC3B,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,0BAAc,CAAC,MAAM,CAAC,CAAC;IAE1C,IAAA,4BAAiB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,IAAA,0BAAgB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAA,2BAAiB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,IAAA,iCAAoB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,IAAA,iCAAoB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,IAAA,+BAAmB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,IAAA,uBAAe,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC,OAAO,MAAM,CAAC;AAChB,CAAC;AAEM,KAAK,UAAU,WAAW,CAAC,MAAc;IAC9C,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci.d.ts","sourceRoot":"","sources":["../../src/tools/ci.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAKnD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,cAAc,GACrB,IAAI,CAkDN"}
|
package/dist/tools/ci.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerCiTools = registerCiTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_js_1 = require("./shared.js");
|
|
6
|
+
const PERIODS = [1, 7, 30];
|
|
7
|
+
function registerCiTools(server, client) {
|
|
8
|
+
server.tool("depsight_ci_analytics", "GitHub Actions CI insights. When `repoId` is provided, returns per-repo data for the chosen analytics `type` (fail-rate / build-times / flaky / bottleneck). When `repoId` is omitted, returns cross-repo health summaries across all tracked repos.", {
|
|
9
|
+
repoId: zod_1.z
|
|
10
|
+
.string()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("Optional: the depsight repo ID. Omit to get cross-repo summaries."),
|
|
13
|
+
type: zod_1.z
|
|
14
|
+
.enum(["fail-rate", "build-times", "flaky", "bottleneck"])
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("Analytics type (repo-scoped only, default fail-rate). Ignored for cross-repo queries."),
|
|
17
|
+
period: zod_1.z
|
|
18
|
+
.enum(["1", "7", "30"])
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Lookback window in days. Default 30."),
|
|
21
|
+
}, async ({ repoId, type, period }) => {
|
|
22
|
+
try {
|
|
23
|
+
const parsedPeriod = (period ? Number(period) : 30);
|
|
24
|
+
const validPeriod = PERIODS.includes(parsedPeriod)
|
|
25
|
+
? parsedPeriod
|
|
26
|
+
: 30;
|
|
27
|
+
if (!repoId) {
|
|
28
|
+
const data = await client.getCiAnalyticsCrossRepo(validPeriod);
|
|
29
|
+
return (0, shared_js_1.ok)(data);
|
|
30
|
+
}
|
|
31
|
+
const data = await client.getCiAnalytics(repoId, type ?? "fail-rate", validPeriod);
|
|
32
|
+
return (0, shared_js_1.ok)(data);
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
return (0, shared_js_1.errResult)(e);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=ci.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci.js","sourceRoot":"","sources":["../../src/tools/ci.ts"],"names":[],"mappings":";;AAOA,0CAqDC;AA3DD,6BAAwB;AAExB,2CAA4C;AAE5C,MAAM,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAU,CAAC;AAEpC,SAAgB,eAAe,CAC7B,MAAiB,EACjB,MAAsB;IAEtB,MAAM,CAAC,IAAI,CACT,uBAAuB,EACvB,sPAAsP,EACtP;QACE,MAAM,EAAE,OAAC;aACN,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,mEAAmE,CACpE;QACH,IAAI,EAAE,OAAC;aACJ,IAAI,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;aACzD,QAAQ,EAAE;aACV,QAAQ,CACP,uFAAuF,CACxF;QACH,MAAM,EAAE,OAAC;aACN,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;aACtB,QAAQ,EAAE;aACV,QAAQ,CAAC,sCAAsC,CAAC;KACpD,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;QACjC,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAG5C,CAAC;YACP,MAAM,WAAW,GAAI,OAA6B,CAAC,QAAQ,CACzD,YAAY,CACb;gBACC,CAAC,CAAC,YAAY;gBACd,CAAC,CAAC,EAAE,CAAC;YAEP,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;gBAC/D,OAAO,IAAA,cAAE,EAAC,IAAI,CAAC,CAAC;YAClB,CAAC;YAED,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,cAAc,CACtC,MAAM,EACN,IAAI,IAAI,WAAW,EACnB,WAAW,CACZ,CAAC;YACF,OAAO,IAAA,cAAE,EAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAA,qBAAS,EAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cves.d.ts","sourceRoot":"","sources":["../../src/tools/cves.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAWnD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,cAAc,GACrB,IAAI,CA4EN"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerCveTools = registerCveTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_js_1 = require("./shared.js");
|
|
6
|
+
const SEVERITIES = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
|
|
7
|
+
function severityRank(s) {
|
|
8
|
+
const idx = SEVERITIES.indexOf(s.toUpperCase());
|
|
9
|
+
return idx === -1 ? 99 : idx;
|
|
10
|
+
}
|
|
11
|
+
function registerCveTools(server, client) {
|
|
12
|
+
server.tool("depsight_get_cves", "Get CVE advisories from the most recent completed CVE scan for a repo. Optionally filter by minimum severity and/or a publish-after cutoff. Returns the full scan envelope (counts, risk score) plus the filtered advisory list.", {
|
|
13
|
+
repoId: zod_1.z
|
|
14
|
+
.string()
|
|
15
|
+
.min(1)
|
|
16
|
+
.describe("The depsight repo ID. Get it from depsight_list_repos."),
|
|
17
|
+
minSeverity: zod_1.z
|
|
18
|
+
.enum(SEVERITIES)
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Only include advisories at or above this severity."),
|
|
21
|
+
publishedAfter: zod_1.z
|
|
22
|
+
.string()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("ISO 8601 date/time. Only include advisories published at or after this instant."),
|
|
25
|
+
}, async ({ repoId, minSeverity, publishedAfter }) => {
|
|
26
|
+
try {
|
|
27
|
+
const data = (await client.getScan(repoId));
|
|
28
|
+
if (!data || !data.scan) {
|
|
29
|
+
return (0, shared_js_1.ok)({
|
|
30
|
+
success: true,
|
|
31
|
+
scan: null,
|
|
32
|
+
advisories: [],
|
|
33
|
+
message: "No completed CVE scan found for this repo yet.",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const minRank = minSeverity !== undefined ? severityRank(minSeverity) : Infinity;
|
|
37
|
+
const cutoff = publishedAfter ? Date.parse(publishedAfter) : null;
|
|
38
|
+
if (publishedAfter && cutoff !== null && Number.isNaN(cutoff)) {
|
|
39
|
+
return (0, shared_js_1.errResult)(new Error(`publishedAfter is not a valid ISO 8601 date: "${publishedAfter}"`));
|
|
40
|
+
}
|
|
41
|
+
const advisories = data.scan.advisories.filter((a) => {
|
|
42
|
+
const sev = typeof a.severity === "string" ? a.severity : "";
|
|
43
|
+
if (minSeverity !== undefined && severityRank(sev) > minRank) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (cutoff !== null) {
|
|
47
|
+
const published = typeof a.publishedAt === "string"
|
|
48
|
+
? Date.parse(a.publishedAt)
|
|
49
|
+
: NaN;
|
|
50
|
+
// An advisory with a missing or un-parseable publishedAt
|
|
51
|
+
// is excluded when a cutoff is active — the caller asked
|
|
52
|
+
// for "after this date" and we cannot prove it satisfies
|
|
53
|
+
// that condition.
|
|
54
|
+
if (Number.isNaN(published) || published < cutoff)
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
});
|
|
59
|
+
return (0, shared_js_1.ok)({
|
|
60
|
+
success: true,
|
|
61
|
+
scan: { ...data.scan, advisories },
|
|
62
|
+
filterApplied: { minSeverity, publishedAfter },
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
return (0, shared_js_1.errResult)(e);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=cves.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cves.js","sourceRoot":"","sources":["../../src/tools/cves.ts"],"names":[],"mappings":";;AAaA,4CA+EC;AA3FD,6BAAwB;AAExB,2CAA4C;AAE5C,MAAM,UAAU,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAC;AAGlE,SAAS,YAAY,CAAC,CAAS;IAC7B,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAc,CAAC,CAAC;IAC5D,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AAC/B,CAAC;AAED,SAAgB,gBAAgB,CAC9B,MAAiB,EACjB,MAAsB;IAEtB,MAAM,CAAC,IAA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c,CAAC;AAGnD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,cAAc,GACrB,IAAI,CAmBN"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerDepsTools = registerDepsTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_js_1 = require("./shared.js");
|
|
6
|
+
function registerDepsTools(server, client) {
|
|
7
|
+
server.tool("depsight_get_deps", "Get the dependency-age report for a repo: which packages are up-to-date, outdated, major-behind, or deprecated, based on the latest dependency scan.", {
|
|
8
|
+
repoId: zod_1.z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.describe("The depsight repo ID. Get it from depsight_list_repos."),
|
|
12
|
+
}, async ({ repoId }) => {
|
|
13
|
+
try {
|
|
14
|
+
const data = await client.getDeps(repoId);
|
|
15
|
+
return (0, shared_js_1.ok)(data);
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
return (0, shared_js_1.errResult)(e);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=deps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deps.js","sourceRoot":"","sources":["../../src/tools/deps.ts"],"names":[],"mappings":";;AAKA,8CAsBC;AA1BD,6BAAwB;AAExB,2CAA4C;AAE5C,SAAgB,iBAAiB,CAC/B,MAAiB,EACjB,MAAsB;IAEtB,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,sJAAsJ,EACtJ;QACE,MAAM,EAAE,OAAC;aACN,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,wDAAwD,CAAC;KACtE,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACnB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAC1C,OAAO,IAAA,cAAE,EAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAA,qBAAS,EAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/tools/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,cAAc,GACrB,IAAI,CA0BN"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerHistoryTools = registerHistoryTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_js_1 = require("./shared.js");
|
|
6
|
+
function registerHistoryTools(server, client) {
|
|
7
|
+
server.tool("depsight_get_history", "Get the CVE-scan history (time series of risk scores and CVE counts) for a repo. Useful for trend analysis.", {
|
|
8
|
+
repoId: zod_1.z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.describe("The depsight repo ID. Get it from depsight_list_repos."),
|
|
12
|
+
limit: zod_1.z
|
|
13
|
+
.number()
|
|
14
|
+
.int()
|
|
15
|
+
.min(1)
|
|
16
|
+
.max(100)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Number of past scans to return (default 30, max 100)."),
|
|
19
|
+
}, async ({ repoId, limit }) => {
|
|
20
|
+
try {
|
|
21
|
+
const data = await client.getHistory(repoId, limit);
|
|
22
|
+
return (0, shared_js_1.ok)(data);
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
return (0, shared_js_1.errResult)(e);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/tools/history.ts"],"names":[],"mappings":";;AAKA,oDA6BC;AAjCD,6BAAwB;AAExB,2CAA4C;AAE5C,SAAgB,oBAAoB,CAClC,MAAiB,EACjB,MAAsB;IAEtB,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,6GAA6G,EAC7G;QACE,MAAM,EAAE,OAAC;aACN,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,wDAAwD,CAAC;QACrE,KAAK,EAAE,OAAC;aACL,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,uDAAuD,CAAC;KACrE,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;QAC1B,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YACpD,OAAO,IAAA,cAAE,EAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAA,qBAAS,EAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../src/tools/license.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,cAAc,GACrB,IAAI,CAmBN"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerLicenseTools = registerLicenseTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_js_1 = require("./shared.js");
|
|
6
|
+
function registerLicenseTools(server, client) {
|
|
7
|
+
server.tool("depsight_get_license_report", "Get the license-compatibility report for a repo: per-package licenses, compatibility flags, policy violations, and totals.", {
|
|
8
|
+
repoId: zod_1.z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.describe("The depsight repo ID. Get it from depsight_list_repos."),
|
|
12
|
+
}, async ({ repoId }) => {
|
|
13
|
+
try {
|
|
14
|
+
const data = await client.getLicense(repoId);
|
|
15
|
+
return (0, shared_js_1.ok)(data);
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
return (0, shared_js_1.errResult)(e);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=license.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license.js","sourceRoot":"","sources":["../../src/tools/license.ts"],"names":[],"mappings":";;AAKA,oDAsBC;AA1BD,6BAAwB;AAExB,2CAA4C;AAE5C,SAAgB,oBAAoB,CAClC,MAAiB,EACjB,MAAsB;IAEtB,MAAM,CAAC,IAAI,CACT,6BAA6B,EAC7B,4HAA4H,EAC5H;QACE,MAAM,EAAE,OAAC;aACN,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,wDAAwD,CAAC;KACtE,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACnB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAC7C,OAAO,IAAA,cAAE,EAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAA,qBAAS,EAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/tools/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,cAAc,GACrB,IAAI,CAqBN"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerPolicyTools = registerPolicyTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_js_1 = require("./shared.js");
|
|
6
|
+
function registerPolicyTools(server, client) {
|
|
7
|
+
server.tool("depsight_evaluate_policy", "Evaluate the user's enabled policies (LICENSE_DENY, LICENSE_ALLOW_ONLY, CVE_MIN_SEVERITY, DEPENDENCY_MAX_AGE) against a specific scan. Read-only — does not mutate state. Returns the violations with affected packages.", {
|
|
8
|
+
scanId: zod_1.z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.describe("The scan ID to evaluate. Get it from depsight_get_cves (scan.id) or depsight_get_deps (scanId)."),
|
|
12
|
+
}, async ({ scanId }) => {
|
|
13
|
+
try {
|
|
14
|
+
const data = await client.evaluatePolicy(scanId);
|
|
15
|
+
return (0, shared_js_1.ok)(data);
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
return (0, shared_js_1.errResult)(e);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/tools/policy.ts"],"names":[],"mappings":";;AAKA,kDAwBC;AA5BD,6BAAwB;AAExB,2CAA4C;AAE5C,SAAgB,mBAAmB,CACjC,MAAiB,EACjB,MAAsB;IAEtB,MAAM,CAAC,IAAI,CACT,0BAA0B,EAC1B,0NAA0N,EAC1N;QACE,MAAM,EAAE,OAAC;aACN,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,iGAAiG,CAClG;KACJ,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACnB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACjD,OAAO,IAAA,cAAE,EAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAA,qBAAS,EAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repos.d.ts","sourceRoot":"","sources":["../../src/tools/repos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,cAAc,GACrB,IAAI,CA4BN"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerRepoTools = registerRepoTools;
|
|
4
|
+
const shared_js_1 = require("./shared.js");
|
|
5
|
+
function registerRepoTools(server, client) {
|
|
6
|
+
server.tool("depsight_list_repos", "List the GitHub repositories the authenticated user has access to (via their GitHub token). Use this to discover `repoId` values that other depsight_* tools accept.", {}, async () => {
|
|
7
|
+
try {
|
|
8
|
+
const data = await client.listRepos();
|
|
9
|
+
return (0, shared_js_1.ok)(data);
|
|
10
|
+
}
|
|
11
|
+
catch (e) {
|
|
12
|
+
return (0, shared_js_1.errResult)(e);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
server.tool("depsight_get_overview", "Team-health dashboard summary across all tracked repos: aggregate CVE counts, risk scores, license issues, and the top riskiest repos. No arguments.", {}, async () => {
|
|
16
|
+
try {
|
|
17
|
+
const data = await client.getOverview();
|
|
18
|
+
return (0, shared_js_1.ok)(data);
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
return (0, shared_js_1.errResult)(e);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=repos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repos.js","sourceRoot":"","sources":["../../src/tools/repos.ts"],"names":[],"mappings":";;AAIA,8CA+BC;AAjCD,2CAA4C;AAE5C,SAAgB,iBAAiB,CAC/B,MAAiB,EACjB,MAAsB;IAEtB,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,sKAAsK,EACtK,EAAE,EACF,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC;YACtC,OAAO,IAAA,cAAE,EAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAA,qBAAS,EAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,uBAAuB,EACvB,sJAAsJ,EACtJ,EAAE,EACF,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;YACxC,OAAO,IAAA,cAAE,EAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAA,qBAAS,EAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ToolResult = {
|
|
2
|
+
content: Array<{
|
|
3
|
+
type: "text";
|
|
4
|
+
text: string;
|
|
5
|
+
}>;
|
|
6
|
+
isError?: true;
|
|
7
|
+
};
|
|
8
|
+
export declare function ok(data: unknown): ToolResult;
|
|
9
|
+
export declare function errResult(error: unknown): ToolResult;
|
|
10
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/tools/shared.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF,wBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,CAI5C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAWpD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ok = ok;
|
|
4
|
+
exports.errResult = errResult;
|
|
5
|
+
function ok(data) {
|
|
6
|
+
return {
|
|
7
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function errResult(error) {
|
|
11
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
12
|
+
return {
|
|
13
|
+
content: [
|
|
14
|
+
{
|
|
15
|
+
type: "text",
|
|
16
|
+
text: JSON.stringify({ success: false, error: message }, null, 2),
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
isError: true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/tools/shared.ts"],"names":[],"mappings":";;AAKA,gBAIC;AAED,8BAWC;AAjBD,SAAgB,EAAE,CAAC,IAAa;IAC9B,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACjE,CAAC;AACJ,CAAC;AAED,SAAgB,SAAS,CAAC,KAAc;IACtC,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;aAClE;SACF;QACD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opentriologue/depsight-mcp",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "MCP server for depsight — query CVE, license, dependency and CI data from Claude / other agents",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"depsight-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsx src/index.ts",
|
|
13
|
+
"test": "vitest run",
|
|
14
|
+
"test:watch": "vitest",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist/**/*",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
23
|
+
"zod": "^3.22.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^20.0.0",
|
|
27
|
+
"tsx": "^4.19.0",
|
|
28
|
+
"typescript": "^5.3.0",
|
|
29
|
+
"vitest": "^3.0.0"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18.0.0"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"mcp",
|
|
39
|
+
"depsight",
|
|
40
|
+
"security",
|
|
41
|
+
"cve",
|
|
42
|
+
"sbom",
|
|
43
|
+
"license",
|
|
44
|
+
"ai-agents",
|
|
45
|
+
"model-context-protocol"
|
|
46
|
+
],
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "https://github.com/LanNguyenSi/depsight.git",
|
|
51
|
+
"directory": "mcp"
|
|
52
|
+
}
|
|
53
|
+
}
|