mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-18 02:54:12 +02:00
* 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
17 lines
582 B
TypeScript
17 lines
582 B
TypeScript
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
import { registerSimplePrompt } from "./simple.js";
|
|
import { registerComplexPrompt } from "./complex.js";
|
|
import { registerPromptWithCompletions } from "./completions.js";
|
|
import { registerEmbeddedResourcePrompt } from "./resource.js"
|
|
|
|
/**
|
|
* Register the prompts with the MCP server.
|
|
* @param server
|
|
*/
|
|
export const registerPrompts = (server: McpServer) => {
|
|
registerSimplePrompt(server);
|
|
registerComplexPrompt(server);
|
|
registerPromptWithCompletions(server);
|
|
registerEmbeddedResourcePrompt(server);
|
|
};
|