@@ -40,6 +40,8 @@ const LongRunningOperationSchema = z.object({
40
40
steps : z . number ( ) . default ( 5 ) . describe ( "Number of steps in the operation" ) ,
41
41
} ) ;
42
42
43
+ const PrintEnvSchema = z . object ( { } ) ;
44
+
43
45
const SampleLLMSchema = z . object ( {
44
46
prompt : z . string ( ) . describe ( "The prompt to send to the LLM" ) ,
45
47
maxTokens : z
@@ -54,6 +56,7 @@ enum ToolName {
54
56
ECHO = "echo" ,
55
57
ADD = "add" ,
56
58
LONG_RUNNING_OPERATION = "longRunningOperation" ,
59
+ PRINT_ENV = "printEnv" ,
57
60
SAMPLE_LLM = "sampleLLM" ,
58
61
GET_TINY_IMAGE = "getTinyImage" ,
59
62
}
@@ -297,6 +300,11 @@ export const createServer = () => {
297
300
description : "Adds two numbers" ,
298
301
inputSchema : zodToJsonSchema ( AddSchema ) as ToolInput ,
299
302
} ,
303
+ {
304
+ name : ToolName . PRINT_ENV ,
305
+ description : "Prints all environment variables, helpful for debugging MCP server configuration" ,
306
+ inputSchema : zodToJsonSchema ( PrintEnvSchema ) as ToolInput ,
307
+ } ,
300
308
{
301
309
name : ToolName . LONG_RUNNING_OPERATION ,
302
310
description :
@@ -374,6 +382,17 @@ export const createServer = () => {
374
382
} ;
375
383
}
376
384
385
+ if ( name === ToolName . PRINT_ENV ) {
386
+ return {
387
+ content : [
388
+ {
389
+ type : "text" ,
390
+ text : JSON . stringify ( process . env , null , 2 ) ,
391
+ } ,
392
+ ] ,
393
+ } ;
394
+ }
395
+
377
396
if ( name === ToolName . SAMPLE_LLM ) {
378
397
const validatedArgs = SampleLLMSchema . parse ( args ) ;
379
398
const { prompt, maxTokens } = validatedArgs ;
0 commit comments