@cognium/mcp-server 0.2.0 → 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/CHANGELOG.md +126 -0
- package/README.md +41 -5
- package/dist/bin.js +11 -5
- package/dist/bin.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/licence.js +1 -1
- package/dist/licence.js.map +1 -1
- package/dist/modules.d.ts +1 -1
- package/dist/modules.d.ts.map +1 -1
- package/dist/params-guard.d.ts +31 -0
- package/dist/params-guard.d.ts.map +1 -0
- package/dist/params-guard.js +75 -0
- package/dist/params-guard.js.map +1 -0
- package/dist/resources/index.d.ts +1 -1
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/server.d.ts +17 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +28 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/attack-surface-summary.d.ts +6 -0
- package/dist/tools/attack-surface-summary.d.ts.map +1 -1
- package/dist/tools/attack-surface-summary.js +2 -1
- package/dist/tools/attack-surface-summary.js.map +1 -1
- package/dist/tools/check-sanitizer.d.ts +6 -0
- package/dist/tools/check-sanitizer.d.ts.map +1 -1
- package/dist/tools/check-sanitizer.js +2 -1
- package/dist/tools/check-sanitizer.js.map +1 -1
- package/dist/tools/describe-sink.d.ts +6 -0
- package/dist/tools/describe-sink.d.ts.map +1 -1
- package/dist/tools/describe-sink.js +2 -1
- package/dist/tools/describe-sink.js.map +1 -1
- package/dist/tools/describe-source.d.ts +6 -0
- package/dist/tools/describe-source.d.ts.map +1 -1
- package/dist/tools/describe-source.js +2 -1
- package/dist/tools/describe-source.js.map +1 -1
- package/dist/tools/explain-finding.d.ts +6 -0
- package/dist/tools/explain-finding.d.ts.map +1 -1
- package/dist/tools/explain-finding.js +2 -1
- package/dist/tools/explain-finding.js.map +1 -1
- package/dist/tools/find-similar.d.ts +6 -0
- package/dist/tools/find-similar.d.ts.map +1 -1
- package/dist/tools/find-similar.js +2 -1
- package/dist/tools/find-similar.js.map +1 -1
- package/dist/tools/list-entry-points.d.ts +6 -0
- package/dist/tools/list-entry-points.d.ts.map +1 -1
- package/dist/tools/list-entry-points.js +2 -1
- package/dist/tools/list-entry-points.js.map +1 -1
- package/dist/tools/list-reachable-sinks.d.ts +6 -0
- package/dist/tools/list-reachable-sinks.d.ts.map +1 -1
- package/dist/tools/list-reachable-sinks.js +2 -1
- package/dist/tools/list-reachable-sinks.js.map +1 -1
- package/dist/tools/refresh.d.ts +6 -0
- package/dist/tools/refresh.d.ts.map +1 -1
- package/dist/tools/refresh.js +2 -1
- package/dist/tools/refresh.js.map +1 -1
- package/dist/tools/scan.d.ts +6 -0
- package/dist/tools/scan.d.ts.map +1 -1
- package/dist/tools/scan.js +2 -1
- package/dist/tools/scan.js.map +1 -1
- package/dist/tools/taint-paths.d.ts +6 -0
- package/dist/tools/taint-paths.d.ts.map +1 -1
- package/dist/tools/taint-paths.js +2 -1
- package/dist/tools/taint-paths.js.map +1 -1
- package/dist/tools/types.d.ts +31 -1
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +32 -1
- package/dist/tools/types.js.map +1 -1
- package/package.json +18 -7
package/dist/tools/types.d.ts
CHANGED
|
@@ -14,6 +14,36 @@ export interface ToolContext {
|
|
|
14
14
|
*/
|
|
15
15
|
enablement: Enablement;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* How a response was produced. Every tool in this package computes its
|
|
19
|
+
* answer from static analysis alone, so every successful response says so.
|
|
20
|
+
* An optional module that calls a model reports `llm: <model>` instead; a
|
|
21
|
+
* client can rely on the field rather than infer it from the tool's name.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DETERMINISTIC = "deterministic";
|
|
24
|
+
/**
|
|
25
|
+
* What the built-in tools declare about themselves. They read the project
|
|
26
|
+
* they are pointed at and nothing else: no file is written or deleted and
|
|
27
|
+
* nothing leaves the machine. A client may use these to decide whether a
|
|
28
|
+
* call needs confirmation, so they are claims to keep true, not decoration.
|
|
29
|
+
*/
|
|
30
|
+
export declare const READ_ONLY_ANNOTATIONS: {
|
|
31
|
+
readonly readOnlyHint: true;
|
|
32
|
+
readonly destructiveHint: false;
|
|
33
|
+
readonly idempotentHint: true;
|
|
34
|
+
readonly openWorldHint: false;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* `refresh` drops entries from the server's in-memory analysis cache. It
|
|
38
|
+
* touches no file, but it does change the server's state, so it does not
|
|
39
|
+
* claim to be read-only.
|
|
40
|
+
*/
|
|
41
|
+
export declare const CACHE_RESET_ANNOTATIONS: {
|
|
42
|
+
readonly readOnlyHint: false;
|
|
43
|
+
readonly destructiveHint: false;
|
|
44
|
+
readonly idempotentHint: true;
|
|
45
|
+
readonly openWorldHint: false;
|
|
46
|
+
};
|
|
17
47
|
/**
|
|
18
48
|
* MCP `CallToolResult`-compatible shape. We construct the JSON payload
|
|
19
49
|
* ourselves so tools have full control over serialization + truncation.
|
|
@@ -26,6 +56,6 @@ export interface ToolResult {
|
|
|
26
56
|
structuredContent?: Record<string, unknown>;
|
|
27
57
|
isError?: boolean;
|
|
28
58
|
}
|
|
29
|
-
export declare function textResult(payload:
|
|
59
|
+
export declare function textResult(payload: object | string, structured?: Record<string, unknown>): ToolResult;
|
|
30
60
|
export declare function errorResult(message: string): ToolResult;
|
|
31
61
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,qEAAqE;IACrE,KAAK,EAAE,YAAY,CAAC;IACpB;;;;;OAKG;IACH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,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAOrG;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAKvD"}
|
package/dist/tools/types.js
CHANGED
|
@@ -1,8 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared types for tool handlers.
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* How a response was produced. Every tool in this package computes its
|
|
6
|
+
* answer from static analysis alone, so every successful response says so.
|
|
7
|
+
* An optional module that calls a model reports `llm: <model>` instead; a
|
|
8
|
+
* client can rely on the field rather than infer it from the tool's name.
|
|
9
|
+
*/
|
|
10
|
+
export const DETERMINISTIC = 'deterministic';
|
|
11
|
+
/**
|
|
12
|
+
* What the built-in tools declare about themselves. They read the project
|
|
13
|
+
* they are pointed at and nothing else: no file is written or deleted and
|
|
14
|
+
* nothing leaves the machine. A client may use these to decide whether a
|
|
15
|
+
* call needs confirmation, so they are claims to keep true, not decoration.
|
|
16
|
+
*/
|
|
17
|
+
export const READ_ONLY_ANNOTATIONS = {
|
|
18
|
+
readOnlyHint: true,
|
|
19
|
+
destructiveHint: false,
|
|
20
|
+
idempotentHint: true,
|
|
21
|
+
openWorldHint: false,
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* `refresh` drops entries from the server's in-memory analysis cache. It
|
|
25
|
+
* touches no file, but it does change the server's state, so it does not
|
|
26
|
+
* claim to be read-only.
|
|
27
|
+
*/
|
|
28
|
+
export const CACHE_RESET_ANNOTATIONS = {
|
|
29
|
+
readOnlyHint: false,
|
|
30
|
+
destructiveHint: false,
|
|
31
|
+
idempotentHint: true,
|
|
32
|
+
openWorldHint: false,
|
|
33
|
+
};
|
|
4
34
|
export function textResult(payload, structured) {
|
|
5
|
-
|
|
35
|
+
// `provenance` goes last, so the fields a reader came for stay first.
|
|
36
|
+
const text = typeof payload === 'string' ? payload : JSON.stringify({ ...payload, provenance: DETERMINISTIC }, null, 2);
|
|
6
37
|
const result = { content: [{ type: 'text', text }] };
|
|
7
38
|
if (structured)
|
|
8
39
|
result.structuredContent = structured;
|
package/dist/tools/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiBH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,KAAK;CACZ,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,YAAY,EAAE,KAAK;IACnB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,KAAK;CACZ,CAAC;AAYX,MAAM,UAAU,UAAU,CAAC,OAAwB,EAAE,UAAoC;IACvF,sEAAsE;IACtE,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7G,MAAM,MAAM,GAAe,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACjE,IAAI,UAAU;QAAE,MAAM,CAAC,iBAAiB,GAAG,UAAU,CAAC;IACtD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;QACtD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognium/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Model Context Protocol server exposing the circle-ir SAST engine as structured tools for LLM agents (Claude Desktop, Claude Code, Cursor, cognium-ai).",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
|
-
"import": "./dist/index.js"
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"default": "./dist/index.js"
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
18
|
"files": [
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
"typecheck": "tsc --noEmit",
|
|
27
28
|
"test": "vitest run",
|
|
28
29
|
"test:watch": "vitest",
|
|
29
|
-
"prepublishOnly": "npm
|
|
30
|
+
"prepublishOnly": "npm --prefix ../.. run release:check",
|
|
30
31
|
"test:coverage": "vitest run --coverage"
|
|
31
32
|
},
|
|
32
33
|
"keywords": [
|
|
@@ -48,12 +49,12 @@
|
|
|
48
49
|
"license": "MIT",
|
|
49
50
|
"repository": {
|
|
50
51
|
"type": "git",
|
|
51
|
-
"url": "git+https://github.com/cogniumhq/cognium-
|
|
52
|
+
"url": "git+https://github.com/cogniumhq/cognium-mcp.git",
|
|
52
53
|
"directory": "packages/mcp-server"
|
|
53
54
|
},
|
|
54
|
-
"homepage": "https://github.com/cogniumhq/cognium-
|
|
55
|
+
"homepage": "https://github.com/cogniumhq/cognium-mcp/tree/main/packages/mcp-server#readme",
|
|
55
56
|
"bugs": {
|
|
56
|
-
"url": "https://github.com/cogniumhq/cognium-
|
|
57
|
+
"url": "https://github.com/cogniumhq/cognium-mcp/issues"
|
|
57
58
|
},
|
|
58
59
|
"engines": {
|
|
59
60
|
"node": ">=20.19.0"
|
|
@@ -63,12 +64,22 @@
|
|
|
63
64
|
"registry": "https://registry.npmjs.org/"
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
|
-
"@modelcontextprotocol/
|
|
67
|
+
"@modelcontextprotocol/core": "^2.2.0",
|
|
68
|
+
"@modelcontextprotocol/server": "^2.2.0",
|
|
67
69
|
"circle-ir": "4.9.29",
|
|
68
70
|
"yaml": "^2.9.1",
|
|
69
71
|
"zod": "^4.6.5"
|
|
70
72
|
},
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"circle-ir-ai": ">=4.17.0"
|
|
75
|
+
},
|
|
76
|
+
"peerDependenciesMeta": {
|
|
77
|
+
"circle-ir-ai": {
|
|
78
|
+
"optional": true
|
|
79
|
+
}
|
|
80
|
+
},
|
|
71
81
|
"devDependencies": {
|
|
82
|
+
"@modelcontextprotocol/client": "^2.2.0",
|
|
72
83
|
"@types/node": "^26.6.2",
|
|
73
84
|
"@vitest/coverage-v8": "^5.0.2",
|
|
74
85
|
"typescript": "^7.0.2",
|