PromptLab

PromptLab transforms basic user queries into optimized prompts for AI systems --> Built using MCP
  • python

7

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "irahulpandey-promptlab": {
      "command": "python",
      "args": [
        "promptlab_server.py"
      ],
      "env": {
        "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY"
      }
    }
  }
}

You will run PromptLab as an MCP server that turns natural language queries into optimized prompts for AI systems, leveraging MLflow for prompt management and a dynamic matching workflow to produce high-quality responses.

How to use

Start the server on your machine using Python with the built-in server workflow. You will interact with the server through the lightweight client to submit natural language queries, list available prompts, and observe detailed prompt matching information. The system loads all registered prompts at startup, matches your query to the best template, extracts required parameters, applies the template, validates the result, and generates an optimized response.

How to install

Prerequisites: You need Python 3.12 installed on your machine and an OpenAI API key for LLM capabilities. You also need to install project dependencies listed in the requirements file.

Step-by-step commands you will run:

# Clone the repository
git clone https://github.com/iRahulPandey/PromptLab.git
cd PromptLab

# Install dependencies
pip install -r requirements.txt

# Set API key
export OPENAI_API_KEY="your-openai-api-key"

Additional sections

Prompt management and server behavior are organized around three core components: the registry tool for prompts, the server that processes queries with the LangGraph workflow, and the client that provides a simple interface for users. You will register prompts, load them on startup, and rely on dynamic matching to select and apply the best template for each query.

Prompts are versioned and aliased with production and archived states to support rollback and history tracking. You can initialize standard prompts and add new types by registering prompts from files or JSON data, then verify what is registered. When you update a prompt, the previous production version is archived and the new version becomes production.

Usage with the client lets you process queries, list available prompts, and enable verbose output to inspect how values are extracted and how prompts are chosen. The system supports a wide range of prompt types, such as essay, email, technical, creative, code, and more, each with its own template structure and variable placeholders.

Troubleshooting and notes

If no matching prompt is found for a query, the system logs the mismatch and still returns a result using the original query. Increase prompt variety to improve matching. If the LLM service is unavailable, the system falls back to keyword-based matching and basic prompt enhancement to maintain functionality.

Available tools

load_all_prompts

Load all available prompts from the MLflow prompt registry at server startup.

match_prompt

Dynamically analyze a user query to determine the most suitable prompt template.

enhance_query

Apply the selected prompt template to the extracted parameters to produce an enhanced prompt.

validate_query

Validate the enhanced prompt and adjust it if needed before generating a response.

LangGraph workflow

Orchestrate the end-to-end prompt enhancement process within the server.

register_prompt

Register a new prompt or update an existing one in the MLflow registry.

update_prompt

Archive the previous production version when updating a prompt and promote the new version to production.

list_prompts

List all registered prompts and their metadata in MLflow.

details

Show detailed information about a specific prompt by name.

register_from_file

Register multiple prompts from a JSON file or data source.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational