@@ -40,6 +40,8 @@ const LongRunningOperationSchema = z.object({
4040 steps : z . number ( ) . default ( 5 ) . describe ( "Number of steps in the operation" ) ,
4141} ) ;
4242
43+ const PrintEnvSchema = z . object ( { } ) ;
44+
4345const SampleLLMSchema = z . object ( {
4446 prompt : z . string ( ) . describe ( "The prompt to send to the LLM" ) ,
4547 maxTokens : z
@@ -54,6 +56,7 @@ enum ToolName {
5456 ECHO = "echo" ,
5557 ADD = "add" ,
5658 LONG_RUNNING_OPERATION = "longRunningOperation" ,
59+ PRINT_ENV = "printEnv" ,
5760 SAMPLE_LLM = "sampleLLM" ,
5861 GET_TINY_IMAGE = "getTinyImage" ,
5962}
@@ -297,6 +300,11 @@ export const createServer = () => {
297300 description : "Adds two numbers" ,
298301 inputSchema : zodToJsonSchema ( AddSchema ) as ToolInput ,
299302 } ,
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+ } ,
300308 {
301309 name : ToolName . LONG_RUNNING_OPERATION ,
302310 description :
@@ -374,6 +382,17 @@ export const createServer = () => {
374382 } ;
375383 }
376384
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+
377396 if ( name === ToolName . SAMPLE_LLM ) {
378397 const validatedArgs = SampleLLMSchema . parse ( args ) ;
379398 const { prompt, maxTokens } = validatedArgs ;
0 commit comments