Architecture | Project Structure | Startup Process | Server Features | Extension Points | How It Works
echo(tools/echo.ts): Echoes the providedmessage: string. Uses Zod to validate inputs.get-annotated-message(tools/get-annotated-message.ts): Returns atextmessage annotated withpriorityandaudiencebased onmessageType(error,success, ordebug); can optionally include an annotatedimage.get-env(tools/get-env.ts): Returns all environment variables from the running process as pretty-printed JSON text.get-resource-links(tools/get-resource-links.ts): Returns an introtextblock followed by multipleresource_linkitems. For a requestedcount(1–10), alternates between dynamic Text and Blob resources using URIs fromresources/templates.ts.get-resource-reference(tools/get-resource-reference.ts): AcceptsresourceType(textorblob) andresourceId(positive integer). Returns a concreteresourcecontent block (with itsuri,mimeType, and data) with surrounding explanatorytext.get-roots-list(tools/get-roots-list.ts): Returns the last list of roots sent by the client.gzip-file-as-resource(tools/gzip-file-as-resource.ts): Accepts anameanddata(URL or data URI), fetches the data subject to size/time/domain constraints, compresses it, registers it as a session resource atdemo://resource/session/<name>withmimeType: application/gzip, and returns either aresource_link(default) or an inlineresourcedepending onoutputType.get-structured-content(tools/get-structured-content.ts): Demonstrates structured responses. Acceptslocationinput and returns both backward‑compatiblecontent(atextblock containing JSON) andstructuredContentvalidated by anoutputSchema(temperature, conditions, humidity).get-sum(tools/get-sum.ts): For two numbersaandbcalculates and returns their sum. Uses Zod to validate inputs.get-tiny-image(tools/get-tiny-image.ts): Returns a tiny PNG MCP logo as animagecontent item with brief descriptive text before and after.trigger-long-running-operation(tools/trigger-trigger-long-running-operation.ts): Simulates a multi-step operation over a givendurationand number ofsteps; reports progress vianotifications/progresswhen aprogressTokenis provided by the client.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.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 asampling/createMessagerequest to the client/LLM using providedpromptand optional generation controls; returns the LLM’s response payload.
simple-prompt(prompts/simple.ts): No-argument prompt that returns a static user message.args-prompt(prompts/args.ts): Two-argument prompt withcity(required) andstate(optional) used to compose a question.completable-prompt(prompts/completions.ts): Demonstrates argument auto-completions with the SDK’scompletablehelper;departmentcompletions drive context-awarenamesuggestions.resource-prompt(prompts/resource.ts): AcceptsresourceType("Text" or "Blob") andresourceId(string convertible to integer) and returns messages that include an embedded dynamic resource of the selected type generated viaresources/templates.ts.
- Dynamic Text:
demo://resource/dynamic/text/{index}(content generated on the fly) - Dynamic Blob:
demo://resource/dynamic/blob/{index}(base64 payload generated on the fly) - Static Documents:
demo://resource/static/document/<filename>(serves files fromsrc/everything/docs/as static file-based resources) - Session Scoped:
demo://resource/session/<name>(per-session resources registered dynamically; available only for the lifetime of the session)
- Simulated update notifications are opt‑in and off by default.
- Clients may subscribe/unsubscribe to resource URIs using the MCP
resources/subscribeandresources/unsubscriberequests. - Use the
toggle-subscriber-updatestool to start/stop a per‑session interval that emitsnotifications/resources/updated { uri }only for URIs that session has subscribed to. - Multiple concurrent clients are supported; each client’s subscriptions are tracked per session and notifications are delivered independently via the server instance associated with that session.
- Simulated logging is available but off by default.
- Use the
toggle-simulated-loggingtool 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/setLevelrequest.