[WIP] Refactor everything server to be more modular and use recommended APIs.

* Updated docs

* Refactor/renamed toggle-logging.ts to toggle-simulated-logging.ts
  - refactor/renamed registerToggleLoggingTool to registerToggleSimulatedLoggingTool
This commit is contained in:
cliffhall
2025-12-13 10:59:35 -05:00
parent 19e588bdcb
commit f561f70002
5 changed files with 15 additions and 18 deletions

View File

@@ -19,7 +19,7 @@
- `get-sum` (tools/get-sum.ts): For two numbers `a` and `b` calculates and returns their sum. Uses Zod to validate inputs.
- `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.
- `long-running-operation` (tools/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.
- `toggle-logging` (tools/toggle-logging.ts): Starts or stops simulated, randomleveled logging for the invoking session. Respects the clients selected minimum logging level.
- `toggle-simulated-logging` (tools/toggle-simulated-logging.ts): Starts or stops simulated, randomleveled logging for the invoking session. Respects the clients selected minimum logging level.
- `toggle-subscriber-updates` (tools/toggle-subscriber-updates.ts): Starts or stops simulated resource update notifications for URIs the invoking session has subscribed to.
- `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 LLMs response payload.
@@ -47,5 +47,5 @@
## Simulated Logging
- Simulated logging is available but off by default.
- Use the `toggle-logging` tool to start/stop periodic log messages of varying levels (debug, info, notice, warning, error, critical, alert, emergency) per session.
- 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.
- Clients can control the minimum level they receive via the standard MCP `logging/setLevel` request.