Skip to content

Commit b605944

Browse files
committed
fix: publish config
Signed-off-by: sunrabbit123 <[email protected]>
1 parent 1e7f4a9 commit b605944

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

src/cli.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2-
32
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
43
import { program } from "commander";
54

65
import { createServer } from "./server";
76
import { startSSEServer } from "./sse";
8-
import { connectMcp, McpConnection } from ".";
7+
8+
import type { McpConnection } from ".";
9+
10+
import { connectMcp } from ".";
911

1012
export function buildCli<T extends string>(props: { version: string; name: string; mcpServers: Record<T, McpConnection>; env: Record<string, T> }) {
1113
return program

src/index.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ export async function bundler<T extends string>(props: Props<T>): Promise<{
5757
};
5858
}
5959

60+
/**
61+
* Extracts the environment variables from the name.
62+
*
63+
* @param name - The name of the MCP server.
64+
* @param env - The environment variables. { ENV_KEY: "ENV_TARGET" }
65+
* ENV_TARGET is the target environment variable name, so example: "slack", "notion", "github", etc.
66+
* @param envMapper - The environment variable mapper. { ENV_KEY: "ENV_VALUE" }
67+
* ENV_VALUE is the value of the environment variable, so example: "gh_12309wqje123", "nt_12309wqje123", etc.
68+
* @returns The environment variables.
69+
*/
70+
function extractEnvFromName(name: string, env: Record<string, string>, envMapper: Record<string, string>) {
71+
return Object.fromEntries(Object.entries(env).filter(([, value]) => value === name).map(([key]) => [key, envMapper[key]]));
72+
}
6073
/**
6174
* Connects to the MCP servers and returns the client transport.
6275
*
@@ -99,17 +112,3 @@ export async function connectMcp(props: {
99112
await props.adapter.connect(transport);
100113
}
101114
}
102-
103-
/**
104-
* Extracts the environment variables from the name.
105-
*
106-
* @param name - The name of the MCP server.
107-
* @param env - The environment variables. { ENV_KEY: "ENV_TARGET" }
108-
* ENV_TARGET is the target environment variable name, so example: "slack", "notion", "github", etc.
109-
* @param envMapper - The environment variable mapper. { ENV_KEY: "ENV_VALUE" }
110-
* ENV_VALUE is the value of the environment variable, so example: "gh_12309wqje123", "nt_12309wqje123", etc.
111-
* @returns The environment variables.
112-
*/
113-
const extractEnvFromName = (name: string, env: Record<string, string>, envMapper: Record<string, string>) => {
114-
return Object.fromEntries(Object.entries(env).filter(([, value]) => value === name).map(([key]) => [key, envMapper[key]]));
115-
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
/* Module Resolution Options */
1616
"moduleResolution": "bundler", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
17-
"types": ["node", "vitest/globals"],
17+
"types": ["node"],
1818
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
1919

2020
/* Strict Type-Checking Options */

0 commit comments

Comments
 (0)