prompte-mcp

prompte-mcp

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.

Category
访问服务器

README

prompte-mcp

An MCP server that enhances your prompts before Claude processes them — automatically applying chain-of-thought, few-shot, tree-of-thought, and other prompt engineering techniques based on what you're asking.

you type:   "fix this null pointer crash"

claude sees: "Work through this using the ReAct pattern — alternate between
              Thought (reasoning) and Action (what you would do), then give
              a final Answer.

              fix this null pointer crash"

Setup

No API key needed. Prompte runs entirely on your existing Claude Code or Codex session.

git clone https://github.com/AlanRoybal/prompte-mcp
cd prompte-mcp
node bin/setup.js

The setup script handles everything:

  1. Registers the MCP server in ~/.claude/settings.json
  2. Installs the UserPromptSubmit hook (automatic enhancement on every prompt)
  3. Creates ~/.prompte/config.json with defaults

Then restart Claude Code.

Flags

node bin/setup.js --yes       # accept all defaults, no prompts
node bin/setup.js --dry-run   # preview changes without writing anything

Manual setup

If you prefer to edit ~/.claude/settings.json directly:

{
  "mcpServers": {
    "prompte": {
      "command": "node",
      "args": ["/path/to/prompte-mcp/bin/prompte-mcp.js"]
    }
  },
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "python3 /path/to/prompte-mcp/hooks/user-prompt-submit.py"
          }
        ]
      }
    ]
  }
}

How it works

The MCP server handles classification and technique selection. Claude Code (your existing session) does the actual enhancement — no separate API calls, no extra costs.

your prompt
    │
    ▼
┌─────────────┐
│  Classifier │  keyword heuristics (no API call)
│             │  → intent: debugging / reasoning / generation / ...
└──────┬──────┘
       │  technique affinity scores
       ▼
┌─────────────┐
│   Scorer    │  affinity × your learned acceptance rate
│             │  → selects best technique
└──────┬──────┘
       │  techniqueInstruction
       ▼
  Claude Code  ←── applies the technique using its own intelligence
       │
       ▼
    response

The scorer learns from you. Acceptance rates per technique are tracked in ~/.prompte/ — techniques you skip get demoted over time.


Two modes

Automatic (hook)

The UserPromptSubmit hook fires on every prompt silently — no tool call, no interruption. Claude receives the enhanced version without you doing anything.

Prefix a prompt with * to bypass:

* just answer this exactly as asked

Interactive (MCP tools)

When Claude calls enhance_prompt, it shows you the enhancement and waits for your decision before answering:

I've selected the Chain of Thought technique for this (debugging).

Original: why does my function crash when the list is empty?

Enhanced: Think through this step-by-step before giving your final
          answer. Show your reasoning explicitly.

          why does my function crash when the list is empty?

[A] Accept   [E] Edit   [S] Skip   [Q] Quit

Reply with a / e / s / q (or just say "accept", "skip", etc.):

Reply What happens
a / accept Claude answers using the enhanced prompt
e / edit Paste your revised version, Claude uses that
s / skip Claude answers your original prompt, no technique
q / quit Claude stops, does nothing

Set autoAccept: true in ~/.prompte/config.json to skip the confirmation and apply silently.

Claude Code can also call these tools directly during a session:

Tool What it does
enhance_prompt Classify intent, select best technique, return techniqueInstruction for Claude to apply
list_techniques All 8 techniques with your acceptance stats
get_stats Session totals + current config
record_feedback Mark an enhancement helpful/not (trains technique weights)
get_config Read ~/.prompte/config.json
set_config Write a config value

The CLAUDE.md in this repo tells Claude when to call enhance_prompt automatically — on debugging, reasoning, generation, architecture, and review prompts.


The 8 techniques

Technique Best for What it adds
Chain of Thought Debugging, reasoning Step-by-step reasoning before answering
Few-Shot Generation, review Concrete example to anchor output
Tree of Thought Decisions, architecture 3 approaches with pros/cons, then a recommendation
Meta-Prompting Architecture, generation Restate understanding of the goal before answering
Role Prompting Review, generation Senior software engineer framing
Self-Consistency Reasoning, debugging Verify from a different angle, correct if wrong
Step-Back Explanation, reasoning Consider broader context and first principles first
ReAct Debugging, multi-step Interleaved Thought / Action / Observation steps

Configuration

~/.prompte/config.json:

{
  "enabled": true,
  "autoAccept": false,
  "bypassPrefix": "*",
  "preferredTechniques": [],
  "disabledTechniques": [],
  "llmClassifier": true,
  "maxPromptLength": 4000
}
Key Default Description
enabled true Master switch
bypassPrefix "*" Prompt prefix to skip enhancement
preferredTechniques [] Boost these techniques
disabledTechniques [] Never use these techniques
maxPromptLength 4000 Skip enhancement above this length

Per-project overrides: drop a .prompte file anywhere in your project tree (or a parent directory). Values override the global config.


Project structure

prompte-mcp/
├── bin/
│   ├── prompte-mcp.js      MCP server
│   └── setup.js            setup script
├── src/
│   ├── classifier/         intent classification (LLM + keyword fallback)
│   ├── techniques/         8 technique definitions
│   ├── engine/             classify → score → select → rewrite
│   └── config/             ~/.prompte/ storage and acceptance rate learning
├── hooks/
│   └── user-prompt-submit.py   UserPromptSubmit hook
└── CLAUDE.md               tells Claude when to call enhance_prompt

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选