mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-18 02:54:12 +02:00
Finalized Roots list changed handling and initial request. Final fit and finish work.
* Updated architecture.md
- Added links to other docs
- Refactor/extracted sections into extension.md, features.md, how-it-works.md, startup.md, and structure.md
* Removed everything.ts
- all features are ported
* In roots.ts
- refactor/renaned setRootsListChangedHandler to syncRoots
- refactor handler logic to requestRoots function
- Calls for roots list directly to get initial list
* In server/index.ts
- import setRootsListChangedHandler
- in clientConnected callback
- call setRootsListChangedHandler passing server and sessionId
* In sse.ts, stdio.ts, and streamableHttp.ts
- update inline and function docs
* In index.ts,
- updated usage output
* In server/index.ts
- refactor/extracted readInstructions to resources/index.ts
- defined ServerFactoryResponse response type
964 B
964 B
Everything Server - Extension Points
Architecture | Project Structure | Startup Process | Server Features | Extension Points | How It Works
Adding Tools
- Create a new file under
tools/with yourregisterXTool(server)function that registers the tool viaserver.registerTool(...). - Export and call it from
tools/index.tsinsideregisterTools(server).
Adding Prompts
- Create a new file under
prompts/with yourregisterXPrompt(server)function that registers the prompt viaserver.registerPrompt(...). - Export and call it from
prompts/index.tsinsideregisterPrompts(server).
Adding Resources
- Create a new file under
resources/with yourregisterXResources(server)function usingserver.registerResource(...)(optionally withResourceTemplate). - Export and call it from
resources/index.tsinsideregisterResources(server).