Prompt Gen Mcp

by prompt-gen-mcp

336 downloads
Not rated
GitHub

About

Transform simple questions into comprehensive, context-aware prompts

Details

Author
prompt-gen-mcp
Downloads
336
Categories
Other

- Local code context scanning (100% private, code never leaves your machine)
- AI-powered selection of optimal prompt engineering techniques
- Structured enhanced output with relevance scoring and code examples
- Integration with Cursor IDE via true MCP architecture
- Fallback support for offline operation

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Prompt Gen Mcp
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install dependencies (pip install mcp sentence-transformers httpx groq), obtain API keys (PromptGen, GROQ, Tavily), configure Cursor’s MCP settings file with the server command and environment variables, then restart Cursor. Once running, press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux) and invoke the MCP: enhance_prompt command with your question.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "prompt gen mcp": {
            "prompt-gen": {
                "command": "python",
                "args": [
                    "/full/path/to/prompt-gen-mcp/src/prompt_gen_mcp/server.py"
                ],
                "env": {
                    "GROQ_API_KEY": "gsk_your_groq_api_key_here",
                    "TAVILY_API_KEY": "tvly_your_tavily_api_key_here",
                    "PROMPTGEN_API_KEY": "pg_sk_your_promptgen_api_key_here"
                }
            }
        }
    }
}

McpServers

{
    "prompt-gen": {
        "command": "python",
        "args": [
            "/full/path/to/prompt-gen-mcp/src/prompt_gen_mcp/server.py"
        ],
        "env": {
            "GROQ_API_KEY": "gsk_your_groq_api_key_here",
            "TAVILY_API_KEY": "tvly_your_tavily_api_key_here",
            "PROMPTGEN_API_KEY": "pg_sk_your_promptgen_api_key_here"
        }
    }
}

PromptGen MCP - Local Server

Transform simple questions into comprehensive, context-aware prompts using advanced prompt engineering techniques fetched from PromptGen API and your local code context.

πŸš€ Quick Start

1. Get Your PromptGen API Key

1. Visit: https://promptgenmcp-production.up.railway.app 2. Sign up and generate your API key 3. Copy your API key starting with pg_sk_

2. Get Other Required API Keys

- GROQ API Key: Get from https://console.groq.com/ - Tavily API Key: Get from https://tavily.com/

3. Install Dependencies

# Navigate to the directory
cd prompt-gen-mcp

Install dependencies

pip install mcp sentence-transformers httpx groq

4. Configure Cursor

Copy the configuration to your Cursor MCP settings file (~/.cursor/mcp_servers.json):
{
  "mcpServers": {
    "prompt-gen": {
      "command": "python",
      "args": ["/full/path/to/prompt-gen-mcp/src/prompt_gen_mcp/server.py"],
      "env": {
        "PROMPTGEN_API_KEY": "pg_sk_your_key_here",
        "GROQ_API_KEY": "gsk_your_groq_key_here", 
        "TAVILY_API_KEY": "tvly_your_tavily_key_here"
      }
    }
  }
}

Important: Replace /full/path/to/prompt-gen-mcp/ with the actual full path to this directory.

5. Restart Cursor

Completely restart Cursor (not just reload) for the MCP server to be recognized.

6. Start Using

1. Open any project in Cursor 2. Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux) 3. Type: "MCP: enhance_prompt" 4. Ask: "How do I optimize this React component?"

πŸ’‘ What You Get

πŸ”„ Transformation Example

| Before | After |
|------------|----------|
| "How do I optimize this React component?" | Comprehensive Enhanced Prompt |

Enhanced Output:

# πŸš€ Enhanced Prompt for: How do I optimize this React component?

πŸ” Question Analysis

- Types: optimization, implementation - Complexity: medium - Domain: frontend - Intent: optimize performance

🎯 Selected Prompt Engineering Techniques

1. πŸ“‹ Plan and Solve (Score: 0.847)

Description: Break down complex problems into structured planning and systematic solving phases

Application: Plan: Identify optimization targets. Solve: Apply specific React patterns.

2. πŸ“š Few-Shot Learning (Score: 0.823)

Description: Provide examples to guide the response

Application: Here are optimization examples: useMemo, React.memo, useCallback...

πŸ“ Relevant Code Context

File 1: src/components/UserProfile.tsx (Relevance: 0.892)

typescript const UserProfile = ({ userId }) => { const [user, setUser] = useState(null); useEffect(() => { fetchUser(userId).then(setUser); }, [userId]); return <div>{user?.name}</div>; };

✨ Enhanced Analysis Request

[Structured instructions for comprehensive response with context-aware suggestions...]

πŸ“Š Feature Comparison

| Feature | Basic Prompt | Enhanced Prompt |
|---------|-------------|----------------|
| Context Awareness | ❌ None | βœ… Full codebase context |
| Technique Selection | ❌ Manual | βœ… AI-powered optimal selection |
| Privacy | ⚠️ Varies | βœ… Code stays local |
| Structured Output | ❌ Basic | βœ… Comprehensive analysis |
| Code Examples | ❌ Generic | βœ… From your actual project |
| Relevance Scoring | ❌ None | βœ… Semantic similarity matching |

πŸ”’ Architecture & Privacy

- 🏠 Local Processing: All code scanning happens on your machine
- 🌐 API Integration: Only technique selection uses PromptGen API
- πŸ”’ No Code Shared: Your code never leaves your machine
- 🎯 Smart Selection: AI chooses optimal techniques from hosted database
- πŸ“ Context Aware: Automatically includes relevant code from your project

βš™οΈ How It Works

Architecture Overview

mermaid
flowchart TD
A[User Question] --> B[Local MCP Server]
B --> C[Code Context Scanner]
B --> D[PromptGen API]
C --> E[Local Code Analysis]
D --> F[Technique Selection]
E --> G[Enhanced Prompt]
F --> G
G --> H[User Receives Enhanced Prompt]

style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#e8f5e8
style D fill:#fff3e0
style G fill:#fce4ec
style H fill:#e0f2f1

Interaction Flow

mermaid
sequenceDiagram
participant U as User
participant M as MCP Server
participant C as Code Scanner
participant P as PromptGen API
participant Q as Qdrant DB

U->>M: Ask question
M->>C: Scan local workspace
M->>P: Request techniques for question
P->>Q: Query vectorized techniques
Q-->>P: Return relevant techniques
C-->>M: Local code context
P-->>M: Optimal techniques
M->>M: Combine context + techniques
M->>U: Enhanced prompt with context

Note over C,M: Code never leaves your machine
Note over P,Q: Only question text sent to API

Privacy-First Flow:
1. Local MCP scans your code privately on your machine
2. PromptGen API provides optimal techniques from hosted Qdrant database
3. Local processing combines everything into enhanced prompt
4. No code leaves your machine - only question text sent to get techniques

🎯 Use Cases

- Code Optimization: Get structured analysis with relevant code context
- Architecture Decisions: Receive comprehensive comparisons with examples
- Debugging Help: Get systematic debugging approaches with code snippets
- Learning: Understand concepts with examples from your actual codebase

πŸ”§ Troubleshooting

MCP Server Not Working:

bash

Test the server directly


python src/prompt_gen_mcp/server.py

Check dependencies

pip install mcp sentence-transformers httpx groq ``

API Key Issues:
- Ensure
PROMPTGEN_API_KEY starts with pg_sk_
- Get valid GROQ key from https://console.groq.com/
- Get valid Tavily key from https://tavily.com/

Cursor Not Finding MCP:
- Ensure complete Cursor restart (not just reload)
- Check
~/.cursor/mcp_servers.json` syntax
- Verify file paths are absolute
- Look for MCP status in Cursor's bottom status bar

No Code Context:
- Ensure you're in a project directory
- Check file permissions
- Verify supported file types (.py, .js, .ts, .tsx, .jsx, .md, .txt)

πŸ“Š Features

- βœ… PromptGen API Integration (hosted technique database)
- βœ… Local Code Context Scanning (100% private)
- βœ… Privacy-Preserving Architecture
- βœ… Intelligent Technique Selection
- βœ… LLM-Powered Question Analysis
- βœ… True MCP Architecture (self-contained)
- βœ… Fallback Support (works offline)

πŸ—οΈ Architecture Benefits

Proper MCP Design:
- βœ… Single self-contained server process
- βœ… Cursor manages server lifecycle automatically
- βœ… No manual background service management
- βœ… Clean startup/shutdown with Cursor

API Integration:
- βœ… Uses PromptGen API for techniques (no local llms.txt)
- βœ… Hosted Qdrant database with vectorized techniques
- βœ… User authentication via API keys
- βœ… Usage tracking and billing support

🀝 Contributing

1. Fork the repository
2. Create your feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request

πŸ“„ License

MIT License - see LICENSE file for details.

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.