@@ -14,9 +14,7 @@ import docsSearchTool from './docs-search-tool';
1414import { McpOptions } from './options' ;
1515import { blockedMethodsForCodeTool } from './methods' ;
1616import { HandlerFunction , McpTool } from './types' ;
17-
18- export { McpOptions } from './options' ;
19- export { ClientOptions } from 'scan-documents' ;
17+ import { readEnv } from './util' ;
2018
2119async function getInstructions ( ) {
2220 // This API key is optional; providing it allows the server to fetch instructions for unreleased versions.
@@ -169,27 +167,3 @@ export async function executeHandler(
169167) {
170168 return await handler ( client , args || { } ) ;
171169}
172-
173- export const readEnv = ( env : string ) : string | undefined => {
174- if ( typeof ( globalThis as any ) . process !== 'undefined' ) {
175- return ( globalThis as any ) . process . env ?. [ env ] ?. trim ( ) ;
176- } else if ( typeof ( globalThis as any ) . Deno !== 'undefined' ) {
177- return ( globalThis as any ) . Deno . env ?. get ?.( env ) ?. trim ( ) ;
178- }
179- return ;
180- } ;
181-
182- export const readEnvOrError = ( env : string ) : string => {
183- let envValue = readEnv ( env ) ;
184- if ( envValue === undefined ) {
185- throw new Error ( `Environment variable ${ env } is not set` ) ;
186- }
187- return envValue ;
188- } ;
189-
190- export const requireValue = < T > ( value : T | undefined , description : string ) : T => {
191- if ( value === undefined ) {
192- throw new Error ( `Missing required value: ${ description } ` ) ;
193- }
194- return value ;
195- } ;
0 commit comments