systemprompt-mcp-core
Version:
A specialized Model Context Protocol (MCP) server that integrates with systemprompt.io to provide powerful prompt management capabilities. This server enables seamless creation, management, and versioning of system prompts and agents through MCP. It works
37 lines • 1.43 kB
JavaScript
import { SystemPromptService } from "../services/systemprompt-service.js";
import { mapPromptsToListPromptsResult, mapBlocksToListResourcesResult, } from "../utils/mcp-mappers.js";
import { server } from "../server.js";
export async function sendPromptChangedNotification() {
const service = SystemPromptService.getInstance();
const prompts = await service.getAllPrompts();
const notification = {
method: "notifications/prompts/list_changed",
params: mapPromptsToListPromptsResult(prompts),
};
await sendNotification(notification);
}
export async function sendResourceChangedNotification() {
const service = SystemPromptService.getInstance();
const blocks = await service.listBlocks();
const notification = {
method: "notifications/resources/list_changed",
params: mapBlocksToListResourcesResult(blocks),
};
await sendNotification(notification);
}
export async function sendOperationNotification(operation, message) {
const notification = {
method: "notifications/message",
params: {
_meta: {},
message: `Operation ${operation}: ${message}`,
level: "info",
timestamp: new Date().toISOString(),
},
};
await sendNotification(notification);
}
async function sendNotification(notification) {
await server.notification(notification);
}
//# sourceMappingURL=notifications.js.map