@securityreviewai/security-review-mcp 0.2.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.
@@ -0,0 +1,46 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ export function parseDotEnv(content) {
4
+ const out = {};
5
+ const lines = content.split(/\r?\n/u);
6
+ for (const rawLine of lines) {
7
+ const line = rawLine.trim();
8
+ if (!line || line.startsWith("#")) {
9
+ continue;
10
+ }
11
+ const eq = line.indexOf("=");
12
+ if (eq <= 0) {
13
+ continue;
14
+ }
15
+ const key = line.slice(0, eq).trim();
16
+ if (!key) {
17
+ continue;
18
+ }
19
+ let value = line.slice(eq + 1).trim();
20
+ const quoted = (value.startsWith("\"") && value.endsWith("\"")) ||
21
+ (value.startsWith("'") && value.endsWith("'"));
22
+ if (quoted) {
23
+ value = value.slice(1, -1);
24
+ }
25
+ out[key] = value;
26
+ }
27
+ return out;
28
+ }
29
+ export function loadEnvFile(filePath, env) {
30
+ if (!filePath) {
31
+ return;
32
+ }
33
+ if (!fs.existsSync(filePath)) {
34
+ return;
35
+ }
36
+ const parsed = parseDotEnv(fs.readFileSync(filePath, "utf8"));
37
+ for (const [key, value] of Object.entries(parsed)) {
38
+ if (env[key] === undefined || env[key] === "") {
39
+ env[key] = value;
40
+ }
41
+ }
42
+ }
43
+ export function loadDefaultEnvFile(cwd, env) {
44
+ const dotEnvPath = path.join(cwd, ".env");
45
+ loadEnvFile(dotEnvPath, env);
46
+ }
@@ -0,0 +1,27 @@
1
+ export function jsonStringify(value) {
2
+ return JSON.stringify(value, (_key, entry) => (typeof entry === "bigint" ? entry.toString() : entry), 2);
3
+ }
4
+ export function textToolResult(value) {
5
+ return {
6
+ content: [
7
+ {
8
+ type: "text",
9
+ text: typeof value === "string" ? value : jsonStringify(value),
10
+ },
11
+ ],
12
+ };
13
+ }
14
+ export function errorToolResult(error, statusCode) {
15
+ return {
16
+ isError: true,
17
+ content: [
18
+ {
19
+ type: "text",
20
+ text: jsonStringify({
21
+ error,
22
+ ...(statusCode === undefined ? {} : { status_code: statusCode }),
23
+ }),
24
+ },
25
+ ],
26
+ };
27
+ }
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@securityreviewai/security-review-mcp",
3
+ "version": "0.2.9",
4
+ "description": "Security Review MCP server (pure Node/TypeScript, npx-ready)",
5
+ "license": "UNLICENSED",
6
+ "private": false,
7
+ "type": "module",
8
+ "bin": {
9
+ "security-review-mcp": "dist/bin/security-review-mcp.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "README.md"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc -p tsconfig.json",
17
+ "clean": "rm -rf dist",
18
+ "prepare": "npm run build",
19
+ "start": "node dist/bin/security-review-mcp.js",
20
+ "typecheck": "tsc -p tsconfig.json --noEmit"
21
+ },
22
+ "engines": {
23
+ "node": ">=18"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "dependencies": {
29
+ "@modelcontextprotocol/sdk": "^1.26.0",
30
+ "zod": "^4.3.6"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "^25.2.3",
34
+ "typescript": "^5.9.3"
35
+ }
36
+ }