Skip to main content

Prompt Engine

Prompt Engine is a production-ready prompt optimization middleware that takes raw prompts, decomposes intent, applies skills, assembles a higher-signal prompt, and optionally sends it to an LLM provider.

It is designed to work as:

  • an MCP server for Cursor, Claude Code, and other agents
  • a Python SDK
  • a FastAPI service
  • a CLI for developers and AI agents
  • a pluggable prompt transformation platform

Core capabilities

  • Intent detection with rule-based classification and an LLM-classifier extension point
  • Prompt decomposition into goal, constraints, expected output, and missing information
  • Skill-driven prompt enrichment and conflict-aware ordering
  • Structured output enforcement and hallucination guards
  • Provider-agnostic execution with retry, timeout, fallback, and stream interfaces
  • MCP tools and prompts over stdio and Streamable HTTP
  • Prompt diffs, heuristic optimization scoring, tracing, and Prometheus metrics
  • Eval harness that runs in CI when skills or prompt logic change

Project structure

backend/prompt_engine/
  api/             FastAPI application, schemas, rate limiting
  core/            prompt decomposition and compilation
  engine/          intent detection and orchestration
  evals/           evaluation runner and scoring logic
  mcp/             MCP server, tools, prompts, and HTTP app
  observability/   tracing and metrics
  pipeline/        skill execution pipeline
  providers/       mock, OpenAI, Anthropic, OpenRouter adapters
  skills/          skill contracts, registry, built-in skills

config/
  config.yaml      default runtime configuration

evals/
  test_cases.json  sample evaluation corpus
  runner.py        top-level evaluation entrypoint
  scoring.py       scoring entrypoint

sdk/
  python/          usage examples for the Python SDK
  typescript/      API client SDK

examples/
  cursor/          Cursor MCP config examples
  claude-code/     Claude Code MCP setup notes

skills/
  README.md        external plugin authoring guide

tests/
  unit and API smoke tests

extensions/
  vscode-prompt-engine/  VS Code and Cursor extension
  chrome-prompt-engine/  Chrome extension for browser prompt rewriting

Quick start

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
vibe-prompt-engine run "Extract the customer objections from this transcript and return JSON."
uvicorn prompt_engine.api.app:app --reload
vibe-prompt-engine mcp cursor-config --transport stdio
python evals/runner.py

Extensions

Prompt Engine now ships with first-party extension clients:

VS Code or Cursor local test:

cd extensions/vscode-prompt-engine
npm install
npm run build
npm run package

Then install vibe-prompt-engine-vscode-0.1.5.vsix from:

  • VS Code: Extensions: Install from VSIX...
  • Cursor: Extensions: Install from VSIX...

Chrome local test:

  1. Open chrome://extensions
  2. Enable Developer Mode
  3. Click Load unpacked
  4. Select extensions/chrome-prompt-engine

The Chrome extension now injects a persistent inline toolbar beside ChatGPT-style prompt fields, with Optimize and Tune controls for prompt style settings, and rewrites the current prompt in place without opening the popup.

Both clients default to the hosted production endpoint:

https://prompt-engine-mcp-pewnieev4a-el.a.run.app

MCP quick start

Local stdio server for Cursor:

uvx vibe-prompt-engine mcp stdio

Local or hosted Streamable HTTP server:

vibe-prompt-engine mcp http --host 127.0.0.1 --port 8001 --path /mcp

The FastAPI app also mounts MCP at /mcp, so this works too:

uvicorn prompt_engine.api.app:app --reload --host 0.0.0.0 --port 8000

Then point Cursor to:

  • command: vibe-prompt-engine
  • args: ["mcp", "stdio"]

Or point Cursor to:

  • url: http://127.0.0.1:8000/mcp

You can print ready-to-paste Cursor config:

vibe-prompt-engine mcp cursor-config --transport stdio
vibe-prompt-engine mcp cursor-config --transport http --url http://127.0.0.1:8000/mcp

Public release strategy

For real public adoption, ship Prompt Engine in two channels:

  1. PyPI for local stdio MCP installs via uvx or pipx
  2. Hosted Streamable HTTP MCP at https://api.your-domain.com/mcp

Recommended rollout:

  1. Publish Python package to PyPI
  2. Publish container image to GHCR
  3. Deploy hosted image to Cloud Run
  4. Give users either:
    • local config using uvx vibe-prompt-engine mcp stdio
    • or hosted config using https://api.your-domain.com/mcp

Until PyPI trusted publishing is configured, users can install directly from GitHub:

uvx --from git+https://github.com/adaline-ankit/prompt-engine vibe-prompt-engine mcp stdio

Or with pipx:

pipx install git+https://github.com/adaline-ankit/prompt-engine.git
vibe-prompt-engine mcp stdio

Release automation and deployment notes are in RELEASE.md and deploy/cloudrun/README.md.

Repository

CLI examples

vibe-prompt-engine run "Refactor this Python function to reduce branching."
vibe-prompt-engine run "Classify each support ticket by severity and return JSON." --json
vibe-prompt-engine run "Summarize this design doc" --run-llm --provider mock --stream
vibe-prompt-engine mcp http --host 127.0.0.1 --port 8001

API examples

Optimize:

curl -X POST http://localhost:8000/optimize \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Extract the account owner, ARR, and renewal date from this note.",
    "context": {
      "output_schema": {
        "type": "object",
        "properties": {
          "account_owner": {"type": "string"},
          "arr": {"type": "number"},
          "renewal_date": {"type": "string"}
        },
        "required": ["account_owner", "arr", "renewal_date"]
      }
    }
  }'

Run against a provider:

curl -X POST http://localhost:8000/run \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Summarize this incident report in bullet points.",
    "provider": "mock",
    "model": "mock-gpt"
  }'

MCP over HTTP is available at:

http://localhost:8000/mcp

SDK examples

Python:

from prompt_engine import PromptOptimizationEngine

engine = PromptOptimizationEngine()
result = engine.optimize_prompt(
    "Extract product names, pricing, and discount terms from this email.",
    context={"output_schema": {"type": "object"}},
)
print(result.final_prompt)

TypeScript:

import { PromptEngineClient } from "./sdk/typescript/src";

const client = new PromptEngineClient({ baseUrl: "http://localhost:8000" });
const result = await client.optimize({
  prompt: "Classify these support tickets by severity.",
});
console.log(result.skills_applied);

Providers

  • mock works locally with no API key and is used in tests and examples.
  • openai, anthropic, and openrouter are implemented behind a common provider contract.
  • Set OPENAI_API_KEY, ANTHROPIC_API_KEY, or OPENROUTER_API_KEY to enable remote execution.

Plugins

Prompt Engine loads built-in skills and can load external Python skill modules from paths listed in config/config.yaml.

See skills/README.md for the contract.

MCP tools

Prompt Engine exposes these MCP tools:

  • optimize_prompt
  • optimize_and_run
  • explain_transformations
  • suggest_output_schema
  • list_skills

It also exposes MCP prompts:

  • optimize_task
  • extract_json

Deployment

  • Local development via CLI or uvicorn
  • Containerized deployment via Dockerfile and docker-compose.yml
  • Cloud-ready for ECS, EKS, Cloud Run, Railway, or any ASGI-compatible platform

Metadata

Release files for vibe-prompt-engine 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vibe-prompt-engine 0.1.5
File Size Uploaded Provenance
vibe_prompt_engine-0.1.5.tar.gz 41.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for vibe-prompt-engine 0.1.5
File Interpreter ABI Platform
vibe_prompt_engine-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 89.7 kB

Release files / vibe_prompt_engine-0.1.5.tar.gz

Download URL vibe_prompt_engine-0.1.5.tar.gz
Size 41.3 kB
Tags Source
SHA-256 checksum
How to use checksums
040d77958b0e46235e3d3567df9f8912eefb811d5a63a4253e34ca9ccd589cdf
BLAKE2b-256 checksum
How to use checksums
45f572e3d185415caf41089f9422760a78553ffc5a6ce6d55ddacfeb252f75d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 20, 2026.

Transparency log

Release files / vibe_prompt_engine-0.1.5-py3-none-any.whl

Download URL vibe_prompt_engine-0.1.5-py3-none-any.whl
Size 48.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cdcc09192f684d780d656b19627a9d6a7b472bf37e0ab853a7b34497a47062bf
BLAKE2b-256 checksum
How to use checksums
5e24525d4ec8356544e7a84946a96e27be9aec4e8e067911f90a7b0a09170f4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 20, 2026.

Transparency log

Security for vibe-prompt-engine 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vibe_prompt_engine-0.1.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page