Skip to content

Commit 9082003

Browse files
authored
Merge branch 'main' into patch-2
2 parents 423579f + 926d86c commit 9082003

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

src/everything/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Everything MCP Server
1+
# Everything MCP Server
22

33
This MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.
44

@@ -15,7 +15,7 @@ This MCP server attempts to exercise all the features of the MCP protocol. It is
1515
2. `add`
1616
- Adds two numbers together
1717
- Inputs:
18-
- `a` (number): First number
18+
- `a` (number): First number
1919
- `b` (number): Second number
2020
- Returns: Text result of the addition
2121

@@ -27,7 +27,7 @@ This MCP server attempts to exercise all the features of the MCP protocol. It is
2727
- Returns: Completion message with duration and steps
2828
- Sends progress notifications during execution
2929

30-
4. `sampleLLM`
30+
4. `sampleLLM`
3131
- Demonstrates LLM sampling capability using MCP sampling feature
3232
- Inputs:
3333
- `prompt` (string): The prompt to send to the LLM
@@ -39,17 +39,23 @@ This MCP server attempts to exercise all the features of the MCP protocol. It is
3939
- No inputs required
4040
- Returns: Base64 encoded PNG image data
4141

42+
6. `printEnv`
43+
- Prints all environment variables
44+
- Useful for debugging MCP server configuration
45+
- No inputs required
46+
- Returns: JSON string of all environment variables
47+
4248
### Resources
4349

4450
The server provides 100 test resources in two formats:
45-
- Even numbered resources:
51+
- Even numbered resources:
4652
- Plaintext format
4753
- URI pattern: `test://static/resource/{even_number}`
4854
- Content: Simple text description
4955

5056
- Odd numbered resources:
5157
- Binary blob format
52-
- URI pattern: `test://static/resource/{odd_number}`
58+
- URI pattern: `test://static/resource/{odd_number}`
5359
- Content: Base64 encoded binary data
5460

5561
Resource features:

src/everything/everything.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
4345
const 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

Comments
 (0)