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

@@ -39,6 +39,12 @@ 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:

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;