@modelcontextprotocol/server-everything 2026.1.14 → 2026.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -1
- package/dist/__tests__/prompts.test.js +131 -0
- package/dist/__tests__/registrations.test.js +121 -0
- package/dist/__tests__/resources.test.js +240 -0
- package/dist/__tests__/server.test.js +31 -0
- package/dist/__tests__/tools.test.js +904 -0
- package/dist/docs/features.md +55 -2
- package/dist/docs/structure.md +18 -6
- package/dist/resources/session.js +15 -1
- package/dist/server/index.js +21 -1
- package/dist/server/roots.js +1 -5
- package/dist/tools/echo.js +6 -0
- package/dist/tools/get-annotated-message.js +6 -0
- package/dist/tools/get-env.js +6 -0
- package/dist/tools/get-resource-links.js +6 -0
- package/dist/tools/get-resource-reference.js +6 -0
- package/dist/tools/get-roots-list.js +6 -0
- package/dist/tools/get-structured-content.js +6 -0
- package/dist/tools/get-sum.js +6 -0
- package/dist/tools/get-tiny-image.js +6 -0
- package/dist/tools/gzip-file-as-resource.js +6 -1
- package/dist/tools/index.js +10 -0
- package/dist/tools/simulate-research-query.js +248 -0
- package/dist/tools/toggle-simulated-logging.js +6 -0
- package/dist/tools/toggle-subscriber-updates.js +6 -0
- package/dist/tools/trigger-elicitation-request-async.js +206 -0
- package/dist/tools/trigger-elicitation-request.js +7 -1
- package/dist/tools/trigger-long-running-operation.js +6 -0
- package/dist/tools/trigger-sampling-request-async.js +172 -0
- package/dist/tools/trigger-sampling-request.js +6 -0
- package/dist/tools/trigger-url-elicitation.js +169 -0
- package/dist/transports/streamableHttp.js +23 -2
- package/dist/vitest.config.js +13 -0
- package/package.json +10 -8
package/dist/docs/features.md
CHANGED
|
@@ -19,10 +19,15 @@
|
|
|
19
19
|
- `get-structured-content` (tools/get-structured-content.ts): Demonstrates structured responses. Accepts `location` input and returns both backward‑compatible `content` (a `text` block containing JSON) and `structuredContent` validated by an `outputSchema` (temperature, conditions, humidity).
|
|
20
20
|
- `get-sum` (tools/get-sum.ts): For two numbers `a` and `b` calculates and returns their sum. Uses Zod to validate inputs.
|
|
21
21
|
- `get-tiny-image` (tools/get-tiny-image.ts): Returns a tiny PNG MCP logo as an `image` content item with brief descriptive text before and after.
|
|
22
|
-
- `trigger-long-running-operation` (tools/trigger-
|
|
22
|
+
- `trigger-long-running-operation` (tools/trigger-long-running-operation.ts): Simulates a multi-step operation over a given `duration` and number of `steps`; reports progress via `notifications/progress` when a `progressToken` is provided by the client.
|
|
23
23
|
- `toggle-simulated-logging` (tools/toggle-simulated-logging.ts): Starts or stops simulated, random‑leveled logging for the invoking session. Respects the client’s selected minimum logging level.
|
|
24
24
|
- `toggle-subscriber-updates` (tools/toggle-subscriber-updates.ts): Starts or stops simulated resource update notifications for URIs the invoking session has subscribed to.
|
|
25
|
-
- `trigger-
|
|
25
|
+
- `trigger-elicitation-request` (tools/trigger-elicitation-request.ts): Issues an `elicitation/create` request using form-mode fields (strings, numbers, booleans, enums, and format validation) and returns the resulting action/content.
|
|
26
|
+
- `trigger-url-elicitation` (tools/trigger-url-elicitation.ts): Issues an `elicitation/create` request in URL mode (`mode: "url"`) with an `elicitationId`, or throws MCP error `-32042` (`UrlElicitationRequiredError`) when `errorPath=true`. On the error path the prerequisite elicitation it returns points at a different URL than the failing request (`https://modelcontextprotocol.io`); when the client satisfies it and retries the same call, the retry ignores `errorPath` and proceeds via the request path, so the client does not loop on the same error. The retry marker is one-shot per `(session, url, elicitationId)`: it is cleared on the recognized retry, so re-running the error path with identical arguments without an intervening prerequisite is treated as a retry and proceeds. Requires client capability `elicitation.url`.
|
|
27
|
+
- `trigger-sampling-request` (tools/trigger-sampling-request.ts): Issues a `sampling/createMessage` request to the client/LLM using provided `prompt` and optional generation controls; returns the LLM's response payload.
|
|
28
|
+
- `simulate-research-query` (tools/simulate-research-query.ts): Demonstrates MCP Tasks (SEP-1686) with a simulated multi-stage research operation. Accepts `topic` and `ambiguous` parameters. Returns a task that progresses through stages with status updates. If `ambiguous` is true and client supports elicitation, sends an elicitation request directly to gather clarification before completing.
|
|
29
|
+
- `trigger-sampling-request-async` (tools/trigger-sampling-request-async.ts): Demonstrates bidirectional tasks where the server sends a sampling request that the client executes as a background task. Server polls for status and retrieves the LLM result when complete. Requires client to support `tasks.requests.sampling.createMessage`.
|
|
30
|
+
- `trigger-elicitation-request-async` (tools/trigger-elicitation-request-async.ts): Demonstrates bidirectional tasks where the server sends an elicitation request that the client executes as a background task. Server polls while waiting for user input. Requires client to support `tasks.requests.elicitation.create`.
|
|
26
31
|
|
|
27
32
|
## Prompts
|
|
28
33
|
|
|
@@ -50,3 +55,51 @@
|
|
|
50
55
|
- Simulated logging is available but off by default.
|
|
51
56
|
- Use the `toggle-simulated-logging` tool to start/stop periodic log messages of varying levels (debug, info, notice, warning, error, critical, alert, emergency) per session.
|
|
52
57
|
- Clients can control the minimum level they receive via the standard MCP `logging/setLevel` request.
|
|
58
|
+
|
|
59
|
+
## Tasks (SEP-1686)
|
|
60
|
+
|
|
61
|
+
The server advertises support for MCP Tasks, enabling long-running operations with status tracking:
|
|
62
|
+
|
|
63
|
+
- **Capabilities advertised**: `tasks.list`, `tasks.cancel`, `tasks.requests.tools.call`
|
|
64
|
+
- **Task Store**: Uses `InMemoryTaskStore` from SDK experimental for task lifecycle management
|
|
65
|
+
- **Message Queue**: Uses `InMemoryTaskMessageQueue` for task-related messaging
|
|
66
|
+
|
|
67
|
+
### Task Lifecycle
|
|
68
|
+
|
|
69
|
+
1. Client calls `tools/call` with `task: true` parameter
|
|
70
|
+
2. Server returns `CreateTaskResult` with `taskId` instead of immediate result
|
|
71
|
+
3. Client polls `tasks/get` to check status and receive `statusMessage` updates
|
|
72
|
+
4. When status is `completed`, client calls `tasks/result` to retrieve the final result
|
|
73
|
+
|
|
74
|
+
### Task Statuses
|
|
75
|
+
|
|
76
|
+
- `working`: Task is actively processing
|
|
77
|
+
- `input_required`: Task needs additional input (server sends elicitation request directly)
|
|
78
|
+
- `completed`: Task finished successfully
|
|
79
|
+
- `failed`: Task encountered an error
|
|
80
|
+
- `cancelled`: Task was cancelled by client
|
|
81
|
+
|
|
82
|
+
### Demo Tools
|
|
83
|
+
|
|
84
|
+
**Server-side tasks (client calls server):**
|
|
85
|
+
Use the `simulate-research-query` tool to exercise the full task lifecycle. Set `ambiguous: true` to trigger elicitation - the server will send an `elicitation/create` request directly and await the response before completing.
|
|
86
|
+
|
|
87
|
+
**Client-side tasks (server calls client):**
|
|
88
|
+
Use `trigger-sampling-request-async` or `trigger-elicitation-request-async` to demonstrate bidirectional tasks where the server sends requests that the client executes as background tasks. These require the client to advertise `tasks.requests.sampling.createMessage` or `tasks.requests.elicitation.create` capabilities respectively.
|
|
89
|
+
|
|
90
|
+
### Bidirectional Task Flow
|
|
91
|
+
|
|
92
|
+
MCP Tasks are bidirectional - both server and client can be task executors:
|
|
93
|
+
|
|
94
|
+
| Direction | Request Type | Task Executor | Demo Tool |
|
|
95
|
+
| ---------------- | ------------------------ | ------------- | ----------------------------------- |
|
|
96
|
+
| Client -> Server | `tools/call` | Server | `simulate-research-query` |
|
|
97
|
+
| Server -> Client | `sampling/createMessage` | Client | `trigger-sampling-request-async` |
|
|
98
|
+
| Server -> Client | `elicitation/create` | Client | `trigger-elicitation-request-async` |
|
|
99
|
+
|
|
100
|
+
For client-side tasks:
|
|
101
|
+
|
|
102
|
+
1. Server sends request with task metadata (e.g., `params.task.ttl`)
|
|
103
|
+
2. Client creates task and returns `CreateTaskResult` with `taskId`
|
|
104
|
+
3. Server polls `tasks/get` for status updates
|
|
105
|
+
4. When complete, server calls `tasks/result` to retrieve the result
|
package/dist/docs/structure.md
CHANGED
|
@@ -48,11 +48,15 @@ src/everything
|
|
|
48
48
|
│ ├── get-sum.ts
|
|
49
49
|
│ ├── get-tiny-image.ts
|
|
50
50
|
│ ├── gzip-file-as-resource.ts
|
|
51
|
+
│ ├── simulate-research-query.ts
|
|
51
52
|
│ ├── toggle-simulated-logging.ts
|
|
52
53
|
│ ├── toggle-subscriber-updates.ts
|
|
53
54
|
│ ├── trigger-elicitation-request.ts
|
|
55
|
+
│ ├── trigger-elicitation-request-async.ts
|
|
54
56
|
│ ├── trigger-long-running-operation.ts
|
|
55
|
-
│
|
|
57
|
+
│ ├── trigger-sampling-request.ts
|
|
58
|
+
│ ├── trigger-sampling-request-async.ts
|
|
59
|
+
│ └── trigger-url-elicitation.ts
|
|
56
60
|
└── transports
|
|
57
61
|
├── sse.ts
|
|
58
62
|
├── stdio.ts
|
|
@@ -82,8 +86,8 @@ src/everything
|
|
|
82
86
|
|
|
83
87
|
- `architecture.md`
|
|
84
88
|
- This document.
|
|
85
|
-
- `
|
|
86
|
-
- Human‑readable instructions intended to be passed to the client/LLM as
|
|
89
|
+
- `instructions.md`
|
|
90
|
+
- Human‑readable instructions intended to be passed to the client/LLM as guidance on server use. Loaded by the server at startup and returned in the initialize exchange.
|
|
87
91
|
|
|
88
92
|
### `prompts/`
|
|
89
93
|
|
|
@@ -129,7 +133,7 @@ src/everything
|
|
|
129
133
|
- `echo.ts`
|
|
130
134
|
- Registers an `echo` tool that takes a message and returns `Echo: {message}`.
|
|
131
135
|
- `get-annotated-message.ts`
|
|
132
|
-
- Registers
|
|
136
|
+
- Registers a `get-annotated-message` tool which demonstrates content-level annotations. Emits a primary `text` message with content `annotations` (`priority`, `audience`) that vary by `messageType` (`"error" | "success" | "debug"`), and optionally includes an annotated `image` (tiny PNG) when `includeImage` is true. All tools in this server include tool-level annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`).
|
|
133
137
|
- `get-env.ts`
|
|
134
138
|
- Registers a `get-env` tool that returns the current process environment variables as formatted JSON text; useful for debugging configuration.
|
|
135
139
|
- `get-resource-links.ts`
|
|
@@ -147,18 +151,26 @@ src/everything
|
|
|
147
151
|
- `GZIP_MAX_FETCH_SIZE` (bytes, default 10 MiB)
|
|
148
152
|
- `GZIP_MAX_FETCH_TIME_MILLIS` (ms, default 30000)
|
|
149
153
|
- `GZIP_ALLOWED_DOMAINS` (comma-separated allowlist; empty means all domains allowed)
|
|
154
|
+
- `simulate-research-query.ts`
|
|
155
|
+
- Registers a `simulate-research-query` task-based tool that demonstrates the MCP Tasks feature (SEP-1686). Simulates a multi-stage research operation with progress updates. If the query is marked as ambiguous and the client supports elicitation, it pauses mid-execution to request clarification via `elicitation/create`. Uses `server.experimental.tasks.registerToolTask()` with `execution: { taskSupport: "required" }`.
|
|
150
156
|
- `trigger-elicitation-request.ts`
|
|
151
157
|
- Registers a `trigger-elicitation-request` tool that sends an `elicitation/create` request to the client/LLM and returns the elicitation result.
|
|
158
|
+
- `trigger-url-elicitation.ts`
|
|
159
|
+
- Registers a `trigger-url-elicitation` tool that either sends an out-of-band URL-mode `elicitation/create` request (`mode: "url"`) including an `elicitationId` (request path) or throws `UrlElicitationRequiredError` (`-32042`) for client-handled URL elicitation (error path). On the error path the carried prerequisite elicitation points at a different URL than the failing one (`https://modelcontextprotocol.io`), and when the client satisfies it and retries the same call, the retry ignores `errorPath` and proceeds via the request path — so the client does not loop on the same error.
|
|
160
|
+
- `trigger-elicitation-request-async.ts`
|
|
161
|
+
- Registers a `trigger-elicitation-request-async` tool that demonstrates bidirectional MCP tasks for elicitation. Sends an elicitation request with task metadata, then polls the client's `tasks/get` endpoint for completion status before fetching the final result.
|
|
152
162
|
- `trigger-sampling-request.ts`
|
|
153
163
|
- Registers a `trigger-sampling-request` tool that sends a `sampling/createMessage` request to the client/LLM and returns the sampling result.
|
|
164
|
+
- `trigger-sampling-request-async.ts`
|
|
165
|
+
- Registers a `trigger-sampling-request-async` tool that demonstrates bidirectional MCP tasks for sampling. Sends a sampling request with task metadata, then polls the client's `tasks/get` endpoint for completion status before fetching the final result.
|
|
154
166
|
- `get-structured-content.ts`
|
|
155
167
|
- Registers a `get-structured-content` tool that demonstrates structuredContent block responses.
|
|
156
168
|
- `get-sum.ts`
|
|
157
|
-
- Registers
|
|
169
|
+
- Registers a `get-sum` tool with a Zod input schema that sums two numbers `a` and `b` and returns the result.
|
|
158
170
|
- `get-tiny-image.ts`
|
|
159
171
|
- Registers a `get-tiny-image` tool, which returns a tiny PNG MCP logo as an `image` content item, along with surrounding descriptive `text` items.
|
|
160
172
|
- `trigger-long-running-operation.ts`
|
|
161
|
-
- Registers a `long-running-operation` tool that simulates a long-running task over a specified `duration` (seconds) and number of `steps`; emits `notifications/progress` updates when the client supplies a `progressToken`.
|
|
173
|
+
- Registers a `trigger-long-running-operation` tool that simulates a long-running task over a specified `duration` (seconds) and number of `steps`; emits `notifications/progress` updates when the client supplies a `progressToken`.
|
|
162
174
|
- `toggle-simulated-logging.ts`
|
|
163
175
|
- Registers a `toggle-simulated-logging` tool, which starts or stops simulated logging for the invoking session.
|
|
164
176
|
- `toggle-subscriber-updates.ts`
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks registered session resources by URI to allow updating/removing on re-registration.
|
|
3
|
+
* This prevents "Resource already registered" errors when a tool creates a resource
|
|
4
|
+
* with the same URI multiple times during a session.
|
|
5
|
+
*/
|
|
6
|
+
const registeredResources = new Map();
|
|
1
7
|
/**
|
|
2
8
|
* Generates a session-scoped resource URI string based on the provided resource name.
|
|
3
9
|
*
|
|
@@ -34,11 +40,19 @@ export const registerSessionResource = (server, resource, type, payload) => {
|
|
|
34
40
|
mimeType,
|
|
35
41
|
blob: payload,
|
|
36
42
|
};
|
|
43
|
+
// Check if a resource with this URI is already registered and remove it
|
|
44
|
+
const existingResource = registeredResources.get(uri);
|
|
45
|
+
if (existingResource) {
|
|
46
|
+
existingResource.remove();
|
|
47
|
+
registeredResources.delete(uri);
|
|
48
|
+
}
|
|
37
49
|
// Register file resource
|
|
38
|
-
server.registerResource(name, uri, { mimeType, description, title, annotations, icons, _meta }, async (
|
|
50
|
+
const registeredResource = server.registerResource(name, uri, { mimeType, description, title, annotations, icons, _meta }, async () => {
|
|
39
51
|
return {
|
|
40
52
|
contents: [resourceContent],
|
|
41
53
|
};
|
|
42
54
|
});
|
|
55
|
+
// Track the registered resource for potential future removal
|
|
56
|
+
registeredResources.set(uri, registeredResource);
|
|
43
57
|
return { type: "resource_link", ...resource };
|
|
44
58
|
};
|
package/dist/server/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { InMemoryTaskStore, InMemoryTaskMessageQueue, } from "@modelcontextprotocol/sdk/experimental/tasks";
|
|
2
3
|
import { setSubscriptionHandlers, stopSimulatedResourceUpdates, } from "../resources/subscriptions.js";
|
|
3
4
|
import { registerConditionalTools, registerTools } from "../tools/index.js";
|
|
4
5
|
import { registerResources, readInstructions } from "../resources/index.js";
|
|
@@ -21,6 +22,10 @@ import { syncRoots } from "./roots.js";
|
|
|
21
22
|
export const createServer = () => {
|
|
22
23
|
// Read the server instructions
|
|
23
24
|
const instructions = readInstructions();
|
|
25
|
+
// Create task store and message queue for task support
|
|
26
|
+
const taskStore = new InMemoryTaskStore();
|
|
27
|
+
const taskMessageQueue = new InMemoryTaskMessageQueue();
|
|
28
|
+
let initializeTimeout = null;
|
|
24
29
|
// Create the server
|
|
25
30
|
const server = new McpServer({
|
|
26
31
|
name: "mcp-servers/everything",
|
|
@@ -39,8 +44,19 @@ export const createServer = () => {
|
|
|
39
44
|
listChanged: true,
|
|
40
45
|
},
|
|
41
46
|
logging: {},
|
|
47
|
+
tasks: {
|
|
48
|
+
list: {},
|
|
49
|
+
cancel: {},
|
|
50
|
+
requests: {
|
|
51
|
+
tools: {
|
|
52
|
+
call: {},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
42
56
|
},
|
|
43
57
|
instructions,
|
|
58
|
+
taskStore,
|
|
59
|
+
taskMessageQueue,
|
|
44
60
|
});
|
|
45
61
|
// Register the tools
|
|
46
62
|
registerTools(server);
|
|
@@ -59,7 +75,7 @@ export const createServer = () => {
|
|
|
59
75
|
// This is delayed until after the `notifications/initialized` handler finishes,
|
|
60
76
|
// otherwise, the request gets lost.
|
|
61
77
|
const sessionId = server.server.transport?.sessionId;
|
|
62
|
-
setTimeout(() => syncRoots(server, sessionId), 350);
|
|
78
|
+
initializeTimeout = setTimeout(() => syncRoots(server, sessionId), 350);
|
|
63
79
|
};
|
|
64
80
|
// Return the ServerFactoryResponse
|
|
65
81
|
return {
|
|
@@ -68,6 +84,10 @@ export const createServer = () => {
|
|
|
68
84
|
// Stop any simulated logging or resource updates that may have been initiated.
|
|
69
85
|
stopSimulatedLogging(sessionId);
|
|
70
86
|
stopSimulatedResourceUpdates(sessionId);
|
|
87
|
+
// Clean up task store timers
|
|
88
|
+
taskStore.cleanup();
|
|
89
|
+
if (initializeTimeout)
|
|
90
|
+
clearTimeout(initializeTimeout);
|
|
71
91
|
},
|
|
72
92
|
};
|
|
73
93
|
};
|
package/dist/server/roots.js
CHANGED
|
@@ -48,11 +48,7 @@ export const syncRoots = async (server, sessionId) => {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
catch (error) {
|
|
51
|
-
|
|
52
|
-
level: "error",
|
|
53
|
-
logger: "everything-server",
|
|
54
|
-
data: `Failed to request roots from client: ${error instanceof Error ? error.message : String(error)}`,
|
|
55
|
-
}, sessionId);
|
|
51
|
+
console.error(`Failed to request roots from client ${sessionId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
56
52
|
}
|
|
57
53
|
};
|
|
58
54
|
// If the roots have not been synced for this client,
|
package/dist/tools/echo.js
CHANGED
|
@@ -9,6 +9,12 @@ const config = {
|
|
|
9
9
|
title: "Echo Tool",
|
|
10
10
|
description: "Echoes back the input string",
|
|
11
11
|
inputSchema: EchoSchema,
|
|
12
|
+
annotations: {
|
|
13
|
+
readOnlyHint: true,
|
|
14
|
+
destructiveHint: false,
|
|
15
|
+
idempotentHint: true,
|
|
16
|
+
openWorldHint: false,
|
|
17
|
+
},
|
|
12
18
|
};
|
|
13
19
|
/**
|
|
14
20
|
* Registers the 'echo' tool.
|
|
@@ -16,6 +16,12 @@ const config = {
|
|
|
16
16
|
title: "Get Annotated Message Tool",
|
|
17
17
|
description: "Demonstrates how annotations can be used to provide metadata about content.",
|
|
18
18
|
inputSchema: GetAnnotatedMessageSchema,
|
|
19
|
+
annotations: {
|
|
20
|
+
readOnlyHint: true, // This tool only returns data, no side effects
|
|
21
|
+
destructiveHint: false, // Does not delete or modify anything
|
|
22
|
+
idempotentHint: true, // Same input always produces same output
|
|
23
|
+
openWorldHint: false, // Does not interact with external systems
|
|
24
|
+
},
|
|
19
25
|
};
|
|
20
26
|
/**
|
|
21
27
|
* Registers the 'get-annotated-message' tool.
|
package/dist/tools/get-env.js
CHANGED
|
@@ -4,6 +4,12 @@ const config = {
|
|
|
4
4
|
title: "Print Environment Tool",
|
|
5
5
|
description: "Returns all environment variables, helpful for debugging MCP server configuration",
|
|
6
6
|
inputSchema: {},
|
|
7
|
+
annotations: {
|
|
8
|
+
readOnlyHint: true,
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
idempotentHint: true,
|
|
11
|
+
openWorldHint: false,
|
|
12
|
+
},
|
|
7
13
|
};
|
|
8
14
|
/**
|
|
9
15
|
* Registers the 'get-env' tool.
|
|
@@ -15,6 +15,12 @@ const config = {
|
|
|
15
15
|
title: "Get Resource Links Tool",
|
|
16
16
|
description: "Returns up to ten resource links that reference different types of resources",
|
|
17
17
|
inputSchema: GetResourceLinksSchema,
|
|
18
|
+
annotations: {
|
|
19
|
+
readOnlyHint: true,
|
|
20
|
+
destructiveHint: false,
|
|
21
|
+
idempotentHint: true,
|
|
22
|
+
openWorldHint: false,
|
|
23
|
+
},
|
|
18
24
|
};
|
|
19
25
|
/**
|
|
20
26
|
* Registers the 'get-resource-reference' tool.
|
|
@@ -16,6 +16,12 @@ const config = {
|
|
|
16
16
|
title: "Get Resource Reference Tool",
|
|
17
17
|
description: "Returns a resource reference that can be used by MCP clients",
|
|
18
18
|
inputSchema: GetResourceReferenceSchema,
|
|
19
|
+
annotations: {
|
|
20
|
+
readOnlyHint: true,
|
|
21
|
+
destructiveHint: false,
|
|
22
|
+
idempotentHint: true,
|
|
23
|
+
openWorldHint: false,
|
|
24
|
+
},
|
|
19
25
|
};
|
|
20
26
|
/**
|
|
21
27
|
* Registers the 'get-resource-reference' tool.
|
|
@@ -5,6 +5,12 @@ const config = {
|
|
|
5
5
|
title: "Get Roots List Tool",
|
|
6
6
|
description: "Lists the current MCP roots provided by the client. Demonstrates the roots protocol capability even though this server doesn't access files.",
|
|
7
7
|
inputSchema: {},
|
|
8
|
+
annotations: {
|
|
9
|
+
readOnlyHint: true,
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
idempotentHint: true,
|
|
12
|
+
openWorldHint: false,
|
|
13
|
+
},
|
|
8
14
|
};
|
|
9
15
|
/**
|
|
10
16
|
* Registers the 'get-roots-list' tool.
|
|
@@ -18,6 +18,12 @@ const config = {
|
|
|
18
18
|
description: "Returns structured content along with an output schema for client data validation",
|
|
19
19
|
inputSchema: GetStructuredContentInputSchema,
|
|
20
20
|
outputSchema: GetStructuredContentOutputSchema,
|
|
21
|
+
annotations: {
|
|
22
|
+
readOnlyHint: true,
|
|
23
|
+
destructiveHint: false,
|
|
24
|
+
idempotentHint: true,
|
|
25
|
+
openWorldHint: false,
|
|
26
|
+
},
|
|
21
27
|
};
|
|
22
28
|
/**
|
|
23
29
|
* Registers the 'get-structured-content' tool.
|
package/dist/tools/get-sum.js
CHANGED
|
@@ -10,6 +10,12 @@ const config = {
|
|
|
10
10
|
title: "Get Sum Tool",
|
|
11
11
|
description: "Returns the sum of two numbers",
|
|
12
12
|
inputSchema: GetSumSchema,
|
|
13
|
+
annotations: {
|
|
14
|
+
readOnlyHint: true,
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
idempotentHint: true,
|
|
17
|
+
openWorldHint: false,
|
|
18
|
+
},
|
|
13
19
|
};
|
|
14
20
|
/**
|
|
15
21
|
* Registers the 'get-sum' tool.
|
|
@@ -6,6 +6,12 @@ const config = {
|
|
|
6
6
|
title: "Get Tiny Image Tool",
|
|
7
7
|
description: "Returns a tiny MCP logo image.",
|
|
8
8
|
inputSchema: {},
|
|
9
|
+
annotations: {
|
|
10
|
+
readOnlyHint: true,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
idempotentHint: true,
|
|
13
|
+
openWorldHint: false,
|
|
14
|
+
},
|
|
9
15
|
};
|
|
10
16
|
/**
|
|
11
17
|
* Registers the "get-tiny-image" tool.
|
|
@@ -14,7 +14,6 @@ const GZIP_ALLOWED_DOMAINS = (process.env.GZIP_ALLOWED_DOMAINS ?? "")
|
|
|
14
14
|
const GZipFileAsResourceSchema = z.object({
|
|
15
15
|
name: z.string().describe("Name of the output file").default("README.md.gz"),
|
|
16
16
|
data: z
|
|
17
|
-
.string()
|
|
18
17
|
.url()
|
|
19
18
|
.describe("URL or data URI of the file content to compress")
|
|
20
19
|
.default("https://raw.githubusercontent.com/modelcontextprotocol/servers/refs/heads/main/README.md"),
|
|
@@ -29,6 +28,12 @@ const config = {
|
|
|
29
28
|
title: "GZip File as Resource Tool",
|
|
30
29
|
description: "Compresses a single file using gzip compression. Depending upon the selected output type, returns either the compressed data as a gzipped resource or a resource link, allowing it to be downloaded in a subsequent request during the current session.",
|
|
31
30
|
inputSchema: GZipFileAsResourceSchema,
|
|
31
|
+
annotations: {
|
|
32
|
+
readOnlyHint: false,
|
|
33
|
+
destructiveHint: false,
|
|
34
|
+
idempotentHint: true,
|
|
35
|
+
openWorldHint: true,
|
|
36
|
+
},
|
|
32
37
|
};
|
|
33
38
|
/**
|
|
34
39
|
* Registers the `gzip-file-as-resource` tool.
|
package/dist/tools/index.js
CHANGED
|
@@ -13,6 +13,10 @@ import { registerToggleSubscriberUpdatesTool } from "./toggle-subscriber-updates
|
|
|
13
13
|
import { registerTriggerElicitationRequestTool } from "./trigger-elicitation-request.js";
|
|
14
14
|
import { registerTriggerLongRunningOperationTool } from "./trigger-long-running-operation.js";
|
|
15
15
|
import { registerTriggerSamplingRequestTool } from "./trigger-sampling-request.js";
|
|
16
|
+
import { registerTriggerSamplingRequestAsyncTool } from "./trigger-sampling-request-async.js";
|
|
17
|
+
import { registerTriggerElicitationRequestAsyncTool } from "./trigger-elicitation-request-async.js";
|
|
18
|
+
import { registerSimulateResearchQueryTool } from "./simulate-research-query.js";
|
|
19
|
+
import { registerTriggerUrlElicitationTool } from "./trigger-url-elicitation.js";
|
|
16
20
|
/**
|
|
17
21
|
* Register the tools with the MCP server.
|
|
18
22
|
* @param server
|
|
@@ -38,5 +42,11 @@ export const registerTools = (server) => {
|
|
|
38
42
|
export const registerConditionalTools = (server) => {
|
|
39
43
|
registerGetRootsListTool(server);
|
|
40
44
|
registerTriggerElicitationRequestTool(server);
|
|
45
|
+
registerTriggerUrlElicitationTool(server);
|
|
41
46
|
registerTriggerSamplingRequestTool(server);
|
|
47
|
+
// Task-based research tool (uses experimental tasks API)
|
|
48
|
+
registerSimulateResearchQueryTool(server);
|
|
49
|
+
// Bidirectional task tools - server sends requests that client executes as tasks
|
|
50
|
+
registerTriggerSamplingRequestAsyncTool(server);
|
|
51
|
+
registerTriggerElicitationRequestAsyncTool(server);
|
|
42
52
|
};
|