mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-19 16:43:24 +02:00
[WIP] Refactor everything server to be more modular and use recommended APIs.
* Adding prompts (simple, complex, with completions)
* Add prompts/simple.ts
- in addSimplePrompt()
- register a simple prompt with no arguments
* Add prompts/complex.ts
- in addComplexPrompt()
- define promptArgsSchema containing a required city arg of type string and an optional state arg of type state
- register the complex prompt with a prompt callback that combines the city and state into a prompt asking for the weather in that location
* Add prompts/completions.ts
- in addPromptWithCompletions()
- define promptArgsSchema containing department and name string fields with completion handlers
- register the completable prompt with a prompt callback that combines the inputs into a prompt asking to promote the selected name to head of the selected department
* Add prompts/index.ts
- import addSimplePrompt, addComplexPrompt, and addPromptWithCompletions
- export registerPrompts function
- in registerPrompts()
- call addSimplePrompt
- call addComplexPrompt
- call addPromptWithCompletions
* 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
This commit is contained in:
14
src/everything/prompts/index.ts
Normal file
14
src/everything/prompts/index.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { addSimplePrompt } from "./simple.js";
|
||||
import { addComplexPrompt } from "./complex.js";
|
||||
import { addPromptWithCompletions } from "./completions.js";
|
||||
|
||||
/**
|
||||
* Register the prompts with the MCP server.
|
||||
* @param server
|
||||
*/
|
||||
export const registerPrompts = (server: McpServer) => {
|
||||
addSimplePrompt(server);
|
||||
addComplexPrompt(server);
|
||||
addPromptWithCompletions(server);
|
||||
};
|
||||
Reference in New Issue
Block a user