@vengtoo/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,14 @@
1
+ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
2
+ import type { ServerConfig } from "./types";
3
+ export interface DiscoveredTool {
4
+ qualifiedName: string;
5
+ server: string;
6
+ originalName: string;
7
+ description: string;
8
+ inputFields: string[];
9
+ }
10
+ export declare function extractFields(schema: unknown): string[];
11
+ export declare function discoverTools(name: string, cfg: ServerConfig): Promise<{
12
+ tools: DiscoveredTool[];
13
+ transport: StdioClientTransport;
14
+ }>;
package/dist/utils.js ADDED
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.discoverTools = exports.extractFields = void 0;
4
+ const index_js_1 = require("@modelcontextprotocol/sdk/client/index.js");
5
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/client/stdio.js");
6
+ function extractFields(schema) {
7
+ if (typeof schema === "object" &&
8
+ schema !== null &&
9
+ "properties" in schema) {
10
+ return Object.keys(schema.properties);
11
+ }
12
+ return [];
13
+ }
14
+ exports.extractFields = extractFields;
15
+ async function discoverTools(name, cfg) {
16
+ const transport = new stdio_js_1.StdioClientTransport({
17
+ command: cfg.command,
18
+ args: cfg.args,
19
+ env: { ...process.env, ...(cfg.env ?? {}) },
20
+ });
21
+ const client = new index_js_1.Client({ name: `vengtoo-gateway/${name}`, version: "0.1.0" }, { capabilities: {} });
22
+ await client.connect(transport);
23
+ const { tools } = await client.listTools();
24
+ const discovered = tools.map((t) => ({
25
+ qualifiedName: `${name}__${t.name}`,
26
+ server: name,
27
+ originalName: t.name,
28
+ description: t.description ?? "",
29
+ inputFields: extractFields(t.inputSchema),
30
+ }));
31
+ return { tools: discovered, transport };
32
+ }
33
+ exports.discoverTools = discoverTools;
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@vengtoo/mcp-gateway",
3
+ "version": "0.1.0",
4
+ "mcpName": "io.github.authzx/mcp-gateway",
5
+ "description": "Vengtoo MCP Gateway — policy-enforcing proxy between AI agents and MCP servers",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "vengtoo-mcp-gateway": "dist/cli.js"
10
+ },
11
+ "scripts": {
12
+ "build": "tsc",
13
+ "dev": "tsx src/cli.ts",
14
+ "prepublishOnly": "npm run build"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "keywords": [
20
+ "vengtoo",
21
+ "mcp",
22
+ "gateway",
23
+ "authorization",
24
+ "ai-agent"
25
+ ],
26
+ "license": "Apache-2.0",
27
+ "dependencies": {
28
+ "@modelcontextprotocol/sdk": "^1.29.0"
29
+ },
30
+ "devDependencies": {
31
+ "@types/node": "^20.0.0",
32
+ "tsx": "^4.0.0",
33
+ "typescript": "~5.4.0"
34
+ },
35
+ "engines": {
36
+ "node": ">=18"
37
+ }
38
+ }