Logo di Prompts MCP Server

Prompts MCP Server

Community
tanker327

MCP server for managing and providing prompts with TypeScript, caching, and comprehensive testing

Pubblicato datanker327
Repositoryprompts-mcp-server
LinguaTypeScript
Fork
8
Stelle
16
Strumenti disponibili
0
Tipo di trasportostdio
Categorie
LicenzaMIT
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Prompts MCP Server mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • Strumenti disponibili: 0

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni se il server li fornisce.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse della comunità open source

    Stelle: 16; fork: 8 (repository collegato).

Prompts MCP Server

A Model Context Protocol (MCP) server for managing and providing prompts. This server allows users and LLMs to easily add, retrieve, and manage prompt templates stored as markdown files with YAML frontmatter support.

Quick Start

bash
# 1. Install from NPM
npm install -g prompts-mcp-server

# 2. Add to your MCP client config (e.g., Claude Desktop)
# Add this to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
  "mcpServers": {
    "prompts-mcp-server": {
      "command": "prompts-mcp-server"
    }
  }
}

# 3. Restart your MCP client and start using the tools!

Features

  • Add Prompts: Store new prompts as markdown files with YAML frontmatter
  • Retrieve Prompts: Get specific prompts by name
  • List Prompts: View all available prompts with metadata preview
  • Delete Prompts: Remove prompts from the collection
  • File-based Storage: Prompts are stored as markdown files in the prompts/ directory
  • Real-time Caching: In-memory cache with automatic file change monitoring
  • YAML Frontmatter: Support for structured metadata (title, description, tags, etc.)
  • TypeScript: Full TypeScript implementation with comprehensive type definitions
  • Modular Architecture: Clean separation of concerns with dependency injection
  • Comprehensive Testing: 95 tests with 84.53% code coverage

Installation

Option 1: From NPM (Recommended)

Install the package globally from NPM:

bash
npm install -g prompts-mcp-server

This will make the prompts-mcp-server command available in your system.

After installation, you need to configure your MCP client to use it. See MCP Client Configuration.

Option 2: From GitHub (for development)

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

# Install dependencies
npm install

# Build the TypeScript code
npm run build

# Test the installation
npm test

Option 3: Direct Download

  1. Download the latest release from GitHub
  2. Extract to your desired location
  3. Run installation steps from Option 2.

Verification

After installation, verify the server works:

bash
# Start the server (should show no errors)
npm start

# Or test with MCP Inspector
npx @modelcontextprotocol/inspector prompts-mcp-server

Testing

Run the comprehensive test suite:

bash
npm test

Run tests with coverage:

bash
npm run test:coverage

Watch mode for development:

bash
npm run test:watch

MCP Tools

The server provides the following tools:

add_prompt

Add a new prompt to the collection. If no YAML frontmatter is provided, default metadata will be automatically added.

  • name (string): Name of the prompt
  • content (string): Content of the prompt in markdown format with optional YAML frontmatter

create_structured_prompt

Create a new prompt with guided metadata structure and validation.

  • name (string): Name of the prompt
  • title (string): Human-readable title for the prompt
  • description (string): Brief description of what the prompt does
  • category (string, optional): Category (defaults to "general")
  • tags (array, optional): Array of tags for categorization (defaults to ["general"])
  • difficulty (string, optional): "beginner", "intermediate", or "advanced" (defaults to "beginner")
  • author (string, optional): Author of the prompt (defaults to "User")
  • content (string): The actual prompt content (markdown)

get_prompt

Retrieve a prompt by name.

  • name (string): Name of the prompt to retrieve

list_prompts

List all available prompts with metadata preview. No parameters required.

delete_prompt

Delete a prompt by name.

  • name (string): Name of the prompt to delete

Usage Examples

Once connected to an MCP client, you can use the tools like this:

Method 1: Quick prompt creation with automatic metadata

javascript
// Add a prompt without frontmatter - metadata will be added automatically
add_prompt({
  name: "debug_helper",
  content: `# Debug Helper

Help me debug this issue by:
1. Analyzing the error message
2. Suggesting potential causes
3. Recommending debugging steps`
})
// This automatically adds default frontmatter with title "Debug Helper", category "general", etc.

Method 2: Structured prompt creation with full metadata control

javascript
// Create a prompt with explicit metadata using the structured tool
create_structured_prompt({
  name: "code_review",
  title: "Code Review Assistant",
  description: "Helps review code for best practices and potential issues",
  category: "development",
  tags: ["code", "review", "quality"],
  difficulty: "intermediate",
  author: "Development Team",
  content: `# Code Review Prompt

Please review the following code for:
- Code quality and best practices
- Potential bugs or issues
- Performance considerations
- Security vulnerabilities

## Code to Review
[Insert code here]`
})

Method 3: Manual frontmatter (preserves existing metadata)

javascript
// Add a prompt with existing frontmatter - no changes made
add_prompt({
  name: "custom_prompt",
  content: `---
title: "Custom Assistant"
category: "specialized"
tags: ["custom", "specific"]
difficulty: "advanced"
---

# Custom Prompt Content
Your specific prompt here...`
})

Other operations

javascript
// Get a prompt
get_prompt({ name: "code_review" })

// List all prompts (shows metadata preview)
list_prompts({})

// Delete a prompt
delete_prompt({ name: "old_prompt" })

File Structure

prompts-mcp-server/
├── src/
│   ├── index.ts          # Main server orchestration
│   ├── types.ts          # TypeScript type definitions
│   ├── cache.ts          # Caching system with file watching
│   ├── fileOperations.ts # File I/O operations
│   └── tools.ts          # MCP tool definitions and handlers
├── tests/
│   ├── helpers/
│   │   ├── testUtils.ts  # Test utilities
│   │   └── mocks.ts      # Mock implementations
│   ├── cache.test.ts     # Cache module tests
│   ├── fileOperations.test.ts # File operations tests
│   ├── tools.test.ts     # Tools module tests
│   └── index.test.ts     # Integration tests
├── prompts/              # Directory for storing prompt markdown files
│   ├── code_review.md
│   ├── debugging_assistant.md
│   └── api_design.md
├── dist/                 # Compiled JavaScript output
├── CLAUDE.md            # Development documentation
├── package.json
├── tsconfig.json
└── README.md

Architecture

The server uses a modular architecture with the following components:

  • PromptCache: In-memory caching with real-time file change monitoring via chokidar
  • PromptFileOperations: File I/O operations with cache integration
  • PromptTools: MCP tool definitions and request handlers
  • Type System: Comprehensive TypeScript types for all data structures

YAML Frontmatter Support

Prompts can include structured metadata using YAML frontmatter:

yaml
---
title: "Prompt Title"
description: "Brief description of the prompt"
category: "development"
tags: ["tag1", "tag2", "tag3"]
difficulty: "beginner" | "intermediate" | "advanced"
author: "Author Name"
version: "1.0"
---

# Prompt Content

Your prompt content goes here...

MCP Client Configuration

This server can be configured with various MCP-compatible applications. Here are setup instructions for popular clients:

Claude Desktop

Add this to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

json
{
  "mcpServers": {
    "prompts-mcp-server": {
      "command": "prompts-mcp-server",
      "env": {
        "PROMPTS_FOLDER_PATH": "/path/to/your/prompts/directory"
      }
    }
  }
}

Cline (VS Code Extension)

Add to your Cline MCP settings in VS Code:

json
{
  "cline.mcp.servers": {
    "prompts-mcp-server": {
      "command": "prompts-mcp-server",
      "env": {
        "PROMPTS_FOLDER_PATH": "/path/to/your/prompts/directory"
      }
    }
  }
}

Continue.dev

In your ~/.continue/config.json:

json
{
  "mcpServers": [
    {
      "name": "prompts-mcp-server",
      "command": "prompts-mcp-server",
      "env": {
        "PROMPTS_FOLDER_PATH": "/path/to/your/prompts/directory"
      }
    }
  ]
}

Zed Editor

In your Zed settings (~/.config/zed/settings.json):

json
{
  "assistant": {
    "mcp_servers": {
      "prompts-mcp-server": {
        "command": "prompts-mcp-server",
        "env": {
          "PROMPTS_DIR": "/path/to/your/prompts/directory"
        }
      }
    }
  }
}

Custom MCP Client

For any MCP-compatible application, use these connection details:

  • Protocol: Model Context Protocol (MCP)
  • Transport: stdio
  • Command: prompts-mcp-server
  • Environment Variables:
    • PROMPTS_FOLDER_PATH: Custom directory for storing prompts (optional, defaults to ./prompts)

Development/Testing Setup

For development or testing with the MCP Inspector:

bash
# Install MCP Inspector
npm install -g @modelcontextprotocol/inspector

# Run the server with inspector
npx @modelcontextprotocol/inspector prompts-mcp-server

Docker Configuration

Create a docker-compose.yml for containerized deployment:

yaml
version: '3.8'
services:
  prompts-mcp-server:
    build: .
    environment:
      - PROMPTS_FOLDER_PATH=/app/prompts
    volumes:
      - ./prompts:/app/prompts
    stdin_open: true
    tty: true

Server Configuration

  • The server automatically creates the prompts/ directory if it doesn't exist
  • Prompt files are automatically sanitized to use safe filenames (alphanumeric characters, hyphens, and underscores only)
  • File changes are monitored in real-time and cache is updated automatically
  • Prompts directory can be customized via the PROMPTS_FOLDER_PATH environment variable

Environment Variables

VariableDescriptionDefault
PROMPTS_FOLDER_PATHCustom directory to store prompt files (overrides default)(not set)
NODE_ENVEnvironment modeproduction

Note: If PROMPTS_FOLDER_PATH is set, it will be used as the prompts directory. If not set, the server defaults to ./prompts relative to the server location.

Requirements

  • Node.js 18.0.0 or higher
  • TypeScript 5.0.0 or higher
  • Dependencies:
    • @modelcontextprotocol/sdk ^1.0.0
    • gray-matter ^4.0.3 (YAML frontmatter parsing)
    • chokidar ^3.5.3 (file watching)

Development

The project includes comprehensive tooling for development:

  • TypeScript: Strict type checking and modern ES modules
  • Vitest: Fast testing framework with 95 tests and 84.53% coverage
  • ESLint: Code linting (if configured)
  • File Watching: Real-time cache updates during development

Troubleshooting

Common Issues

"Module not found" errors

bash
# Ensure TypeScript is built
npm run build

# Check that dist/ directory exists and contains .js files
ls dist/

MCP client can't connect

  1. Verify the server starts without errors: npm start
  2. Check the correct path is used in client configuration
  3. Ensure Node.js 18+ is installed: node --version
  4. Test with MCP Inspector: npx @modelcontextprotocol/inspector prompts-mcp-server

Permission errors with prompts directory

bash
# Ensure the prompts directory is writable
mkdir -p ./prompts
chmod 755 ./prompts

File watching not working

  • On Linux: Install inotify-tools
  • On macOS: No additional setup needed
  • On Windows: Ensure Windows Subsystem for Linux (WSL) or native Node.js

Debug Mode

Enable debug logging by setting environment variables:

bash
# Enable debug mode
DEBUG=* node dist/index.js

# Or with specific debug namespace
DEBUG=prompts-mcp:* node dist/index.js

Getting Help

  1. Check the GitHub Issues
  2. Review the test files for usage examples
  3. Use MCP Inspector for debugging client connections
  4. Check your MCP client's documentation for configuration details

Performance Tips

  • The server uses in-memory caching for fast prompt retrieval
  • File watching automatically updates the cache when files change
  • Large prompt collections (1000+ files) work efficiently due to caching
  • Consider using SSD storage for better file I/O performance

Community Variants & Extensions

ProjectMaintainerExtra Features
smart-prompts-mcp@jezwebGitHub-hosted prompt libraries, advanced search & composition, richer TypeScript types, etc.

👉 Have you built something cool on top of prompts-mcp-server?
Open an issue or PR to add it here so others can discover your variant!

License

MIT

Installazione

TypingMind
Prerequisiti:

Node.js 18+

{
  "mcpServers": {
    "tanker327-prompts-mcp-server": {
      "command": "",
      "args": []
    }
  }
}

Usa Prompts MCP Server MCP con più modelli AI

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Prompts MCP Server, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura connettore.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura connettore e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con l’opzione «Questo dispositivo» selezionata
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Prompts MCP Server come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Prompts MCP Server.
  4. Salva l'elenco dei server.
  5. Se vuoi verificare che il connettore sia ancora pronto, aggiorna la pagina.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "tanker327-prompts-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "prompts-mcp-server"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Prompts MCP Server, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Prompts MCP Server.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Prompts MCP Server per aiutarmi con questa attività?
Prompts MCP Server
Certo. L’ho letto.
Ecco cosa ho trovato con Prompts MCP Server.

Domande frequenti

A cosa serve il server MCP Prompts MCP Server?

Prompts MCP Server è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare il server MCP Prompts MCP Server con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Prompts MCP Server con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Prompts MCP Server con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Prompts MCP Server, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego il server MCP Prompts MCP Server a TypingMind?

Prompts MCP Server funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre il server MCP Prompts MCP Server in TypingMind?

Prompts MCP Server mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare il server MCP Prompts MCP Server?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Prompts MCP Server richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇