Merge branch 'main' into main

This commit is contained in:
Jan Heimes
2024-12-19 18:25:25 +01:00
committed by GitHub
3 changed files with 31 additions and 5 deletions

View File

@@ -105,6 +105,7 @@ A growing set of community-developed and maintained servers demonstrates various
- **[TMDB](https://github.com/Laksh-star/mcp-server-tmdb)** - This MCP server integrates with The Movie Database (TMDB) API to provide movie information, search capabilities, and recommendations. - **[TMDB](https://github.com/Laksh-star/mcp-server-tmdb)** - This MCP server integrates with The Movie Database (TMDB) API to provide movie information, search capabilities, and recommendations.
- **[MongoDB](https://github.com/kiliczsh/mcp-mongo-server)** - A Model Context Protocol Server for MongoDB. - **[MongoDB](https://github.com/kiliczsh/mcp-mongo-server)** - A Model Context Protocol Server for MongoDB.
- **[Airtable](https://github.com/felores/airtable-mcp)** - Airtable Model Context Protocol Server. - **[Airtable](https://github.com/felores/airtable-mcp)** - Airtable Model Context Protocol Server.
- **[Fetch](https://github.com/zcaceres/fetch-mcp)** - A server that flexibly fetches HTML, JSON, Markdown, or plaintext
## 📚 Resources ## 📚 Resources

View File

@@ -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. 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` 2. `add`
- Adds two numbers together - Adds two numbers together
- Inputs: - Inputs:
- `a` (number): First number - `a` (number): First number
- `b` (number): Second number - `b` (number): Second number
- Returns: Text result of the addition - 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 - Returns: Completion message with duration and steps
- Sends progress notifications during execution - Sends progress notifications during execution
4. `sampleLLM` 4. `sampleLLM`
- Demonstrates LLM sampling capability using MCP sampling feature - Demonstrates LLM sampling capability using MCP sampling feature
- Inputs: - Inputs:
- `prompt` (string): The prompt to send to the LLM - `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 - No inputs required
- Returns: Base64 encoded PNG image data - 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 ### Resources
The server provides 100 test resources in two formats: The server provides 100 test resources in two formats:
- Even numbered resources: - Even numbered resources:
- Plaintext format - Plaintext format
- URI pattern: `test://static/resource/{even_number}` - URI pattern: `test://static/resource/{even_number}`
- Content: Simple text description - Content: Simple text description
- Odd numbered resources: - Odd numbered resources:
- Binary blob format - Binary blob format
- URI pattern: `test://static/resource/{odd_number}` - URI pattern: `test://static/resource/{odd_number}`
- Content: Base64 encoded binary data - Content: Base64 encoded binary data
Resource features: Resource features:

View File

@@ -40,6 +40,8 @@ const LongRunningOperationSchema = z.object({
steps: z.number().default(5).describe("Number of steps in the operation"), steps: z.number().default(5).describe("Number of steps in the operation"),
}); });
const PrintEnvSchema = z.object({});
const SampleLLMSchema = z.object({ const SampleLLMSchema = z.object({
prompt: z.string().describe("The prompt to send to the LLM"), prompt: z.string().describe("The prompt to send to the LLM"),
maxTokens: z maxTokens: z
@@ -54,6 +56,7 @@ enum ToolName {
ECHO = "echo", ECHO = "echo",
ADD = "add", ADD = "add",
LONG_RUNNING_OPERATION = "longRunningOperation", LONG_RUNNING_OPERATION = "longRunningOperation",
PRINT_ENV = "printEnv",
SAMPLE_LLM = "sampleLLM", SAMPLE_LLM = "sampleLLM",
GET_TINY_IMAGE = "getTinyImage", GET_TINY_IMAGE = "getTinyImage",
} }
@@ -297,6 +300,11 @@ export const createServer = () => {
description: "Adds two numbers", description: "Adds two numbers",
inputSchema: zodToJsonSchema(AddSchema) as ToolInput, 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, name: ToolName.LONG_RUNNING_OPERATION,
description: 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) { if (name === ToolName.SAMPLE_LLM) {
const validatedArgs = SampleLLMSchema.parse(args); const validatedArgs = SampleLLMSchema.parse(args);
const { prompt, maxTokens } = validatedArgs; const { prompt, maxTokens } = validatedArgs;