MCP ExplorerExplorer

Mcp Prompts

@sparesparrowon 9 months ago
45 MIT
FreeCommunity
AI Systems
Model Context Protocol server for managing, storing, and providing prompts and prompt templates for LLM interactions.

Overview

What is Mcp Prompts

mcp-prompts is a Model Context Protocol server designed for managing, storing, and providing prompts and prompt templates for interactions with large language models (LLMs). It facilitates consistent prompting patterns across AI applications.

Use cases

Use cases for mcp-prompts include managing prompts for AI applications, generating project documentation, creating prompt visualization dashboards, and integrating with other MCP servers for enhanced functionality.

How to use

To use mcp-prompts, you can install it via npx, npm, or Docker. After installation, configure the server using environment variables, and verify its functionality by checking for prompts in AI assistants like Claude.

Key features

Key features include the ability to store and retrieve prompts, create templates with variables, filter prompts by tags, support for multiple storage backends (file system, PostgreSQL, MDC), and project orchestration capabilities.

Where to use

undefined

Content

MCP Prompts Server · @sparesparrow/mcp-prompts

CI
npm
Docker Pulls
License: MIT
Roadmap

MCP Prompts Server is a robust solution to the problem of prompt fragmentation across development teams. It serves as the single source of truth for all your prompts, templates, and related metadata, enabling effective versioning, testing, and secure sharing within your organization and with external systems.


Table of Contents


🎯 Why This Project? (The Problem It Solves)

Most teams working with AI struggle with chaos: prompts are stored in code, shared documents, or lost in chat histories. This project solves the following problems:

  • No Versioning: The inability to track changes and revert to previous, functional versions of prompts.
  • Difficult Testing: Complicated A/B testing and evaluation to determine which prompt version performs better.
  • Security Risks: Lack of control over who has access to valuable and sensitive prompts.
  • Inefficient Collaboration: Developers and team leaders lack a central place to share and approve prompts.

✨ Key Features

  • 🗄️ Flexible Storage: Native support for files, PostgreSQL, and in-memory. Can be extended for Elasticsearch for full-text search.
  • 🏷️ Categorization and Tagging: Organize your prompts into hierarchical categories and assign tags for easy searching.
  • 🔄 Versioning: Track the history of each prompt, similar to Git.
  • 🔒 Access Control (RBAC): Detailed permission management for users and roles (admin, editor, viewer).
  • 🤖 MCP Ecosystem Integration: Seamless communication with other MCP servers like @filesystem and @github.
  • 📄 Automatic Documentation: Generate OpenAPI specifications directly from the code.
  • 🐳 Docker and CLI Support: Easy deployment with Docker containers and command-line tools for batch operations.
  • 📊 Auditing and Metrics: Track all changes and analyze the usage of individual prompts.

🚀 Quick Start

⚠️ Requirements: Node.js 20+ and npm 10+ (due to npm workspaces support).

1. Run with NPX

🚨 Critical Alert: The latest version of @sparesparrow/mcp-prompts has a critical runtime error. Please use version 1.2.22 for a stable experience until this is resolved.

Run the server without a permanent installation with a single command:

npx -y @sparesparrow/[email protected]

2. Run with Docker

For production deployment with persistent storage:

⚠️ Note: The Docker images currently have a build issue and may not work properly. We recommend using the NPX method or building from source until this is resolved.

File storage:

# Unix/Linux/macOS
docker run -d --name mcp-server \
  -p 3003:3003 \
  -v $(pwd)/data:/app/data \
  ghcr.io/sparesparrow/mcp-prompts:latest

# Windows PowerShell
docker run -d --name mcp-server -p 3003:3003 -v ${PWD}/data:/app/data ghcr.io/sparesparrow/mcp-prompts:latest

# Windows Command Prompt
docker run -d --name mcp-server -p 3003:3003 -v %cd%/data:/app/data ghcr.io/sparesparrow/mcp-prompts:latest

Postgres storage:

# Unix/Linux/macOS
docker run -d --name mcp-server \
  -p 3003:3003 \
  -v $(pwd)/data:/app/data \
  -e "STORAGE_TYPE=postgres" \
  -e "POSTGRES_URL=your_connection_string" \
  ghcr.io/sparesparrow/mcp-prompts:latest

# Windows PowerShell
docker run -d --name mcp-server -p 3003:3003 -v ${PWD}/data:/app/data -e "STORAGE_TYPE=postgres" -e "POSTGRES_URL=your_connection_string" ghcr.io/sparesparrow/mcp-prompts:latest

# Windows Command Prompt
docker run -d --name mcp-server -p 3003:3003 -v %cd%/data:/app/data -e "STORAGE_TYPE=postgres" -e "POSTGRES_URL=your_connection_string" ghcr.io/sparesparrow/mcp-prompts:latest

Alternative: Build from source
If the Docker images don’t work, you can build your own:

# Clone the repository
git clone https://github.com/sparesparrow/mcp-prompts.git
cd mcp-prompts

# Build the Docker image
docker build -t mcp-prompts:local .

# Run the local image
docker run -d --name mcp-server -p 3003:3003 -v ${PWD}/data:/app/data mcp-prompts:local

Note: If you encounter “invalid reference format” errors, ensure Docker Desktop is running and try using the full image path: ghcr.io/sparesparrow/mcp-prompts:latest

Troubleshooting Docker Issues

Common Problems:

  1. “docker: invalid reference format”

    • Ensure Docker Desktop is running
    • Use the full image path: ghcr.io/sparesparrow/mcp-prompts:latest
    • Check that the image exists: docker images | grep mcp-prompts
  2. “Cannot connect to the Docker daemon”

    • Start Docker Desktop
    • On Windows, ensure WSL2 is properly configured
  3. “Unknown file extension ‘.ts’” error

    • This indicates a Docker build issue where TypeScript files aren’t compiled
    • Solution: Use the NPX method instead: npx -y @sparesparrow/mcp-prompts
    • Or build from source using the instructions above
  4. Volume mounting issues on Windows

    • Use forward slashes: /app/data not \app\data
    • Use ${PWD} in PowerShell or %cd% in Command Prompt
  5. Port already in use

    • Stop existing container: docker stop mcp-server
    • Remove container: docker rm mcp-server
    • Or use a different port: -p 3004:3003

3. Verify It’s Running

Check that the server is running and accessible:

curl http://localhost:3003/health

Expected response:

{
  "status": "ok",
  "version": "1.4.0",
  "storage": "postgres"
}

CLI Usage

The CLI entry point includes a Node.js shebang (#!/usr/bin/env node) so you can run it directly:

npx -y @sparesparrow/[email protected]

Or, after installing globally:

mcp-prompts --help

🏛️ Core Concepts and Data Structure

Entity Attributes Description
Prompt name, content, tags, version, metadata The basic unit containing the template text.
Category name, description, parent_category Used for hierarchical organization of prompts.
Template variables, validation_rules A special type of prompt with dynamic parts.
User username, role An account with assigned permissions.

🏗️ Architecture and Roadmap

The project is designed as a modern monorepo with separate packages, which facilitates maintenance and scaling.

Component Description Technology
core Main application logic, API, and storage mgmt. Node.js, Express, TypeScript
catalog A distributable package with default prompts. NPM
contracts Shared TypeScript types and OpenAPI specs. OpenAPI, JSON Schema

📊 Track our detailed progress on the GitHub Project Board


🤝 Contributing and Community

We welcome community contributions! Whether it’s code, documentation, a bug report, or a new idea, your help is appreciated.

Please read our Contributor Guide to find everything you need.

✨ Our Contributors

Thank you to all the wonderful people who have contributed to this project!

Contributors


📄 License

This project is licensed under the MIT License.


📞 Support and Community

Built with ❤️ by @sparesparrow and the community

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers