We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40b2e37 commit f06717cCopy full SHA for f06717c
packages/mcp-server/src/server.ts
@@ -146,3 +146,10 @@ export const readEnvOrError = (env: string): string => {
146
}
147
return envValue;
148
};
149
+
150
+export const requireValue = <T>(value: T | undefined, description: string): T => {
151
+ if (value === undefined) {
152
+ throw new Error(`Missing required value: ${description}`);
153
+ }
154
+ return value;
155
+};
0 commit comments