Skip to main content
Glama

Advanced Prompting Engine

CI PyPI version Python License: MIT

A universal prompt creation engine delivered as an MCP server. Measures intent across 12 philosophical dimensions and returns a construction basis from which the client constructs prompts.

The engine does not generate prompts. It provides the dimensional foundation — active constructs, spectrum opposites, tensions, gems, spokes, harmonization pairs, and construction questions — that make prompt construction principled rather than heuristic.

Quick Start

# Install
pip install advanced-prompting-engine

# Or run directly via uvx
uvx advanced-prompting-engine

MCP Configuration

Add to your .mcp.json:

{
  "mcpServers": {
    "advanced-prompting-engine": {
      "command": "uvx",
      "args": ["advanced-prompting-engine"]
    }
  }
}

Related MCP server: MCP Prompt Optimizer

What It Does

The engine positions your intent in a 12-dimensional philosophical manifold:

Face

Sub-dimensions

Phase

Ontology

Particular ↔ Universal, Static ↔ Dynamic

Comprehension

Epistemology

Empirical ↔ Rational, Certain ↔ Provisional

Comprehension

Axiology

Absolute ↔ Relative, Quantitative ↔ Qualitative

Comprehension

Teleology

Immediate ↔ Ultimate, Intentional ↔ Emergent

Comprehension

Phenomenology

Objective ↔ Subjective, Surface ↔ Deep

Comprehension

Ethics

Deontological ↔ Consequential, Agent ↔ Act

Evaluation

Aesthetics

Autonomous ↔ Contextual, Sensory ↔ Conceptual

Evaluation

Praxeology

Individual ↔ Coordinated, Reactive ↔ Proactive

Application

Methodology

Analytic ↔ Synthetic, Deductive ↔ Inductive

Application

Semiotics

Explicit ↔ Implicit, Syntactic ↔ Semantic

Application

Hermeneutics

Literal ↔ Figurative, Author-intent ↔ Reader-response

Application

Heuristics

Systematic ↔ Intuitive, Conservative ↔ Exploratory

Application

Each face is a 12x12 grid of 144 epistemic observation points. Position determines classification (corner/midpoint/edge/center), potency, and spectrum membership. The 12 faces are organized as 6 complementary pairs (cube model) with harmonization through shared surfaces. The engine computes tensions via positional correspondence, gems (inter-face integrations) with cube tier modulation, spokes (per-face behavioral signatures), and a central gem coherence score.

Tools

Tool

Purpose

create_prompt_basis

Primary — intent or coordinate in, construction basis out

interpret_basis

Interpretation — plain-language reading of a construction basis

explore_space

Expert — graph traversal, stress testing, triangulation

extend_schema

Authoring — add constructs and relations with contradiction detection

Example: Natural Language Intent

create_prompt_basis(intent="Design an ethical framework for autonomous vehicle decision-making")

The engine locates this intent across all 12 philosophical dimensions and returns:

{
  "coordinate": {
    "epistemology":  {"x": 4, "y": 4, "weight": 0.76},
    "ontology":      {"x": 6, "y": 5, "weight": 0.73},
    "praxeology":    {"x": 7, "y": 4, "weight": 0.72},
    "heuristics":    {"x": 5, "y": 3, "weight": 0.66},
    "phenomenology": {"x": 7, "y": 4, "weight": 0.61},
    "ethics":        {"x": 6, "y": 4, "weight": 0.53},
    "...": "...all 12 faces with (x,y) position and relevance weight"
  },
  "harmonization": [
    {"pair": ["ontology", "praxeology"], "resonance": 0.15},
    {"pair": ["axiology", "ethics"],     "resonance": 0.05},
    "...6 complementary pairs with resonance scores"
  ],
  "spokes": {
    "ontology":      {"classification": "weakly_integrated", "strength": 0.042},
    "epistemology":  {"classification": "weakly_integrated", "strength": 0.039},
    "...": "...per-face behavioral signatures"
  },
  "central_gem": {"coherence": 0.69, "classification": "highly_coherent"},
  "construction_questions": {
    "ethics": {
      "template": "What moral obligations does this prompt impose or assume?",
      "position_summary": "balanced Deontological/Consequential + moderately Agent-focused",
      "meaning_mechanism": "composition",
      "phase": "evaluation"
    },
    "...": "...12 position-specific philosophical questions to guide prompt construction"
  }
}

The output tells you: this intent is primarily about knowledge validation (epistemology 0.76), what entities exist (ontology 0.73), and action structure (praxeology 0.72). Ethics registers at 0.53 — present but not dominant. The harmonization shows ontology and praxeology resonate strongly (0.15) — the theoretical "what exists" aligns with the practical "how to act."

Example: Pre-formed Coordinate

For precise control, pass a coordinate directly:

coordinate = {
    "ontology": {"x": 0, "y": 0, "weight": 1.0},      # corner: particular + static
    "ethics": {"x": 0, "y": 11, "weight": 0.9},         # corner: deontological + act
    "methodology": {"x": 0, "y": 0, "weight": 0.8},     # corner: analytic + deductive
    # ...all 12 faces with x (0-11), y (0-11), weight (0-1)
}
result = create_prompt_basis(coordinate=coordinate)

Architecture

  • Stack: Python + NetworkX (topology) + numpy (computation) + SQLite (persistence) + MCP SDK

  • Graph: 1873 nodes, 2279 edges (12 faces × 144 constructs + 132 nexi + 1 central gem)

  • Pipeline: 8 stages (Intent Parser → Coordinate Resolver → Position Computer → Construct Resolver → Tension Analyzer → Nexus/Gem Analyzer → Spoke Analyzer → Construction Bridge)

  • Geometry: Vector Equilibrium (cuboctahedron) as latent inter-face topology, cube model for 6 complementary pairs

  • Deployment: Single process, stdio transport, no daemon, no external dependencies

Documentation

  • docs/DESIGN.md — Full design specification

  • docs/CONSTRUCT-v2.md — The Construct specification (what faces, points, spectrums, nexi, gems, spokes ARE)

  • docs/CONSTRUCT-v2-questions.md — 144 construction question templates by zone

  • docs/adr/ — 13 Architecture Decision Records

Development

pip install -e ".[dev]"
pytest tests/ -v

Rebuilding the semantic bridge (optional)

The shipped package includes pre-computed BGE-derived artifacts (semantic_bridge.npz, semantic_vocab.json). To rebuild them from scratch (e.g., after pole-synonym edits), install the build extras:

pip install -e ".[build]"
python -m nltk.downloader wordnet omw-1.4
python scripts/build_semantic_bridge.py

The build uses BAAI/bge-large-en-v1.5 (~1.3 GB, downloaded once to HuggingFace cache) and wordfreq for frequency ordering. Runtime dependencies are unaffected — end users only receive the pre-computed artifacts.

Contributing

See CONTRIBUTING.md for development setup and guidelines.

Security

See SECURITY.md for vulnerability reporting instructions.

License

MIT

How this plugin runs its MCP server (shared background service)

Claude Code normally starts a private copy of a plugin's MCP server for every open session. This plugin instead runs one shared copy per machine: its MCP entry launches shared_mcp.py connect, which on first use creates a small Python environment under ~/.local/state/shared-mcp/, registers a login-time background service (launchd on macOS, systemd --user on Linux, a detached process elsewhere) that runs the server once and serves it to every session over HTTP on 127.0.0.1 only, and then connects. Later sessions just connect. The first run prints a one-line notice.

If a background service cannot be set up (no network, no service manager, an unusual OS), the original server runs directly as before — never a broken plugin. To opt out permanently set SHARED_MCP_DISABLE=1 in your environment; to remove the service run python3 <plugin>/shared_mcp.py stop --name advanced-prompting-engine. State, logs and the service definition live under ~/.local/state/shared-mcp/advanced-prompting-engine/. The kit is the single file shared_mcp.py vendored into this plugin; source, tests and design notes: https://github.com/JoshuaRamirez/shared-mcp

Available Tools

4 tools
create_prompt_basisA

Measure intent across 12 philosophical dimensions and return a construction basis.

Use this before constructing any prompt where dimensional precision, philosophical coherence, or systematic completeness matters.

Provide either 'intent' (natural language) or 'coordinate' (JSON object with 12 faces, each having x, y, weight).

Output modes (mutually exclusive, focused takes priority):

  • Default: full output (~50KB) with all pipeline data

  • compact=true: summary fields only (~2KB)

  • focused=true: guidance-centric output (~500 bytes) with dominant dimensions, gaps, resonance, and coherence — what a prompt engineer needs

Inputs: intent, coordinate, compact, focused. Returns: result

explore_spaceC

Explore the philosophical manifold. Operations: list_faces, list_constructs, get_construct, get_neighborhood, find_path, get_spoke, stress_test, triangulate.

Inputs: operation (required), face, x, y, +8 more. Returns: result

extend_schemaC

Add constructs or relations to the graph. Contradiction detection is automatic.

Operations: add_construct, add_relation.

Inputs: operation (required), face, x, y, +8 more. Returns: result

interpret_basisA

Interpret a construction basis produced by create_prompt_basis.

Takes the JSON output from create_prompt_basis and returns a plain-language interpretation of the philosophical measurement. Extracts the guidance section and formats it as readable text with dominant dimensions, gaps, and strongest resonance.

Inputs: basis (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a distinct purpose: create measures intent, explore navigates the manifold, extend modifies the graph, interpret explains results. No overlap in functionality.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (create_prompt_basis, explore_space, extend_schema, interpret_basis), making it easy to predict tool roles.

    Tool Count5/5

    Four tools is an ideal number for a specialized philosophical engine, covering core operations without unnecessary bloat.

    Completeness4/5

    The toolkit covers creation, exploration, extension, and interpretation. The only minor gap is the lack of a deletion or reset tool, but this is acceptable for a focused engine.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      C
      quality
      D
      maintenance
      An MCP server implementing the Unified Cognitive Processing Framework for advanced problem-solving, creative thinking, and cognitive analysis through structured tools for knowledge mapping, recursive questioning, and perspective generation.
      3
      16
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      This MCP server provides research-backed prompt optimization tools and professional domain templates designed to improve AI performance through strategies like Tree of Thoughts and Medprompt. It enables users to analyze, auto-optimize, and refine prompts using advanced reasoning patterns and safety-critical alignment techniques.
      25
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that automatically enhances user prompts by applying advanced engineering techniques like chain-of-thought and few-shot reasoning based on identified intent. It optimizes technique selection through local learning and integrates directly into Claude sessions to improve output quality without additional API costs.
      6
      MIT