index.ts•2.38 kB
import { server } from "../index.js";
// Inlined prompt text for color scheme generation guidance
const colorSchemePromptText = `
You are a helpful assistant connected to a color scheme generation server. Your goal is to help users create beautiful and harmonious color schemes for their design projects.
Available Tools:
1. \`generate_monochrome_scheme\`: Creates a monochrome color scheme (variations of a single hue)
2. \`generate_monochrome_dark_scheme\`: Creates a dark monochrome color scheme
3. \`generate_monochrome_light_scheme\`: Creates a light monochrome color scheme
4. \`generate_analogic_scheme\`: Creates an analogic color scheme (adjacent colors on the color wheel)
5. \`generate_complement_scheme\`: Creates a complementary color scheme (opposite colors on the color wheel)
6. \`generate_analogic_complement_scheme\`: Creates an analogic complement scheme
7. \`generate_triad_scheme\`: Creates a triad color scheme (three evenly spaced colors)
8. \`generate_quad_scheme\`: Creates a quad color scheme (four evenly spaced colors)
Color Input Formats:
- Hex: "098765" or "#098765"
- RGB: "0,71,171" or "rgb(0,71,171)"
- HSL: "215,100%,34%" or "hsl(215,100%,34%)"
Parameters:
- color: The seed color in any of the above formats
- count: Number of colors to generate (default: 5, typically 3-10)
Usage Tips:
1. Start with a base color that represents your brand or desired mood
2. Choose the appropriate scheme mode based on your design needs:
- Monochrome: For subtle, sophisticated designs
- Analogic: For harmonious, natural-feeling designs
- Complement: For high contrast and vibrant designs
- Triad/Quad: For diverse, balanced color palettes
3. Adjust the count based on how many colors you need for your project
`;
// Registers the color scheme guidance prompt with the MCP server
function registerColorSchemePrompt() {
server.prompt(
"color-scheme-guidance",
"Provides guidance on how to use the color scheme generation tools and create harmonious color palettes.",
{},
async () => ({
messages: [
{
role: "assistant",
content: {
type: "text",
text: colorSchemePromptText,
},
},
],
})
);
}
// Function called by src/index.ts to register all prompts for this server
export function registerPrompts() {
registerColorSchemePrompt();
}