Loading...
Loading...
Loading...
// Expose a static resource
server.resource(
"config://app/settings",
"Application settings",
async (uri) => ({
contents: [{
uri: uri.href,
mimeType: "application/json",
text: JSON.stringify({ theme: "dark", lang: "en" }),
}],
})
);
// Define a prompt template
server.prompt(
"code_review",
"Review code for best practices",
[{ name: "code", description: "The code to review", required: true }],
async ({ code }) => ({
messages: [{
role: "user",
content: {
type: "text",
text: `Please review this code:\n\n${code}\n\nFocus on security, performance, and readability.`,
},
}],
})
);