A prompt management server that exposes CRUD operations for LLM prompts through MCP tools like add_prompt, get_prompt, and apply_template. It handles template variable substitution, supports multiple storage backends including DynamoDB and S3, and can run in stdio mode for Claude Desktop or HTTP mode for REST integrations. The cognitive architecture layers add context-aware prompt recommendations and cross-domain pattern matching. You'd reach for this when building applications that need centralized prompt storage, versioning, and intelligent template management across different AI workflows, especially if you're already using AWS infrastructure or need Stripe payment integration for prompt marketplace features.
A robust, extensible MCP (Model Context Protocol) server for managing, versioning, and serving prompts and templates for LLM applications with AWS integration.
Features • Installation • Quick Start • Configuration • API • Tools • Docker
MCP Prompts is a production-ready server that implements the Model Context Protocol (MCP) to provide intelligent prompt management, template systems, and AI-powered workflows. It supports multiple storage backends including in-memory, file-based, and AWS services (DynamoDB, S3, SQS).
MCP Prompts implements a seven-layer cognitive architecture that transforms the system into an intelligent development assistant capable of learning from experience and adapting to different domains.
┌─────────────────────────────────────────┐
│ 7. Evaluative │ Quality Assessment │
│ │ Priority Judgment │
├─────────────────────────────────────────┤
│ 6. Transfer │ Cross-Domain Analogies│
│ │ Pattern Abstraction │
├─────────────────────────────────────────┤
│ 5. Meta-Cognitive│ Strategy Selection │
│ │ Self-Awareness │
├─────────────────────────────────────────┤
│ 4. Procedural │ Workflows & Techniques│
│ │ Analysis Procedures │
├─────────────────────────────────────────┤
│ 3. Semantic │ Domain Knowledge │
│ │ Tool Capabilities │
├─────────────────────────────────────────┤
│ 2. Episodic │ Problem-Solving │
│ │ Experience Memory │
├─────────────────────────────────────────┤
│ 1. Perceptual │ Context Detection │
│ │ Goal Identification │
└─────────────────────────────────────────┘
High-performance binary serialization for cognitive data:
The server exposes the following MCP tools:
add_prompt - Create a new prompt with metadataget_prompt - Retrieve a prompt by IDlist_prompts - List all prompts with optional filteringupdate_prompt - Update an existing promptdelete_prompt - Delete a promptapply_template - Apply variables to a prompt templateget_stats - Get statistics about stored promptsTemplates support variable substitution with the {{variableName}} syntax:
Please review this {{language}} code for:
- Security issues
- Performance improvements
- Best practices
Code:
{{code}}
npm install @sparesparrow/mcp-prompts
# or
pnpm add @sparesparrow/mcp-prompts
# or
yarn add @sparesparrow/mcp-prompts
npm install -g @sparesparrow/mcp-prompts
mcp-prompts --help
docker pull ghcr.io/sparesparrow/mcp-prompts:latest
Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"mcp-prompts": {
"command": "npx",
"args": ["-y", "@sparesparrow/mcp-prompts"]
}
}
}
Or using Docker:
{
"mcpServers": {
"mcp-prompts": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"${HOME}/.mcp-prompts:/app/data",
"ghcr.io/sparesparrow/mcp-prompts:mcp"
]
}
}
}
# Using npm
npm install @sparesparrow/mcp-prompts
MODE=http PORT=3000 node node_modules/@sparesparrow/mcp-prompts/dist/index.js
# Using Docker
docker run -p 3000:3000 -e MODE=http ghcr.io/sparesparrow/mcp-prompts:latest
# Start in MCP mode
mcp-prompts start --mode mcp
# Start HTTP server
mcp-prompts start --mode http --port 3000
# List prompts
mcp-prompts list
# Get a prompt
mcp-prompts get <prompt-id>
# Create a prompt
mcp-prompts create \
--name "Code Review" \
--template "Review this {{language}} code..." \
--category development \
--tags "code-review,development"
# Search prompts
mcp-prompts search "bug fix"
# Check health
mcp-prompts health
# Server mode: 'mcp' for stdio or 'http' for REST API
MODE=mcp
# HTTP server settings (when MODE=http)
PORT=3000
HOST=0.0.0.0
NODE_ENV=production
# Storage backend: 'memory', 'file', or 'aws'
STORAGE_TYPE=memory
# Logging
LOG_LEVEL=info
AWS_REGION=us-east-1
PROMPTS_TABLE=mcp-prompts
PROMPTS_BUCKET=mcp-prompts-catalog
PROCESSING_QUEUE=mcp-prompts-processing
USERS_TABLE=mcp-prompts-users
# AWS credentials (use IAM roles in production)
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
STRIPE_PUBLISHABLE_KEY=pk_test_...
Best for development and testing:
STORAGE_TYPE=memory
Production-ready with DynamoDB and S3:
STORAGE_TYPE=aws
AWS_REGION=us-east-1
PROMPTS_TABLE=mcp-prompts
PROMPTS_BUCKET=mcp-prompts-catalog
Persistent local storage:
STORAGE_TYPE=file
DATA_DIR=/path/to/data
GET /health - Health check
GET /mcp - MCP capabilities
GET /mcp/tools - List available MCP tools
POST /mcp/tools - Execute an MCP tool
GET /v1/prompts - List prompts
GET /v1/prompts/:id - Get specific prompt
POST /v1/prompts - Create new prompt
PUT /v1/prompts/:id - Update prompt
DELETE /v1/prompts/:id - Delete prompt
POST /v1/prompts/:id/apply - Apply template variables
GET /v1/slash-commands - List available slash commands
GET /v1/slash-commands/suggest - Get command suggestions
POST /v1/slash-commands/execute - Execute a slash command
GET /v1/subscription/plans - Get subscription plans
GET /v1/subscription/status - Get user subscription status
POST /v1/payment/create-intent - Create payment intent
POST /v1/subscription/create - Create subscription
POST /v1/subscription/cancel - Cancel subscription
POST /v1/webhook/stripe - Stripe webhook handler
curl -X POST http://localhost:3000/v1/prompts \
-H "Content-Type: application/json" \
-d '{
"name": "Bug Analyzer",
"content": "Analyze this bug: {{description}}",
"isTemplate": true,
"tags": ["debugging", "analysis"],
"variables": [
{
"name": "description",
"description": "Bug description",
"required": true,
"type": "string"
}
],
"metadata": {
"category": "debugging"
}
}'
# List all prompts
curl http://localhost:3000/v1/prompts
# Filter by category
curl http://localhost:3000/v1/prompts?category=development&limit=10
# Search
curl http://localhost:3000/v1/prompts?search=code%20review
curl -X POST http://localhost:3000/v1/prompts/bug_analyzer/apply \
-H "Content-Type: application/json" \
-d '{
"variables": {
"description": "Login page crashes on mobile devices"
}
}'
When connected to an MCP client, the following tools are available:
add_promptCreate a new prompt.
Parameters:
name (string, required): Prompt namecontent (string, required): Prompt content/templateisTemplate (boolean): Whether this is a templatetags (array): Tags for categorizationvariables (array): Template variables definitionmetadata (object): Additional metadataget_promptRetrieve a specific prompt by ID.
Parameters:
id (string, required): Prompt IDlist_promptsList all prompts with optional filtering.
Parameters:
tags (array, optional): Filter by tagssearch (string, optional): Search termupdate_promptUpdate an existing prompt.
Parameters:
id (string, required): Prompt IDupdates (object, required): Fields to updatedelete_promptDelete a prompt.
Parameters:
id (string, required): Prompt IDapply_templateApply variables to a prompt template.
Parameters:
id (string, required): Template IDvariables (object, required): Variable valuesget_statsGet statistics about stored prompts.
Returns:
# Default image (HTTP mode)
ghcr.io/sparesparrow/mcp-prompts:latest
# MCP server mode (stdio)
ghcr.io/sparesparrow/mcp-prompts:mcp
# AWS integration
ghcr.io/sparesparrow/mcp-prompts:aws
# Memory storage
ghcr.io/sparesparrow/mcp-prompts:memory
# File storage
ghcr.io/sparesparrow/mcp-prompts:file
version: '3.8'
services:
mcp-prompts:
image: ghcr.io/sparesparrow/mcp-prompts:latest
ports:
- "3000:3000"
environment:
- MODE=http
- PORT=3000
- STORAGE_TYPE=memory
- LOG_LEVEL=info
volumes:
- ./data:/app/data
restart: unless-stopped
# Build default image
docker build -t mcp-prompts:latest .
# Build MCP server variant
docker build -f Dockerfile.mcp -t mcp-prompts:mcp .
# Build AWS variant
docker build -f Dockerfile.aws -t mcp-prompts:aws .
# Clone repository
git clone https://github.com/sparesparrow/mcp-prompts.git
cd mcp-prompts
# Install dependencies
pnpm install
# Build
pnpm run build
# Run tests
pnpm test
# Run in development mode
pnpm run dev
# Run HTTP server
pnpm run dev:http
# Run MCP server
pnpm run dev:mcp
mcp-prompts/
├── src/
│ ├── adapters/ # Storage adapters (AWS, Memory, File)
│ ├── core/ # Core domain logic
│ │ ├── entities/ # Domain entities
│ │ ├── services/ # Business logic services
│ │ └── ports/ # Interfaces
│ ├── mcp/ # MCP server implementation
│ ├── lambda/ # AWS Lambda handlers
│ ├── monitoring/ # CloudWatch metrics
│ ├── cli.ts # CLI entry point
│ ├── index.ts # HTTP server entry point
│ └── mcp-server-standalone.ts # MCP stdio server
├── data/ # Sample data
├── cdk/ # AWS CDK infrastructure
├── scripts/ # Utility scripts
├── Dockerfile.* # Docker configurations
└── package.json
# Configure AWS credentials
aws configure
# Install dependencies
pnpm install
# Deploy infrastructure
cd cdk
cdk deploy --all
# Or use npm script
pnpm run cdk:deploy
# Deploy using script
./scripts/deploy-aws.sh
# Cleanup resources
./scripts/cleanup-aws.sh
The server includes several sample prompts:
Structured JSON logging with pino:
import pino from 'pino';
const logger = pino({
level: process.env.LOG_LEVEL || 'info'
});
CloudWatch metrics for:
# HTTP health check
curl http://localhost:3000/health
# CLI health check
mcp-prompts health
The HTTP server supports authentication via:
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)MCP server not starting
LOG_LEVEL=debug mcp-prompts startHTTP server connection refused
lsof -i :3000AWS connection failures
aws sts get-caller-identityTemplate variables not substituting
isTemplate: true{{variableName}}MIT License - see LICENSE file for details.
Copyright (c) 2024 Sparre Sparrow
Built with:
Made with ❤️ by the MCP Community
io.github.ericm1018/skillfm-llm-cost-optimizer-openai-anthropic-usage
io.github.mikerawsonnz/llm-orchestration-agent
io.github.mikerawsonnz/authenticated-llm-agent
labforgedev/copilot-memory-mcp
csoai-org/agent-prompt-injection-firewall-mcp
io.github.mikerawsonnz/authenticated-multi-llm-agent