The MCP Prompts Server is a comprehensive solution for managing, versioning, and serving prompts for LLM applications, built on the Model Context Protocol (MCP). It provides centralized storage for your prompts with versioning control and template capabilities.
The simplest way to get started is using NPX:
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
For multi-server setup 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
pnpm install
pnpm run build
pnpm start
Once the server is running, you can check its health:
curl http://localhost:3003/health
MCP Prompts can be configured in various MCP clients like Cursor, Claude Desktop, or VS Code using the mcp.json
configuration file:
{
"mcpServers": {
"mcp-prompts": {
"command": "npx",
"args": ["-y", "@sparesparrow/mcp-prompts"],
"env": {
"PROMPTS_DIR": "./my-prompts",
"STORAGE_TYPE": "file"
}
}
}
}
{
"servers": [
{
"name": "mcp-prompts",
"transport": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@sparesparrow/mcp-prompts"]
},
"env": {
"PROMPTS_DIR": "./my-prompts"
}
}
]
}
For Docker installations, your configuration might look like:
{
"mcpServers": {
"mcp-prompts": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "${PWD}/prompts:/app/prompts",
"-e", "PROMPTS_DIR=/app/prompts",
"-e", "POSTGRES_URL",
"sparesparrow/mcp-prompts:latest"
],
"env": {
"POSTGRES_URL": "${POSTGRES_URL}"
}
}
}
}
Configure the server with environment variables:
STORAGE_TYPE=file # Options: file, postgres, memory
PROMPTS_DIR=./data/prompts # Directory for prompt storage (for file storage)
POSTGRES_URL=postgres:// # PostgreSQL connection URL (for postgres storage)
PORT=3003 # HTTP server port
LOG_LEVEL=info # Logging level (debug, info, warn, error)
You can use MCP Prompts alongside other MCP servers in a federated setup:
{
"mcpServers": {
"mcp-prompts": { "command": "npx", "args": ["-y", "@sparesparrow/mcp-prompts"] },
"filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/files"] },
"memory": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-memory"] }
}
}
For more advanced setups, you can create a TypeScript-based MCP server with PostgreSQL:
// server.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { Pool } from "pg";
import { z } from "zod";
const db = new Pool({ connectionString: process.env.DATABASE_URL });
const server = new McpServer({
name: "mcp-prompts-postgres",
version: "1.0.0"
});
server.registerTool(
"getPromptFromDb",
{
title: "Get prompt from DB",
description: "Returns a prompt template stored in Postgres",
inputSchema: { id: z.string() }
},
async ({ id }) => {
const { rows } = await db.query(
"SELECT text FROM prompts WHERE id = $1",
[id]
);
return {
content: [{ type: "text", text: rows[0]?.text ?? "Not found" }]
};
}
);
await server.connect(new StdioServerTransport());
After building your server, you can use the MCP Inspector to debug it:
npx @modelcontextprotocol/inspector node dist/server.js
The Inspector UI will open at http://localhost:6274 and allow you to browse resources, prompts, tools, and send test requests.
To expose your MCP server via SSE or HTTP:
# Create a stdio → SSE bridge on port 8080
npx -y @modelcontextprotocol/proxy --stdio "node dist/server.js" --sse 8080
MCP Prompts offers:
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