mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2024-12-22 18:16:52 +03:00
Merge branch 'main' into patch-2
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Everything MCP Server
|
||||
# Everything MCP Server
|
||||
|
||||
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.
|
||||
|
||||
@@ -15,7 +15,7 @@ This MCP server attempts to exercise all the features of the MCP protocol. It is
|
||||
2. `add`
|
||||
- Adds two numbers together
|
||||
- Inputs:
|
||||
- `a` (number): First number
|
||||
- `a` (number): First number
|
||||
- `b` (number): Second number
|
||||
- Returns: Text result of the addition
|
||||
|
||||
@@ -27,7 +27,7 @@ This MCP server attempts to exercise all the features of the MCP protocol. It is
|
||||
- Returns: Completion message with duration and steps
|
||||
- Sends progress notifications during execution
|
||||
|
||||
4. `sampleLLM`
|
||||
4. `sampleLLM`
|
||||
- Demonstrates LLM sampling capability using MCP sampling feature
|
||||
- Inputs:
|
||||
- `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
|
||||
- No inputs required
|
||||
- Returns: Base64 encoded PNG image data
|
||||
|
||||
6. `printEnv`
|
||||
- Prints all environment variables
|
||||
- Useful for debugging MCP server configuration
|
||||
- No inputs required
|
||||
- Returns: JSON string of all environment variables
|
||||
|
||||
### Resources
|
||||
|
||||
The server provides 100 test resources in two formats:
|
||||
- Even numbered resources:
|
||||
- Even numbered resources:
|
||||
- Plaintext format
|
||||
- URI pattern: `test://static/resource/{even_number}`
|
||||
- Content: Simple text description
|
||||
|
||||
- Odd numbered resources:
|
||||
- Binary blob format
|
||||
- URI pattern: `test://static/resource/{odd_number}`
|
||||
- URI pattern: `test://static/resource/{odd_number}`
|
||||
- Content: Base64 encoded binary data
|
||||
|
||||
Resource features:
|
||||
|
||||
@@ -40,6 +40,8 @@ const LongRunningOperationSchema = z.object({
|
||||
steps: z.number().default(5).describe("Number of steps in the operation"),
|
||||
});
|
||||
|
||||
const PrintEnvSchema = z.object({});
|
||||
|
||||
const SampleLLMSchema = z.object({
|
||||
prompt: z.string().describe("The prompt to send to the LLM"),
|
||||
maxTokens: z
|
||||
@@ -54,6 +56,7 @@ enum ToolName {
|
||||
ECHO = "echo",
|
||||
ADD = "add",
|
||||
LONG_RUNNING_OPERATION = "longRunningOperation",
|
||||
PRINT_ENV = "printEnv",
|
||||
SAMPLE_LLM = "sampleLLM",
|
||||
GET_TINY_IMAGE = "getTinyImage",
|
||||
}
|
||||
@@ -297,6 +300,11 @@ export const createServer = () => {
|
||||
description: "Adds two numbers",
|
||||
inputSchema: zodToJsonSchema(AddSchema) as ToolInput,
|
||||
},
|
||||
{
|
||||
name: ToolName.PRINT_ENV,
|
||||
description: "Prints all environment variables, helpful for debugging MCP server configuration",
|
||||
inputSchema: zodToJsonSchema(PrintEnvSchema) as ToolInput,
|
||||
},
|
||||
{
|
||||
name: ToolName.LONG_RUNNING_OPERATION,
|
||||
description:
|
||||
@@ -374,6 +382,17 @@ export const createServer = () => {
|
||||
};
|
||||
}
|
||||
|
||||
if (name === ToolName.PRINT_ENV) {
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: JSON.stringify(process.env, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
if (name === ToolName.SAMPLE_LLM) {
|
||||
const validatedArgs = SampleLLMSchema.parse(args);
|
||||
const { prompt, maxTokens } = validatedArgs;
|
||||
|
||||
Reference in New Issue
Block a user