@sonoma-security/mcp-gateway 0.1.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.
@@ -0,0 +1,47 @@
1
+ /**
2
+ * MCP Gateway Types
3
+ */
4
+ export interface McpServerConfig {
5
+ /** Server name (unique identifier) */
6
+ name: string;
7
+ /** Command to spawn the server */
8
+ command: string;
9
+ /** Arguments to pass to the command */
10
+ args?: string[];
11
+ /** Environment variables */
12
+ env?: Record<string, string>;
13
+ /** Working directory */
14
+ cwd?: string;
15
+ /** Package name for policy matching (e.g., @anthropic/mcp-server-time) */
16
+ packageName?: string;
17
+ }
18
+ export interface GatewayConfig {
19
+ /** Upstream MCP servers to proxy */
20
+ servers: McpServerConfig[];
21
+ /** Sonoma API endpoint (optional, for telemetry/policy) */
22
+ sonomaEndpoint?: string;
23
+ /** Org API key for device-level auth (from MDM config or SONOMA_API_KEY env) */
24
+ sonomaApiKey?: string;
25
+ /** Enable debug logging */
26
+ debug?: boolean;
27
+ }
28
+ export interface ToolCallEvent {
29
+ serverName: string;
30
+ toolName: string;
31
+ timestamp: string;
32
+ durationMs: number;
33
+ status: "success" | "error" | "blocked";
34
+ errorMessage?: string;
35
+ argumentKeys?: string[];
36
+ }
37
+ export interface UpstreamServer {
38
+ config: McpServerConfig;
39
+ tools: Map<string, ToolInfo>;
40
+ }
41
+ export interface ToolInfo {
42
+ name: string;
43
+ description?: string;
44
+ inputSchema?: unknown;
45
+ serverName: string;
46
+ }
47
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,wBAAwB;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB"}
package/dist/types.js ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * MCP Gateway Types
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@sonoma-security/mcp-gateway",
3
+ "version": "0.1.0",
4
+ "description": "Local MCP gateway for tool-level visibility and enforcement",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Sonoma <team@sonoma.dev>",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/sonoma-security/sonoma",
11
+ "directory": "packages/mcp-gateway"
12
+ },
13
+ "keywords": ["mcp", "model-context-protocol", "gateway", "ai", "tools", "visibility"],
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "bin": {
17
+ "sonoma-mcp-gateway": "./dist/cli.js"
18
+ },
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "import": "./dist/index.js"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "!dist/__tests__",
28
+ "README.md"
29
+ ],
30
+ "scripts": {
31
+ "build": "tsc",
32
+ "prepublishOnly": "bun run build",
33
+ "dev": "echo 'mcp-gateway is a CLI tool - run with: bun run src/cli.ts --help'",
34
+ "test": "vitest run",
35
+ "typecheck": "tsc --noEmit"
36
+ },
37
+ "dependencies": {
38
+ "@modelcontextprotocol/sdk": "^1.24.0"
39
+ },
40
+ "devDependencies": {
41
+ "@types/node": "^22.15.29"
42
+ }
43
+ }