SP

stevengonsalvez/promptregistry-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

7 stars 6 forks 质量 71 趋势 29

lightweight , file based prompt server for developers

概览

is a lightweight, file-based Model Context Protocol (MCP) prompt server designed for developers. It runs via stdio, making it perfect for local development and integration with CLIs or desktop AI assistants that support MCP. It allows you to manage your prompts in a single directory, keeping your workflow simple and portable. * * All prompts are stored in a single directory. You can control the location with the PROMPT_REGISTRY_PROJECT_DIR environment variable. If not set, prompts are stored in ~/.promptregistry/ in your home directory. * Prompts are simple JSON files – easy to read, edit, and version control. * * Exposes prompts via standard prompts/list (lists all prompts). * Allows prompts to be used via standard prompts/get (applies template variables). * Notifies clients of changes via notifications/prompts/list_changed. * * add_prompt: Add new prompts. * get_prompt_file_content: View the raw JSON of a prompt. * update_prompt: Modify prompts. * delete_prompt: Remove prompts.

README

以下为原文 README 节选,完整内容请查看原文。

Prompt Registry: Your Personal Prompt Registry Server 🏰✍️

MCP Prompt Registry is a lightweight, file-based Model Context Protocol (MCP) prompt server designed for developers. It runs via stdio, making it perfect for local development and integration with CLIs or desktop AI assistants that support MCP. It allows you to manage your prompts in a single directory, keeping your workflow simple and portable.

✨ Features

  • Single Prompt Storage Directory:
    • All prompts are stored in a single directory. You can control the location with the PROMPT_REGISTRY_PROJECT_DIR environment variable. If not set, prompts are stored in ~/.promptregistry/ in your home directory.
  • File-Based: Prompts are simple JSON files – easy to read, edit, and version control.
  • Standard MCP Compliance:
    • Exposes prompts via standard prompts/list (lists all prompts).
    • Allows prompts to be used via standard prompts/get (applies template variables).
    • Notifies clients of changes via notifications/prompts/list_changed.
  • Management via MCP Tools:
    • add_prompt: Add new prompts.
    • get_prompt_file_content: View the raw JSON of a prompt.
    • update_prompt: Modify prompts.
    • delete_prompt: Remove prompts.
    • filter_prompts_by_tags: Discover prompts by tags.
  • Stdio Interface: Communicates over standard input/output, ideal for local tools.
  • Template Variables: Supports {{variable_name}} syntax in prompt content.
  • Zod Schema Validation: Robust validation for tool arguments.

Prerequisites

  • Node.js: Version 18 or higher.
  • npm (or yarn).
  • (Optional) Docker: If you want to run the server in a container.

📁 Directory Structure for Prompts

The server uses a single directory for all prompts:

  1. If the environment variable PROMPT_REGISTRY_PROJECT_DIR is set, prompts are stored in that directory.
  2. If not set, prompts are stored in ~/.promptregistry/ in your home directory. On first startup, or if prompts are missing, the server will attempt to copy predefined prompts from a local default_prompts_data/ directory (if present) into ~/.promptregistry/.

Prompt JSON File Structure (your-prompt-id.json):

{
  "id": "your-prompt-id",
  "description": "A brief description for MCP listing",
  "content": "Your prompt template, e.g., Explain {{concept}} like I'm {{age}}.",
  "tags": ["tag1", "category_a"],
  "variables": {
    "concept": { "description": "The concept to explain", "required": true },
    "age": { "description": "The target audience's age", "required": false }
在 GitHub 查看完整 README

安装

npx mcp-promptregistry
新手?先看 mcpskill.org 教程 →

配置

// Example client configuration JSON { "mcpServers": { "mcp-promptregistry": { "command": "npx", "args": [ "mcp-promptregistry" ], "env": { "PROMPT_REGISTRY_PROJECT_DIR": "/path/to/your/prompts" } } } }