mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-19 20:54:20 +02:00
[WIP] Refactor everything server to be more modular and use recommended APIs.
* Updated architecture.md
* Refactor/renamed resources/dynamic.ts to resources/template.ts
- refactor/renamed registerDynamicResources to registerResourceTemplates
- this highlights the more salient fact that we are demonstrating registration of resource templates in this example.
- exposed the ability to dynamically create the text resources from elsewhere (namely the resource-prompt example
* Added prompts/resource.ts
- in registerEmbeddedResourcePrompt()
- register a prompt that takes a resourceId and returns the prompt with the corresponding dynamically created resource embedded
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { registerDynamicResources } from "./dynamic.js";
|
||||
import { registerResourceTemplates } from "./template.js";
|
||||
import { registerStaticResources } from "./static.js";
|
||||
|
||||
/**
|
||||
@@ -7,6 +7,6 @@ import { registerStaticResources } from "./static.js";
|
||||
* @param server
|
||||
*/
|
||||
export const registerResources = (server: McpServer) => {
|
||||
registerDynamicResources(server);
|
||||
registerResourceTemplates(server);
|
||||
registerStaticResources(server);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user