Auto-detects Express framework and includes relevant patterns for Express-specific backend development.
Integrates with Git to include recent changes and commit history in context when relevant to the current task.
Auto-detects Next.js framework and includes relevant patterns and context for Next.js-specific development tasks.
Auto-detects React framework and includes relevant patterns and context for React-specific development tasks.
MCP Prompt Enhancer
A Model Context Protocol (MCP) server for intelligent prompt preprocessing with adaptive context management.
Overview
The MCP Prompt Enhancer intelligently analyzes your codebase and enhances LLM prompts with relevant context to produce higher quality AI responses. It features:
- Two-tier Context System: Initial full project analysis combined with task-focused context tracking
- Adaptive Context Intelligence: Only provides relevant context based on the current task
- Context Caching: Reuses analyzed project information instead of reprocessing
- Task Detection: Automatically infers task type from prompts (page creation, debugging, refactoring, etc.)
- Git Integration: Includes recent changes and commit history when relevant
- Framework Detection: Auto-detects React, Vue, Next.js, etc. and includes relevant patterns
Installation
Quick Start
The MCP Prompt Enhancer now uses STDIO for communication instead of a network server:
The server analyzes the current directory by default and responds with JSON output.
Usage with Claude
The MCP Prompt Enhancer now uses STDIO for communication, making it easier to integrate with Claude. This approach eliminates network dependencies and simplifies the integration process.
Using with Claude
To use the MCP Prompt Enhancer with Claude:
- Start the server in a background process:
- Send JSON requests to the server via STDIO:
- Parse the JSON response to extract the enhanced prompt.
Claude Integration Example
Here's how to integrate with Claude using a wrapper script:
This wrapper can be used to integrate the MCP Prompt Enhancer with Claude or any other system.
API
STDIO JSON Protocol
The server accepts JSON requests via standard input and responds with JSON via standard output.
Request Format
Response Format
Available Actions
enhance_prompt
Enhances a prompt with relevant project context.
Request Parameters:
Response (Success):
set_project_context
Manually refreshes or sets the project context.
Request Parameters:
Response (Success):
Configuration
Create a mcp-prompt-enhancer.config.js
file in your project root:
You can also use environment variables:
MCP_LOG_LEVEL
: Set the logging level
How It Works
- Project Analysis: Scans your project structure, detects frameworks, and extracts key patterns
- Task Detection: Analyzes prompts to determine the type of work being done
- Context Selection: Intelligently selects relevant files and information based on the task
- Prompt Enhancement: Combines the original prompt with targeted context
- Continuous Learning: Updates its understanding as you work on different parts of the codebase
See the architecture diagram for a detailed visual representation of how the MCP Prompt Enhancer works with Cline (Anthropic's CLI for Claude).
Development
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be installed
Intelligently analyzes codebases to enhance LLM prompts with relevant context, featuring adaptive context management and task detection to produce higher quality AI responses.
Related MCP Servers
- AsecurityAlicenseAqualityEnables integration of Perplexity's AI API with LLMs, delivering advanced chat completion by utilizing specialized prompt templates for tasks like technical documentation, code review, and API documentation.Last updated -15788JavaScriptMIT License
- -securityFlicense-qualityFacilitates enhanced interaction with large language models (LLMs) by providing intelligent context management, tool integration, and multi-provider AI model coordination for efficient AI-driven workflows.Last updated -Python
- AsecurityAlicenseAqualityChat with your codebase through intelligent code searching without embeddings by breaking files into logical chunks, giving the LLM tools to search these chunks, and letting it find specific code needed to answer your questions.Last updated -850PythonMIT License
- -securityAlicense-qualityAn MCP server that analyzes codebases and generates contextual prompts, making it easier for AI assistants to understand and work with code repositories.Last updated -10PythonMIT License