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
201 lines • 5.7 kB
JavaScript
import { SystempromptPromptRequestSchema, SystempromptBlockRequestSchema, SystempromptAgentRequestSchema, } from "../schemas/generated/index.js";
import { AGENT_CREATOR_INSTRUCTIONS, AGENT_EDITOR_INSTRUCTIONS, BLOCK_CREATOR_INSTRUCTIONS, BLOCK_EDITOR_INSTRUCTIONS, PROMPT_CREATOR_INSTRUCTIONS, PROMPT_EDITOR_INSTRUCTIONS } from "./instructions.js";
const promptArgs = [
{
name: "userInstructions",
description: "Instructions for creating/editing the resource",
required: true,
},
];
// Prompt Creation Prompt
export const CREATE_PROMPT_PROMPT = {
name: "CreatePrompt",
description: "Creates a new systemprompt prompt based on user instructions",
arguments: promptArgs,
messages: [
{
role: "assistant",
content: {
type: "text",
text: PROMPT_CREATOR_INSTRUCTIONS,
},
},
{
role: "user",
content: {
type: "text",
text: `<input><userInstructions>{{userInstructions}}</userInstructions></input>`,
},
},
],
_meta: {
responseSchema: SystempromptPromptRequestSchema,
callback: "create_prompt",
},
};
// Prompt Edit Prompt
export const EDIT_PROMPT_PROMPT = {
name: "EditPrompt",
description: "Modifies an existing systemprompt prompt based on user instructions",
arguments: promptArgs,
messages: [
{
role: "assistant",
content: {
type: "text",
text: PROMPT_EDITOR_INSTRUCTIONS,
},
},
{
role: "user",
content: {
type: "text",
text: `<input><userInstructions>{{userInstructions}}</userInstructions></input>`,
},
},
],
_meta: {
responseSchema: SystempromptPromptRequestSchema,
callback: "edit_prompt",
},
};
// Block Creation Prompt
export const CREATE_BLOCK_PROMPT = {
name: "CreateBlock",
description: "Creates a new systemprompt block based on user instructions",
arguments: promptArgs,
messages: [
{
role: "assistant",
content: {
type: "text",
text: BLOCK_CREATOR_INSTRUCTIONS,
},
},
{
role: "user",
content: {
type: "text",
text: `<input><userInstructions>{{userInstructions}}</userInstructions></input>`,
},
},
],
_meta: {
responseSchema: SystempromptBlockRequestSchema,
callback: "create_block",
},
};
// TODO
// export const EXECUTE_PROMPT_PROMPT: SamplingPrompt = {
// name: "ExecutePrompt",
// description: "Executes a prompt and returns the result",
// arguments: promptArgs,
// messages: [
// {
// role: "assistant",
// content: {
// type: "text",
// text: EXECUTE_PROMPT_INSTRUCTIONS,
// },
// },
// {
// role: "user",
// content: {
// type: "text",
// text: `<input><userInstructions>{{userInstructions}}</userInstructions></input>`,
// },
// },
// ],
// _meta: {
// responseSchema: SystempromptBlockRequestSchema,
// callback: "create_block",
// },
// };
// Block Edit Prompt
export const EDIT_BLOCK_PROMPT = {
name: "EditBlock",
description: "Modifies an existing systemprompt block based on user instructions",
arguments: promptArgs,
messages: [
{
role: "assistant",
content: {
type: "text",
text: BLOCK_EDITOR_INSTRUCTIONS,
},
},
{
role: "user",
content: {
type: "text",
text: `<input><userInstructions>{{userInstructions}}</userInstructions></input>`,
},
},
],
_meta: {
responseSchema: SystempromptBlockRequestSchema,
callback: "edit_block",
},
};
// Agent Creation Prompt
export const CREATE_AGENT_PROMPT = {
name: "CreateAgent",
description: "Creates a new systemprompt agent based on user instructions",
arguments: promptArgs,
messages: [
{
role: "assistant",
content: {
type: "text",
text: AGENT_CREATOR_INSTRUCTIONS,
},
},
{
role: "user",
content: {
type: "text",
text: `<input><userInstructions>{{userInstructions}}</userInstructions></input>`,
},
},
],
_meta: {
responseSchema: SystempromptAgentRequestSchema,
callback: "create_agent",
},
};
// Agent Edit Prompt
export const EDIT_AGENT_PROMPT = {
name: "EditAgent",
description: "Modifies an existing systemprompt agent based on user instructions",
arguments: promptArgs,
messages: [
{
role: "assistant",
content: {
type: "text",
text: AGENT_EDITOR_INSTRUCTIONS,
},
},
{
role: "user",
content: {
type: "text",
text: `<input><userInstructions>{{userInstructions}}</userInstructions></input>`,
},
},
],
_meta: {
responseSchema: SystempromptAgentRequestSchema,
callback: "edit_agent",
},
};
// Export all prompts
export const PROMPTS = [
CREATE_PROMPT_PROMPT,
EDIT_PROMPT_PROMPT,
CREATE_BLOCK_PROMPT,
EDIT_BLOCK_PROMPT,
CREATE_AGENT_PROMPT,
EDIT_AGENT_PROMPT,
];
//# sourceMappingURL=sampling-prompts.js.map