The MCP Prompts Server is an extensible system for managing and serving prompts for large language model applications, built on the Model Context Protocol (MCP). It provides centralized storage, versioning, and templating capabilities for your AI prompts.
Run the server directly without installation:
npx -y @sparesparrow/mcp-prompts
For file-based storage:
docker run -d --name mcp-server -p 3003:3003 -v $(pwd)/data:/app/data ghcr.io/sparesparrow/mcp-prompts:latest
For PostgreSQL storage:
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
Multiple services with Docker Compose:
docker-compose -f docker-compose.yml -f docker-compose.extended.yml up -d
git clone https://github.com/sparesparrow/mcp-prompts.git
cd mcp-prompts
npm install
npm run build
npm start
Check that the server is running:
curl http://localhost:3003/health
The server can be configured using environment variables:
# Basic configuration
STORAGE_TYPE=file # Options: file, memory, postgres
PROMPTS_DIR=./prompts # For file storage
PORT=3003 # HTTP port
LOG_LEVEL=info # Options: debug, info, warn, error
# PostgreSQL configuration (if using postgres storage)
POSTGRES_URL=postgres://user:password@localhost:5432/database
# Security options
API_KEY=your_secret_key # Enable API key authentication
CORS_ORIGIN=* # Configure CORS
RATE_LIMIT=100 # Requests per minute
For Cursor, Claude Desktop, or Amazon Q clients (mcp.json):
{
"mcpServers": {
"mcp-prompts": {
"command": "npx",
"args": ["-y", "@sparesparrow/mcp-prompts"],
"env": {
"PROMPTS_DIR": "./my-prompts",
"STORAGE_TYPE": "file"
}
}
}
}
For VS Code or Hugging Face clients:
{
"servers": [
{
"name": "mcp-prompts",
"transport": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@sparesparrow/mcp-prompts"]
},
"env": {
"PROMPTS_DIR": "./my-prompts"
}
}
]
}
The server provides an HTTP API and MCP tools for managing prompts.
curl -X POST http://localhost:3003/api/prompts \
-H "Content-Type: application/json" \
-d '{
"id": "greeting",
"name": "Greeting Template",
"description": "A simple greeting template",
"prompt": "Hello, {{name}}! Welcome to {{service}}.",
"schema": {
"name": {"type": "string", "description": "User's name"},
"service": {"type": "string", "description": "Service name"}
},
"tags": ["greeting", "welcome"]
}'
curl http://localhost:3003/api/prompts/greeting
curl -X POST http://localhost:3003/api/prompts/greeting/apply \
-H "Content-Type: application/json" \
-d '{
"name": "John",
"service": "MCP Prompts"
}'
curl http://localhost:3003/api/prompts
Import multiple prompts from a JSON file:
curl -X POST http://localhost:3003/api/prompts/bulk/import \
-H "Content-Type: application/json" \
-d @prompts-collection.json
Export all prompts:
curl http://localhost:3003/api/prompts/bulk/export > prompts-backup.json
Get all versions of a prompt:
curl http://localhost:3003/api/prompts/greeting/versions
Revert to a specific version:
curl -X POST http://localhost:3003/api/prompts/greeting/versions/v2/revert
MCP Prompts can work alongside other MCP servers. For client-side federation, configure multiple servers in your host application:
{
"mcpServers": {
"mcp-prompts": { "command": "npx", "args": ["-y", "@sparesparrow/mcp-prompts"] },
"filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/files"] }
}
}
For server-side integration, use Docker Compose for orchestration:
version: '3.8'
services:
mcp-prompts:
image: ghcr.io/sparesparrow/mcp-prompts:latest
environment:
- STORAGE_TYPE=file
- PROMPTS_DIR=/app/prompts
volumes:
- ./prompts:/app/prompts
filesystem-server:
image: ghcr.io/modelcontextprotocol/server-filesystem:latest
volumes:
- ./prompts:/prompts
For debugging and testing your MCP server:
npx @modelcontextprotocol/inspector npx -y @sparesparrow/mcp-prompts
The Inspector UI will open at http://localhost:6274, allowing you to browse resources, send test requests, and view logs.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "mcp-prompts" '{"command":"npx","args":["-y","@sparesparrow/[email protected]"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"mcp-prompts": {
"command": "npx",
"args": [
"-y",
"@sparesparrow/[email protected]"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"mcp-prompts": {
"command": "npx",
"args": [
"-y",
"@sparesparrow/[email protected]"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect