Skip to main content
Glama
nbhson

Universal Prompt Gate MCP Server

by nbhson

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PROMPT_GATE_ENV_FILENoExplicit path to a .env file
PROMPT_GATE_PROVIDERNoopenai-compatible / openai / customopenai-compatible
PROMPT_GATE_LLM_MODELNoModel nameqwen3.5-9b
PROMPT_GATE_TRANSPORTNostdio or httpstdio
PROMPT_GATE_TIMEOUT_MSNoLLM timeout in ms (thinking models on CPU need more time)180000
PROMPT_GATE_LLM_API_KEYNoAPI key (for local dev, no real key needed)local-dev-key
PROMPT_GATE_EXTERNAL_LLMNoOptional: cloud LLM endpoint
PROMPT_GATE_LLM_BASE_URLNoLLM endpoint (OpenAI-compatible)http://127.0.0.1:8080/v1
PROMPT_GATE_ECHO_FALLBACKNoWhen the client does not support MCP elicitation, the gate tool returns a pending_user_selection text menu instead of a hard error (agent re-calls with selection)true
PROMPT_GATE_LLM_RETRY_MAXNoRetry count for network errors (idempotent calls only)3
PROMPT_GATE_LLM_EXTRA_JSONNoJSON object merged into the LLM request body (e.g. {"chat_format":"chatml"})
PROMPT_GATE_LLM_MAX_TOKENSNoMax completion tokens (thinking models need a larger budget)2048
PROMPT_GATE_LLM_ENABLE_THINKINGNotrue/false — enable/disable reasoning (qwen3 / llama.cpp thinking models)
PROMPT_GATE_REWRITE_POLICY_FILENoCustom meta-prompt policy file (presets: news/code/research, …) — overrides the default strategy
PROMPT_GATE_CUSTOM_PROVIDER_MODULENoPath to a custom provider module (only used when provider=custom)

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
rewrite_promptA

Re-emit the given prompt with richer context, structure, and quality criteria. This tool only produces a candidate rewrite; it does NOT approve the result. Use review_and_select_prompt for the gated, user-confirmed flow.

CALLING GUIDE (for the LLM):

  • ALWAYS pass a short context (1-3 sentences) summarizing the conversation/session so far so the enrichment is grounded. Do not omit it.

  • Choose rewrite_level to fit the task: light for quick one-shot answers, balanced (default) for most coding/research work, detailed when the user explicitly wants a fully-specified spec.

  • Pass language only when the user wants the rewritten prompt in a language different from the original. Do NOT switch the language on your own judgment — the server auto-detects the prompt language and preserves it by default.

review_and_select_promptA

Generates a rewritten version of the prompt, then asks the user to choose: use original, use rewritten, or cancel. Returns only the approved prompt. Cancellation is a distinct outcome and never exposes an approved prompt.

If the client does not support MCP elicitation, the tool returns a distinct "pending_user_selection" result: it shows both versions in plain text with the three numbered choices and asks the agent to re-call this tool with selection set to the user's choice ("original" / "rewritten" / "cancel"). Never auto-select.

CALLING GUIDE (for the LLM):

  • FIRST call (rewrite): pass prompt + context; do NOT pass selection. ALWAYS pass a short context (1-3 sentences) summarizing the conversation so far.

  • If the first call returns status "pending_user_selection": show the two versions to the user, ask which to use, then call again with the SAME inputs PLUS selection set to "original", "rewritten", or "cancel" matching the user's choice.

  • Choose rewrite_level to fit the task: light for quick one-shot answers, balanced (default) for most coding/research work, detailed when the user explicitly wants a fully-specified spec.

  • Pass language only when the user wants the rewritten prompt in a language different from the original. Do NOT switch the language on your own judgment — the server auto-detects the prompt language and preserves it by default.

get_client_capabilitiesA

Reports which interaction features are available for the current MCP client/session: elicitation support, structured elicitation, transport, integration mode, and whether a mandatory prompt gate is enforceable. Capabilities are derived from verified protocol negotiation, not from the agent name.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.2/5.0

Scored across 3 tools

Disambiguation4/5

get_client_capabilities is clearly distinct as a capability probe. rewrite_prompt and review_and_select_prompt overlap in that both generate rewritten prompts, but the descriptions explicitly draw the line: rewrite_prompt produces an unapproved candidate while review_and_select_prompt runs the gated, user-confirmed flow. The boundary is documented, so misselection is unlikely but not impossible.

Naming Consistency4/5

All names use snake_case with verb-first phrasing (get_*, rewrite_*, review_and_select_*), which is readable and mostly uniform. review_and_select_prompt is a compound verb phrase rather than a simple verb_noun, a minor deviation from the otherwise consistent pattern.

Tool Count4/5

Three tools is a lean surface but each maps to a distinct stage of the workflow: capability discovery, candidate rewrite, and gated approval/selection. The count is slightly thin but well-scoped and nothing feels redundant or padded.

Completeness4/5

The lifecycle for a prompt-gate server is largely covered: negotiate capabilities, generate a rewrite, and handle user approval including a documented fallback for clients without elicitation. Minor gaps exist around configuration or non-elicitation batch handling, but core agent workflows are supported without dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo issues