* In get-roots-list.ts, query the server's cache of the latest roots from the client and only request the list from the client if it doesn't exist.
* In roots.ts, export the roots map
* In get-roots-list.ts, query the server's cache of the latest roots from the client and only request the list from the client if it doesn't exist.
* In roots.ts, export the roots map
Adding Trigger Elicitation Request and Get Roots List tools
* Updated architecture.md
* Added roots.ts
- tracks roots by sessionId
- setRootsListChangedHandler
- listens for roots changed notification from the client
- updates the roots map by sessionId
- sends log notification or error to the client
* In server/index.ts
- import setRootsListChangedHandler
- in clientConnected callback
- call setRootsListChangedHandler passing server and sessionId
* In sse.ts, stdio.ts, and streamableHttp.ts
- receive clientConnected from server factory
- call clientConnected when server is connected to transport
* Added get-roots-list.ts
- registerGetRootsListTool
- Registers the 'get-roots-list' tool with the given MCP server.
* Added trigger-elicitation-request.ts
- registerTriggerElicitationRequestTool
- registered tool sends an elicitation request that exercises all supported field types
* In tools/index.ts
- imports registerTriggerElicitationRequestTool and registerGetRootsListTool
- in registerTools
- call registerTriggerElicitationRequestTool and registerGetRootsListTool, passing server
* Updated architecture.md
* Refactor/renamed get-sampling-request.ts to trigger-sampling-request.ts
- use trigger instead of get throughout
* In tools/index.ts
- sorted display order
[WIP] Adding Gzip File as Resource tool
* Updated architecture.md
* Added gzip-file-as-resource.ts
- imports getSessionResourceURI and registerSessionResource from session.ts
- exports registerGZipFileAsResourceTool
- the registered tool
- validates the input URI
- fetches the file safely
- compresses it
- creates and registers the resource
- returns resource or resource link
* In tools/index.ts
- import registerGZipFileAsResourceTool
- in registerTools,
- call registerGZipFileAsResourceTool passing server
* Added resources/session.ts
- getSessionResourceURI gets a uri to the specified name
- registerSessionResource registers the session-scoped resource and returns a resource link
For tools where we seek to get some response from the server, renamed as an action, e.g., "Get Sum" rather than "Add" or "Get Annotated Message" rather than "Annotated Message", so that it's clear what the intent of the tool is in a quick review.
* Updated architecture.md
* Refactor/renamed add.ts to get-sum.ts
* Refactor/renamed annotated-message.ts to get-annotated-message.ts
* In tools/index.ts
- sorted presentation order
Adding get-structured-content tool
* Updated architecture.md
* added get-structured-content.ts
- Registers the 'get-structured-content' tool with the provided McpServer instance.
- The registered tool processes incoming arguments using a predefined input schema,
generates structured content with weather information including temperature,
conditions, and humidity, and returns both backward-compatible content blocks
and structured content in the response.
Adding the get-resource-reference and get-resource-reference tools
* Updated architecture.md
* Added get-resource-links.ts
- Registers the 'get-resource-reference' tool with the provided McpServer instance.
- The registered tool retrieves a specified number of resource links and their metadata.
* In get-resource-reference.ts
- fixed tool description
* In tools/index.ts
- import registerGetResourceLinksTool
- in registerTool
- call registerGetResourceLinksTool
Adding the get-resource-reference tool
* Updated architecture.md
* In prompts/resource.ts
- Refactor/extracted the prompt argument completers into exported functions in resources/templates.ts
- Refactor/extracted BLOB_TYPE, TEXT_TYPE, and resourceTypes into exported constants in resources/templates.ts as RESOURCE_TYPE_BLOB, RESOURCE_TYPE_TEXT, and RESOURCE_TYPES
- In resources/templates.ts
- refactor renamed index to resourceId throughout for consistency with prompts and tool references
* Added tools/get-resource-reference.ts
- Registers the 'get-resource-reference' tool with the provided McpServer instance.
- uses enum and number schema for tools to provide resourceType and resourceId arguments. Completables don't work for tool arguments.
- Returns the corresponding dynamic resource
* In tools/index.ts
- imported registerGetResourceReferenceTool
- in registerTools
- called registerGetResourceReferenceTool
Adding the annotated message tool
* Updated architecture.md
* Added annotated-message.ts
- registers a tool that returns a message with annotations on different content types
* In package.json
- updated TS SDK version
Added print-env, and sampling-request tools
* Updated architecture.md
* In tools/index.ts
- import registerPrintEnvTool and registerSamplingRequestTool
- in registerTools
- call registerPrintEnvTool and registerSamplingRequestTool
* Added tools/print-env.ts
- registers a tool that takes no args and returns the environment variables
* Added tools/sampling-request
- registers a tool that
- takes prompt and maxTokens args
- sends client a sampling request
- returns the client response in the result
Added long-running-operation tool and improved comments in all tools
* Updated architecture.md
* In tools/
- add.ts
- echo.ts
- toggle-logging.ts
- toggle-subscriber-updates.ts
- Add better function and inline docs
* Added tools/long-running-operation.ts
- similar implementation as in everything v1
* In tools/index.ts
- import registerLongRunningOperationTool
- in registerTools
- registerLongRunningOperationTool
Added tools to toggle simulated logging and resource updates on and off rather than have them start immediately upon connection
* Updated architecture.md
* In server/index.ts
- remove import of beginSimulatedResourceUpdates and beginSimulatedLogging
- remove clientConnected from createServer factory result
* In tools/index.ts
- import registerToggleLoggingTool and registerToggleSubscriberUpdatesTool
- in registerTools
- call registerToggleLoggingTool and registerToggleSubscriberUpdatesTool
* In logging.ts
- in beginSimulatedLogging
- refactor extract inline interval callback into function sendSimulatedLoggingMessage
- call sendSimulatedLoggingMessage right away to send the first message
- supply sendSimulatedLoggingMessage as interval callback
* In subscriptions.ts
- remove import of Transport
- remove transports map
- in beginSimulatedResourceUpdates()
- change arguments to server and sessionId
- check for the subsUpdateInterval for the session
- remove all transport storage and interaction
- instead use the server to send the notification
- in stopSimulatedResourceUpdates()
- remove management of transports map
* In stdio.ts, sse.ts, and streamableHttp.ts
- remove destructure and calling of clientConnected
* Added tools/toggle-logging.ts
- registers a tool that
- takes no arguments
- tracks clients that have been enabled by session id in a set
- if client isn't enabled,
- calls beginSimulatedLogging
- adds session id to client set
- else
- calls stopSimulatedLogging
- deletes session id from client set
- returns a message explaining what was done including what to expect when logging is enabled
* Added tools/toggle-subscriber-updates.ts
- registers a tool that
- takes no arguments
- tracks clients that have been enabled by session id in a set
- if client isn't enabled,
- calls beginSimulatedResourceUpdates
- adds session id to client set
- else
- calls stopSimulatedResourceUpdates
- deletes session id from client set
- returns a message explaining what was done including what to expect when logging is enabled
* Adding static resources, move server instructions to
the new docs folder, and add code formatting
* Add docs folder
* Add docs/architecture.md which describes the architecture of the project thus far.
* Refactor moved instructions.md to docs/server-instructions.md
* Add resources/static.ts
- in addStaticResources()
- read the file entries from the docs folder
- register each file as a resource (no template), with a readResource function that reads the file and returns it in a contents block with the appropriate mime type and contents
- getMimeType helper function gets the mime type for a filename
- readSafe helper function reads the file synchronously as utf-8 or returns an error string
* Add resources/index.ts
- import addStaticResources
- export registerResources function
- in registerResources()
- call addStaticResources
* In package.json
- add prettier devDependency
- add prettier:check script
- add prettier:fix script
- in build script, copy docs folder to dist
* All other changes were prettier formatting
In src/everything:
* Refactor / move streamableHttp.ts, sse.ts, and stdio.ts to transports/
* Move everything.ts to server/ for reference
* Add server/index.js
- exports the createServer function
- import registerTools from tools/index.js
- in createServer()
- read instructions.md and include in ServerOptions for McpServer constructor
- construct McpServer instead of Server
- call registerTools, passing server
* Add tools/echo.ts
- define EchoSchema
- define tool config
- export addToolEcho function
- in addToolEcho()
- register handler for Echo tool
* Add tools/index.ts
- import addToolEcho
- export registerTools function
- in registerTools()
- call addToolEcho