Skip to main content
Glama

PromptLab MCP Server

by iRahulPandey

PromptLab: AIクエリ拡張エンジン

PromptLabは、基本的なユーザークエリをAIシステム向けに最適化されたプロンプトに変換します。コンテンツの種類(エッセイ、メール、技術説明、クリエイティブライティング)を自動的に検出し、カスタマイズされたテンプレートを適用し、強化されたプロンプトが元の意図を維持しているかどうかを検証します。

🔍 概要

PromptLabは、YAMLベースのテンプレートシステムを備えたモジュール式アーキテクチャ上に構築されており、コーディングの知識がなくても誰でもプロンプトテンプレートを作成・管理できます。このシステムは、より構造化された入力を通じて、より高品質なAI応答を生成します。

🏗️ 建築

PromptLab は 3 つの主要コンポーネントで構成されています。

  1. テンプレート システム( prompt_templates.yaml ) - さまざまなコンテンツ タイプ用の構造化テンプレート
  2. MCP サーバー( promptlab_server.py ) - LangGraph ワークフローを使用して標準化されたプロトコルを通じてテンプレートを提供します。
  3. 処理クライアント( promptlab_client.py ) - ユーザークエリを処理するシンクライアント

ワークフロープロセス

  1. クエリ入力: ユーザーが自然言語クエリを送信する
  2. 分類: システムがコンテンツの種類 (エッセイ、電子メールなど) を決定します。
  3. パラメータ抽出: 主要なパラメータが識別されます (トピック、対象者など)
  4. テンプレートアプリケーション: 適切なテンプレートが取得され、入力されます
  5. 検証: 強化されたプロンプトは元の意図と照合されます
  6. 調整: 必要な調整は自動的に行われます
  7. 応答生成:最適化されたプロンプトは高品質の応答を生成します

代替テキスト

📋 機能

  • コンテンツタイプの検出- ユーザークエリをエッセイ、メール、技術、またはクリエイティブライティングのリクエストに自動的に分類します
  • パラメータ抽出- トピック、受信者、オーディエンスレベルなどの主要なパラメータをインテリジェントに抽出します
  • テンプレートライブラリ- 構造化されたガイダンスを備えた一般的なコンテンツタイプ用の事前構成されたテンプレート
  • 検証システム- 強化されたプロンプトが元のユーザーの意図を維持することを保証します
  • フィードバックループ- 検証で不整合が特定されたときにプロンプトを調整します
  • モジュラー設計- MCPサーバーはあらゆるLLMシステムに接続可能
  • 非技術的な管理- コーディングの知識がなくてもテンプレートを更新できます

🚀 はじめに

前提条件

  • Python 3.8以上
  • 依存関係:
    • mcp[cli]
    • langchain-openai
    • langgraph>=0.0.20
    • python-dotenv
    • pyyaml

インストール

# Clone the repository git clone https://github.com/iRahulPandey/PromptLab.git cd PromptLab # Install dependencies pip install -r requirements.txt # Set up environment variables cp .env # Edit .env to add your OpenAI API key

使用法

  1. まずサーバーを実行します。
# The server loads templates from prompt_templates.yaml python promptlab_server.py
  1. クエリを使用してクライアントを実行します。
python promptlab_client.py "Write an essay about climate change"
  1. システムは以下を出力します:
    • 元のクエリ
    • 分類されたコンテンツの種類
    • 強化されたプロンプト
    • 検証結果
    • 最終回答

📝 テンプレートシステム

テンプレートは、 prompt_templates.yamlで構造化された形式を使用して定義されます。

templates: essay_prompt: description: "Generate an optimized prompt template for writing essays." template: | Write a well-structured essay on {topic} that includes: - A compelling introduction that provides context and states your thesis ... parameters: - name: topic type: string description: The topic of the essay required: true

新しいテンプレートの追加

  1. prompt_templates.yamlを開く
  2. 既存の形式に従って新しいテンプレートを追加する
  3. パラメータと変換を定義する
  4. サーバー側でツールを定義し、テンプレートをロードする
  5. サーバーは再起動時に新しいテンプレートを自動的に読み込みます

🛠️ 高度な設定

環境変数

  • TEMPLATES_FILE - テンプレート YAML ファイルへのパス (デフォルト: prompt_templates.yaml )
  • OPENAI_API_KEY - LLM アクセス用の OpenAI API キー
  • MODEL_NAME - 使用するOpenAIモデル(デフォルト: gpt-3.5-turbo
  • PERSONA_SERVER_SCRIPT - サーバー スクリプトへのパス (デフォルト: promptlab_server.py )

カスタム変換

テンプレートには、パラメータを動的に調整する変換を含めることができます。

transformations: - name: formality value: "formal if recipient_type.lower() in ['boss', 'client'] else 'semi-formal'"

📊 出力例

入力クエリ

「教授のために再生可能エネルギーについて何か書いてください」

強化されたプロンプト

Write a well-structured essay on renewable energy that includes: - A compelling introduction that provides context and states your thesis - 2-3 body paragraphs, each with a clear topic sentence and supporting evidence - Logical transitions between paragraphs that guide the reader - A conclusion that synthesizes your main points and offers final thoughts The essay should be informative, well-reasoned, and demonstrate critical thinking.

📄 ライセンス

MITライセンス - 詳細はLICENSEファイルを参照

🤝 貢献する

貢献を歓迎します!お気軽にプルリクエストを送信してください。

  1. リポジトリをフォークする
  2. 機能ブランチを作成します( git checkout -b feature/amazing-feature
  3. 変更をコミットします ( git commit -m 'Add some amazing feature' )
  4. ブランチにプッシュする ( git push origin feature/amazing-feature )
  5. プルリクエストを開く
-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

基本的なユーザークエリを AI システム向けに最適化されたプロンプトに変換するための標準化されたプロトコルを通じてプロンプト テンプレートを提供します。

  1. 🔍 概要
    1. 🏗️ 建築
      1. ワークフロープロセス
    2. 📋 機能
      1. 🚀 はじめに
        1. 前提条件
        2. インストール
        3. 使用法
      2. 📝 テンプレートシステム
        1. 新しいテンプレートの追加
      3. 🛠️ 高度な設定
        1. 環境変数
        2. カスタム変換
      4. 📊 出力例
        1. 入力クエリ
        2. 強化されたプロンプト
      5. 📄 ライセンス
        1. 🤝 貢献する

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            Allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.
            Last updated -
            1
            580
            Python
            MIT License
            • Linux
            • Apple
          • A
            security
            A
            license
            A
            quality
            Enables creation, management, and templating of prompts through a simplified SOLID architecture, allowing users to organize prompts by category and fill in templates at runtime.
            Last updated -
            6
            1,385
            6
            TypeScript
            MIT License
            • Apple
            • Linux
          • -
            security
            F
            license
            -
            quality
            Enables AI assistants to interact with Metabase databases and dashboards, allowing users to list and execute queries, access data visualizations, and interact with database resources through natural language.
            Last updated -
            25
            JavaScript
            • Apple
          • -
            security
            F
            license
            -
            quality
            Enables AI assistants to interact with Metabase, providing access to dashboards, questions, databases, and tools for executing queries and viewing data through natural language.
            Last updated -
            JavaScript
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/iRahulPandey/PromptLab'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server