mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-26 02:36:03 +02:00
Merge remote-tracking branch 'origin/main' into ochafik/everything-structuredContent
This commit is contained in:
@@ -196,7 +196,7 @@ Add the configuration to your user-level MCP configuration file. Open the Comman
|
||||
**Method 2: Workspace Configuration**
|
||||
Alternatively, you can add the configuration to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others.
|
||||
|
||||
> For more details about MCP configuration in VS Code, see the [official VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/mcp).
|
||||
> For more details about MCP configuration in VS Code, see the [official VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/customization/mcp-servers).
|
||||
|
||||
#### NPX
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
ServerRequest,
|
||||
SubscribeRequestSchema,
|
||||
Tool,
|
||||
ToolSchema,
|
||||
UnsubscribeRequestSchema,
|
||||
type Root
|
||||
} from "@modelcontextprotocol/sdk/types.js";
|
||||
@@ -35,11 +34,8 @@ const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
const instructions = readFileSync(join(__dirname, "instructions.md"), "utf-8");
|
||||
|
||||
const ToolInputSchema = ToolSchema.shape.inputSchema;
|
||||
type ToolInput = z.infer<typeof ToolInputSchema>;
|
||||
|
||||
const ToolOutputSchema = ToolSchema.shape.outputSchema;
|
||||
type ToolOutput = z.infer<typeof ToolOutputSchema>;
|
||||
type ToolInput = Tool["inputSchema"];
|
||||
type ToolOutput = Tool["outputSchema"];
|
||||
|
||||
type SendRequest = RequestHandlerExtra<ServerRequest, ServerNotification>["sendRequest"];
|
||||
|
||||
@@ -621,7 +617,7 @@ export const createServer = () => {
|
||||
);
|
||||
return {
|
||||
content: [
|
||||
{ type: "text", text: `LLM sampling result: ${result.content.text}` },
|
||||
{ type: "text", text: `LLM sampling result: ${Array.isArray(result.content) ? result.content.map(c => c.type === "text" ? c.text : JSON.stringify(c)).join("") : (result.content.type === "text" ? result.content.text : JSON.stringify(result.content))}` },
|
||||
],
|
||||
};
|
||||
}
|
||||
@@ -738,23 +734,23 @@ export const createServer = () => {
|
||||
type: 'object',
|
||||
properties: {
|
||||
name: {
|
||||
title: 'Full Name',
|
||||
title: 'String',
|
||||
type: 'string',
|
||||
description: 'Your full, legal name',
|
||||
},
|
||||
check: {
|
||||
title: 'Agree to terms',
|
||||
title: 'Boolean',
|
||||
type: 'boolean',
|
||||
description: 'A boolean check',
|
||||
description: 'Agree to the terms and conditions',
|
||||
},
|
||||
color: {
|
||||
title: 'Favorite Color',
|
||||
firstLine: {
|
||||
title: 'String with default',
|
||||
type: 'string',
|
||||
description: 'Favorite color (open text)',
|
||||
default: 'blue',
|
||||
description: 'Favorite first line of a story',
|
||||
default: 'It was a dark and stormy night.',
|
||||
},
|
||||
email: {
|
||||
title: 'Email Address',
|
||||
title: 'String with email format',
|
||||
type: 'string',
|
||||
format: 'email',
|
||||
description: 'Your email address (will be verified, and never shared with anyone else)',
|
||||
@@ -762,16 +758,17 @@ export const createServer = () => {
|
||||
homepage: {
|
||||
type: 'string',
|
||||
format: 'uri',
|
||||
description: 'Homepage / personal site',
|
||||
title: 'String with uri format',
|
||||
description: 'Portfolio / personal website',
|
||||
},
|
||||
birthdate: {
|
||||
title: 'Birthdate',
|
||||
title: 'String with date format',
|
||||
type: 'string',
|
||||
format: 'date',
|
||||
description: 'Your date of birth (will never be shared with anyone else)',
|
||||
description: 'Your date of birth',
|
||||
},
|
||||
integer: {
|
||||
title: 'Favorite Integer',
|
||||
title: 'Integer',
|
||||
type: 'integer',
|
||||
description: 'Your favorite integer (do not give us your phone number, pin, or other sensitive info)',
|
||||
minimum: 1,
|
||||
@@ -779,21 +776,63 @@ export const createServer = () => {
|
||||
default: 42,
|
||||
},
|
||||
number: {
|
||||
title: 'Favorite Number',
|
||||
title: 'Number in range 1-1000',
|
||||
type: 'number',
|
||||
description: 'Favorite number (there are no wrong answers)',
|
||||
minimum: 0,
|
||||
maximum: 1000,
|
||||
default: 3.14,
|
||||
},
|
||||
petType: {
|
||||
title: 'Pet type',
|
||||
untitledSingleSelectEnum: {
|
||||
type: 'string',
|
||||
enum: ['cats', 'dogs', 'birds', 'fish', 'reptiles'],
|
||||
enumNames: ['Cats', 'Dogs', 'Birds', 'Fish', 'Reptiles'],
|
||||
default: 'dogs',
|
||||
description: 'Your favorite pet type',
|
||||
title: 'Untitled Single Select Enum',
|
||||
description: 'Choose your favorite friend',
|
||||
enum: ['Monica', 'Rachel', 'Joey', 'Chandler', 'Ross', 'Phoebe'],
|
||||
default: 'Monica'
|
||||
},
|
||||
untitledMultipleSelectEnum: {
|
||||
type: 'array',
|
||||
title: 'Untitled Multiple Select Enum',
|
||||
description: 'Choose your favorite instruments',
|
||||
minItems: 1,
|
||||
maxItems: 3,
|
||||
items: { type: 'string', enum: ['Guitar', 'Piano', 'Violin', 'Drums', 'Bass'] },
|
||||
default: ['Guitar']
|
||||
},
|
||||
titledSingleSelectEnum: {
|
||||
type: 'string',
|
||||
title: 'Titled Single Select Enum',
|
||||
description: 'Choose your favorite hero',
|
||||
oneOf: [
|
||||
{ const: 'hero-1', title: 'Superman' },
|
||||
{ const: 'hero-2', title: 'Green Lantern' },
|
||||
{ const: 'hero-3', title: 'Wonder Woman' }
|
||||
],
|
||||
default: 'hero-1'
|
||||
},
|
||||
titledMultipleSelectEnum: {
|
||||
type: 'array',
|
||||
title: 'Titled Multiple Select Enum',
|
||||
description: 'Choose your favorite types of fish',
|
||||
minItems: 1,
|
||||
maxItems: 3,
|
||||
items: {
|
||||
anyOf: [
|
||||
{ const: 'fish-1', title: 'Tuna' },
|
||||
{ const: 'fish-2', title: 'Salmon' },
|
||||
{ const: 'fish-3', title: 'Trout' }
|
||||
]
|
||||
},
|
||||
default: ['fish-1']
|
||||
},
|
||||
legacyTitledEnum: {
|
||||
type: 'string',
|
||||
title: 'Legacy Titled Single Select Enum',
|
||||
description: 'Choose your favorite type of pet',
|
||||
enum: ['pet-1', 'pet-2', 'pet-3', 'pet-4', 'pet-5'],
|
||||
enumNames: ['Cats', 'Dogs', 'Birds', 'Fish', 'Reptiles'],
|
||||
default: 'pet-1',
|
||||
}
|
||||
},
|
||||
required: ['name'],
|
||||
},
|
||||
|
||||
@@ -3,9 +3,14 @@
|
||||
"version": "0.6.2",
|
||||
"description": "MCP server that exercises all the features of the MCP protocol",
|
||||
"license": "MIT",
|
||||
"mcpName": "io.github.modelcontextprotocol/server-everything",
|
||||
"author": "Anthropic, PBC (https://anthropic.com)",
|
||||
"homepage": "https://modelcontextprotocol.io",
|
||||
"bugs": "https://github.com/modelcontextprotocol/servers/issues",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/modelcontextprotocol/servers.git"
|
||||
},
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"mcp-server-everything": "dist/index.js"
|
||||
@@ -22,16 +27,16 @@
|
||||
"start:streamableHttp": "node dist/streamableHttp.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.19.1",
|
||||
"@modelcontextprotocol/sdk": "^1.24.0",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.21.1",
|
||||
"express": "^5.2.1",
|
||||
"jszip": "^3.10.1",
|
||||
"zod": "^3.23.8",
|
||||
"zod": "^3.25.0",
|
||||
"zod-to-json-schema": "^3.23.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cors": "^2.8.19",
|
||||
"@types/express": "^5.0.0",
|
||||
"@types/express": "^5.0.6",
|
||||
"shx": "^0.3.4",
|
||||
"typescript": "^5.6.2"
|
||||
}
|
||||
|
||||
@@ -9,14 +9,18 @@ async function main() {
|
||||
const transport = new StdioServerTransport();
|
||||
const {server, cleanup, startNotificationIntervals} = createServer();
|
||||
|
||||
// Cleanup when client disconnects
|
||||
server.onclose = async () => {
|
||||
await cleanup();
|
||||
process.exit(0);
|
||||
};
|
||||
|
||||
await server.connect(transport);
|
||||
startNotificationIntervals();
|
||||
|
||||
// Cleanup on exit
|
||||
process.on("SIGINT", async () => {
|
||||
await cleanup();
|
||||
await server.close();
|
||||
process.exit(0);
|
||||
await server.close();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user