prompt-clarifier-mcp 2.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Didou555
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,92 +1,136 @@
1
1
  # Prompt Clarifier — MCP Agent
2
2
 
3
- > Arrête le ping-pong avec ton LLM. Cet agent te pose les bonnes questions avant d'exécuter ta demande.
3
+ > Stop the back-and-forth with your LLM. This agent asks the right questions before executing your request.
4
4
 
5
- ## Comment ça marche
5
+ ## How it works
6
6
 
7
7
  ```
8
- Tu écris : "Crée un modèle ONNX sans opset"
8
+ You write: "Create an ONNX model without opset"
9
9
 
10
- Prompt Clarifier pose des questions ciblées
10
+ The MCP server detects the domain and returns a system prompt
11
11
 
12
- Tu réponds (ou tu écris "go" pour arrêter)
12
+ Your IDE's own LLM asks targeted questions (no external LLM)
13
13
 
14
- Un prompt enrichi et précis est généré
14
+ You answer (or type "go" to stop)
15
15
 
16
- Ton LLM produit exactement ce que tu voulais — du premier coup
16
+ An enriched, precise prompt is generated
17
+
18
+ Your LLM produces exactly what you wanted — on the first try
17
19
  ```
18
20
 
19
21
  ---
20
22
 
23
+ ## Architecture
24
+
25
+ The MCP server is **LLM-agnostic**: it makes no external API calls and requires no API key.
26
+
27
+ | Responsibility | Who handles it |
28
+ | --- | --- |
29
+ | Domain detection | MCP server |
30
+ | Session state (Q&A history) | MCP server |
31
+ | Question generation | Your IDE's LLM (Junie, Cursor, Claude Code, Copilot…) |
32
+ | Knowledge base search | Your IDE's LLM (Confluence, Notion, etc.) |
33
+
34
+ **Call flow:**
35
+
36
+ - **First call** (`prompt`) — the server creates a session, detects the domain, and returns a `system_prompt` + `user_message` that your IDE injects into its LLM to generate the first question.
37
+ - **Subsequent calls** (`session_id` + `answer`) — the server saves the answer and returns an updated `system_prompt`. After 5 answers or the word "go", it returns the enriched `final_prompt`.
38
+
39
+ ---
40
+
41
+ ## Automatically detected domains
42
+
43
+ | Domain | Detected patterns | Question focus |
44
+ | --- | --- | --- |
45
+ | `ml_onnx` | `onnx` | runtime, opset, tensor shapes, operators |
46
+ | `ml_h2o` | `h2o`, `automl`, `gbm`, `mojo`, `pojo` | algorithm type, target variable, export format |
47
+ | `data_table` | `datatable`, `schema`, `dataframe`, `column` | schema, data types, volume, use case |
48
+ | `ml_general` | `pytorch`, `tensorflow`, `sklearn`, `model`… | framework, task type, data format |
49
+ | `general` | (everything else) | objective, environment, existing context |
50
+
51
+ ---
52
+
53
+ ## Knowledge base search
54
+
55
+ The returned system prompt instructs your IDE's LLM to **search connected knowledge bases first** (Confluence, Notion, or any connected documentation tool) before formulating questions. This produces questions tailored to your organization's actual standards and workflows rather than generic ones.
56
+
57
+ ---
58
+
21
59
  ## Installation
22
60
 
23
- ### Prérequis Clé API Anthropic
61
+ > **No API key required.** The server makes no external LLM calls.
62
+
63
+ ### Option 1 — Global install (recommended)
64
+
65
+ ```bash
66
+ npm install -g prompt-clarifier-mcp
67
+ ```
68
+
69
+ Then use `prompt-clarifier-mcp` as the command in your IDE config instead of `npx`:
70
+
71
+ ```json
72
+ {
73
+ "command": "prompt-clarifier-mcp",
74
+ "args": []
75
+ }
76
+ ```
24
77
 
25
- Cet agent utilise Claude Haiku pour générer ses questions. Tu as besoin d'une clé API Anthropic :
26
- - Crée-en une sur [console.anthropic.com](https://console.anthropic.com)
27
- - Ajoute-la dans la config MCP de ton outil (voir exemples ci-dessous)
78
+ ### Option 2 On-demand via npx
79
+
80
+ No install needed. Use `npx -y prompt-clarifier-mcp` directly in your IDE config (see examples below). The package is fetched automatically on first run.
28
81
 
29
82
  ---
30
83
 
31
84
  ### Cursor
32
85
 
33
- Ouvre `~/.cursor/mcp.json` (crée-le s'il n'existe pas) :
86
+ Open `~/.cursor/mcp.json` (create it if it does not exist):
34
87
 
35
88
  ```json
36
89
  {
37
90
  "mcpServers": {
38
91
  "prompt-clarifier": {
39
92
  "command": "npx",
40
- "args": ["-y", "prompt-clarifier-mcp"],
41
- "env": {
42
- "ANTHROPIC_API_KEY": "sk-ant-..."
43
- }
93
+ "args": ["-y", "prompt-clarifier-mcp"]
44
94
  }
45
95
  }
46
96
  }
47
97
  ```
48
98
 
49
- Redémarre Cursor. L'outil `clarify` est maintenant disponible.
99
+ Restart Cursor. The `clarify` tool is now available.
50
100
 
51
101
  ---
52
102
 
53
103
  ### Claude Desktop
54
104
 
55
- Ouvre le fichier de config :
56
- - **Windows** : `%APPDATA%\Claude\claude_desktop_config.json`
57
- - **macOS** : `~/Library/Application Support/Claude/claude_desktop_config.json`
105
+ Open the config file:
106
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
107
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
58
108
 
59
109
  ```json
60
110
  {
61
111
  "mcpServers": {
62
112
  "prompt-clarifier": {
63
113
  "command": "npx",
64
- "args": ["-y", "prompt-clarifier-mcp"],
65
- "env": {
66
- "ANTHROPIC_API_KEY": "sk-ant-..."
67
- }
114
+ "args": ["-y", "prompt-clarifier-mcp"]
68
115
  }
69
116
  }
70
117
  }
71
118
  ```
72
119
 
73
- Redémarre Claude Desktop.
120
+ Restart Claude Desktop.
74
121
 
75
122
  ---
76
123
 
77
- ### VS Code (avec GitHub Copilot ou Continue)
124
+ ### VS Code (with GitHub Copilot or Continue)
78
125
 
79
- Crée ou ouvre `.vscode/mcp.json` à la racine de ton projet :
126
+ Create or open `.vscode/mcp.json` at the root of your project:
80
127
 
81
128
  ```json
82
129
  {
83
130
  "servers": {
84
131
  "prompt-clarifier": {
85
132
  "command": "npx",
86
- "args": ["-y", "prompt-clarifier-mcp"],
87
- "env": {
88
- "ANTHROPIC_API_KEY": "sk-ant-..."
89
- }
133
+ "args": ["-y", "prompt-clarifier-mcp"]
90
134
  }
91
135
  }
92
136
  }
@@ -94,20 +138,18 @@ Crée ou ouvre `.vscode/mcp.json` à la racine de ton projet :
94
138
 
95
139
  ---
96
140
 
97
- ### IntelliJ IDEA / PyCharm (version 2025.1+)
141
+ ### IntelliJ IDEA / PyCharm (2025.1+)
98
142
 
99
- 1. Ouvre `Settings` → `Tools` → `AI Assistant` → `Model Context Protocol (MCP)`
100
- 2. Clique sur `+` pour ajouter un nouveau serveur
101
- 3. Choisis **"Command"** comme type
102
- 4. Remplis :
103
- - **Name** : `prompt-clarifier`
104
- - **Command** : `npx`
105
- - **Arguments** : `-y prompt-clarifier-mcp`
106
- - **Environment variables** : `ANTHROPIC_API_KEY=sk-ant-...`
107
- 5. Clique `OK` et redémarre l'IDE
143
+ 1. Open `Settings` → `Tools` → `AI Assistant` → `Model Context Protocol (MCP)`
144
+ 2. Click `+` to add a new server
145
+ 3. Choose **"Command"** as the type
146
+ 4. Fill in:
147
+ - **Name**: `prompt-clarifier`
148
+ - **Command**: `npx`
149
+ - **Arguments**: `-y prompt-clarifier-mcp`
150
+ 5. Click `OK` and restart the IDE
108
151
 
109
- > ⚠️ Requiert IntelliJ IDEA / PyCharm 2025.1 ou supérieur avec AI Assistant activé.
110
- > Active le mode **"Codebase"** dans le chat AI Assistant pour que les outils MCP soient disponibles.
152
+ > Enable **"Codebase"** mode in the AI Assistant chat for MCP tools to be available.
111
153
 
112
154
  ---
113
155
 
@@ -117,66 +159,88 @@ Crée ou ouvre `.vscode/mcp.json` à la racine de ton projet :
117
159
  claude mcp add prompt-clarifier npx -- -y prompt-clarifier-mcp
118
160
  ```
119
161
 
120
- Puis ajoute la clé API dans ton environnement ou dans `.claude/settings.json` :
121
- ```json
122
- {
123
- "env": {
124
- "ANTHROPIC_API_KEY": "sk-ant-..."
125
- }
126
- }
127
- ```
128
-
129
162
  ---
130
163
 
131
- ## Utilisation
164
+ ## Usage
132
165
 
133
- Dans n'importe quel chat de ton IDE, appelle l'outil `clarify` avec ton prompt :
166
+ In any IDE chat, call the `clarify` tool with your prompt:
134
167
 
135
- **Exemple :**
136
168
  ```
137
- Utilise l'outil clarify avec ce prompt : "Crée un modèle ONNX sans opset"
169
+ Use the clarify tool with this prompt: "Create an ONNX model without opset"
138
170
  ```
139
171
 
140
- L'agent va :
141
- 1. Détecter le domaine (ML/ONNX dans cet exemple)
142
- 2. Te poser des questions ciblées une par une
143
- 3. Générer un prompt enrichi quand tu as répondu (ou quand tu écris **"go"**)
172
+ The server will:
173
+ 1. Detect the domain (`ml_onnx` in this example)
174
+ 2. Return a system prompt your LLM uses to ask targeted questions
175
+ 3. Record each answer in the session
176
+ 4. Generate the enriched prompt after 5 answers or as soon as you type **"go"**
144
177
 
145
- **Pour arrêter les questions à tout moment**, écris simplement :
146
- - `go` / `commence` / `lance-toi` / `c'est bon` / `assez` / `proceed`
178
+ **To stop questions at any time**, simply write:
179
+ - `go` / `commence` / `start` / `proceed` / `just do it` / `enough`
180
+
181
+ ---
182
+
183
+ ## Response format
184
+
185
+ **First call:**
186
+ ```json
187
+ {
188
+ "session_id": "uuid",
189
+ "system_prompt": "...",
190
+ "user_message": "Here is the user prompt to clarify: ...",
191
+ "instructions": "Ask the first clarifying question now. Include the session_id..."
192
+ }
193
+ ```
194
+
195
+ **Subsequent calls:**
196
+ ```json
197
+ {
198
+ "session_id": "uuid",
199
+ "system_prompt": "...",
200
+ "user_message": "The user answered: ... Ask the next question.",
201
+ "qa_count": 2
202
+ }
203
+ ```
204
+
205
+ **Final response:**
206
+ ```json
207
+ {
208
+ "final_prompt": "Initial prompt\n\n## Additional context collected\n..."
209
+ }
210
+ ```
147
211
 
148
212
  ---
149
213
 
150
- ## Prérequis
214
+ ## Requirements
151
215
 
152
- - Node.js 18 ou supérieur
153
- - Un IDE avec support MCP (voir liste ci-dessus)
216
+ - Node.js 18 or higher
217
+ - An IDE with MCP support (see list above)
154
218
 
155
219
  ---
156
220
 
157
- ## Développement local
221
+ ## Local development
158
222
 
159
223
  ```bash
160
- git clone https://github.com/dmi-agentix/prompt-clarifier
161
- cd prompt-clarifier
224
+ git clone https://github.com/Didou555/prompt-clarifer
225
+ cd prompt-clarifer
162
226
  npm install
163
227
  npm run build
164
228
 
165
- # Tester avec l'inspecteur MCP
229
+ # Test with the MCP inspector
166
230
  npx @modelcontextprotocol/inspector node dist/index.js
167
231
  ```
168
232
 
169
233
  ---
170
234
 
171
- ## Contribuer
235
+ ## Contributing
172
236
 
173
- Les contributions sont les bienvenues ! En particulier :
174
- - Nouvelles banques de questions par domaine (`src/clarifier.ts`)
175
- - Nouveaux mots-clés "stop" dans d'autres langues
176
- - Amélioration de la détection de domaine
237
+ Contributions are welcome! In particular:
238
+ - New domain detection patterns (`src/clarifier.ts` → `detectDomain`)
239
+ - New stop keywords in other languages (`GO_KEYWORDS`)
240
+ - New question angles per domain (`DOMAIN_ANGLES`)
177
241
 
178
242
  ---
179
243
 
180
- ## Licence
244
+ ## License
181
245
 
182
- MIT — DMI Agentix
246
+ MIT
@@ -1,5 +1,7 @@
1
1
  import { QA } from "./session.js";
2
2
  export declare function isGoSignal(text: string): boolean;
3
- export declare function getNextQuestion(initialPrompt: string, qaHistory: QA[]): Promise<string | null>;
3
+ export type Domain = "ml_onnx" | "ml_h2o" | "data_table" | "ml_general" | "general";
4
+ export declare function detectDomain(prompt: string): Domain;
5
+ export declare function buildClarifySystemPrompt(initialPrompt: string, qaHistory: QA[], domain: Domain): string;
4
6
  export declare function buildEnrichedPrompt(initialPrompt: string, qaHistory: QA[]): string;
5
7
  //# sourceMappingURL=clarifier.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clarifier.d.ts","sourceRoot":"","sources":["../src/clarifier.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAOlC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQhD;AAaD,wBAAsB,eAAe,CACnC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,EAAE,EAAE,GACd,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgCxB;AAED,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,MAAM,CAelF"}
1
+ {"version":3,"file":"clarifier.d.ts","sourceRoot":"","sources":["../src/clarifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAOlC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQhD;AAED,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,YAAY,GAAG,SAAS,CAAC;AAEpF,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMnD;AAmBD,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,EAAE,EAAE,EACf,MAAM,EAAE,MAAM,GACb,MAAM,CAmCR;AAED,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,MAAM,CAelF"}
package/dist/clarifier.js CHANGED
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.isGoSignal = isGoSignal;
7
- exports.getNextQuestion = getNextQuestion;
4
+ exports.detectDomain = detectDomain;
5
+ exports.buildClarifySystemPrompt = buildClarifySystemPrompt;
8
6
  exports.buildEnrichedPrompt = buildEnrichedPrompt;
9
- const sdk_1 = __importDefault(require("@anthropic-ai/sdk"));
10
7
  const GO_KEYWORDS = [
11
8
  "go", "commence", "start", "c'est bon", "lance toi", "lance-toi",
12
9
  "démarre", "ok go", "assez", "enough", "proceed", "just do it",
@@ -17,42 +14,59 @@ function isGoSignal(text) {
17
14
  normalized.startsWith(kw + " ") ||
18
15
  normalized.endsWith(" " + kw));
19
16
  }
20
- const client = new sdk_1.default();
21
- const SYSTEM_PROMPT = `Tu es un agent expert en amélioration de prompts. Ton rôle est d'analyser un prompt utilisateur et l'historique des questions/réponses déjà échangées, puis de décider de la prochaine action.
17
+ function detectDomain(prompt) {
18
+ if (/onnx/i.test(prompt))
19
+ return "ml_onnx";
20
+ if (/h2o|automl|gbm|mojo|pojo/i.test(prompt))
21
+ return "ml_h2o";
22
+ if (/data.?table|schema|dataframe|column/i.test(prompt))
23
+ return "data_table";
24
+ if (/machine.?learn|deep.?learn|neural|pytorch|tensorflow|sklearn|model|train|predict|classif|regress/i.test(prompt))
25
+ return "ml_general";
26
+ return "general";
27
+ }
28
+ const KB_PREAMBLE = `Before asking your first question, search your connected knowledge bases (Confluence, Notion, or any connected documentation tool) for pages related to the user's request and to your company's internal standards, processes, and best practices relevant to this topic. Use that context to ask questions that are specific to your organization's actual workflow and constraints, rather than generic questions. If no relevant internal documentation is found, fall back to domain best practices.
22
29
 
23
- Règles strictes :
24
- 1. Si des précisions importantes manquent encore pour bien exécuter la demande, pose UNE SEULE question — la plus pertinente selon le domaine et le contexte réel du prompt.
25
- 2. Si tu as suffisamment d'informations pour que le LLM puisse répondre précisément (ou après 5 questions maximum), réponds uniquement avec le mot : DONE
26
- 3. La question doit être concrète et adaptée au domaine détecté automatiquement (code, data science, design, rédaction, business, DevOps, etc.)
27
- 4. Ne pose jamais une question générique si le contexte est déjà clair. Chaque question doit débloquer une information réellement utile.
28
- 5. Réponds UNIQUEMENT avec la question ou le mot DONE aucune explication, aucun préambule, aucune ponctuation superflue.`;
29
- async function getNextQuestion(initialPrompt, qaHistory) {
30
- if (qaHistory.length >= 5)
31
- return null;
30
+ Examples of what to search for depending on the detected domain:
31
+ - ONNX model model validation process, opset standards, deployment pipeline
32
+ - H2O model AutoML configuration, MOJO export standards, validation criteria
33
+ - Data table schema conventions, naming standards, data governance rules
34
+ - General coding architecture guidelines, code review standards, tech stack
35
+ - General request any internal process or standard related to the topic`;
36
+ const DOMAIN_ANGLES = {
37
+ ml_onnx: "Focus on: runtime, opset version, input/output tensor shapes, operators needed.",
38
+ ml_h2o: "Focus on: algorithm type (GBM/DRF/AutoML), target variable, feature types, export format (MOJO/POJO), training constraints.",
39
+ data_table: "Focus on: schema/columns, data types, volume, relationships, use case (reporting/ML/API).",
40
+ ml_general: "Focus on: framework, task type, data format, performance constraints.",
41
+ general: "Focus on: objective, language/environment, existing context, edge cases.",
42
+ };
43
+ function buildClarifySystemPrompt(initialPrompt, qaHistory, domain) {
32
44
  const historyText = qaHistory.length > 0
33
45
  ? qaHistory
34
- .map((qa, i) => `Q${i + 1}: ${qa.question}\nR${i + 1}: ${qa.answer}`)
46
+ .map((qa, i) => qa.question
47
+ ? `Q${i + 1}: ${qa.question}\nA${i + 1}: ${qa.answer}`
48
+ : `A${i + 1}: ${qa.answer}`)
35
49
  .join("\n\n")
36
- : "Aucune question posée pour l'instant.";
37
- const userMessage = `Prompt initial de l'utilisateur :
38
- "${initialPrompt}"
50
+ : "No questions asked yet.";
51
+ const shouldStop = qaHistory.length >= 5 ||
52
+ (qaHistory.length > 0 && isGoSignal(qaHistory[qaHistory.length - 1].answer));
53
+ return `${KB_PREAMBLE}
54
+
55
+ ---
56
+
57
+ You are a prompt clarification assistant. Your task is to iteratively refine a user's prompt by asking targeted questions.
39
58
 
40
- Historique des questions/réponses :
59
+ Initial prompt: "${initialPrompt}"
60
+
61
+ Q&A history so far:
41
62
  ${historyText}
42
63
 
43
- Quelle est la prochaine question à poser, ou dois-tu répondre DONE ?`;
44
- const response = await client.messages.create({
45
- model: "claude-haiku-4-5-20251001",
46
- max_tokens: 200,
47
- system: SYSTEM_PROMPT,
48
- messages: [{ role: "user", content: userMessage }],
49
- });
50
- const text = response.content[0].type === "text"
51
- ? response.content[0].text.trim()
52
- : "";
53
- if (text.toUpperCase() === "DONE" || text === "")
54
- return null;
55
- return text;
64
+ Detected domain: ${domain}
65
+ ${DOMAIN_ANGLES[domain]}
66
+
67
+ ${shouldStop
68
+ ? "You have enough information. Return ONLY the final enriched prompt, incorporating all answers collected so far. Do not ask any more questions."
69
+ : "Ask the single most relevant next clarifying question for this domain and context. Output ONLY the question — no preamble, no explanation, no punctuation beyond the question mark."}`;
56
70
  }
57
71
  function buildEnrichedPrompt(initialPrompt, qaHistory) {
58
72
  if (qaHistory.length === 0)
@@ -1 +1 @@
1
- {"version":3,"file":"clarifier.js","sourceRoot":"","sources":["../src/clarifier.ts"],"names":[],"mappings":";;;;;AAQA,gCAQC;AAaD,0CAmCC;AAED,kDAeC;AAjFD,4DAA0C;AAG1C,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW;IAChE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY;CAC/D,CAAC;AAEF,SAAgB,UAAU,CAAC,IAAY;IACrC,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,E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aAAa;;;EAG9B,WAAW;;mBAEM,MAAM;EACvB,aAAa,CAAC,MAAM,CAAC;;EAGrB,UAAU;QACR,CAAC,CAAC,gJAAgJ;QAClJ,CAAC,CAAC,qLACN,EAAE,CAAC;AACH,CAAC;AAED,SAAgB,mBAAmB,CAAC,aAAqB,EAAE,SAAe;IACxE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,aAAa,CAAC;IAEjD,MAAM,OAAO,GAAG,SAAS;SACtB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,SAAS,EAAE,CAAC,MAAM,EAAE,CAAC;SACjD,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,GAAG,aAAa;;;;EAIvB,OAAO;;;8EAGqE,CAAC;AAC/E,CAAC"}
package/dist/index.js CHANGED
@@ -6,26 +6,26 @@ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
6
6
  const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
7
7
  const session_js_1 = require("./session.js");
8
8
  const clarifier_js_1 = require("./clarifier.js");
9
- const server = new index_js_1.Server({ name: "prompt-clarifier", version: "2.0.0" }, { capabilities: { tools: {} } });
9
+ const server = new index_js_1.Server({ name: "prompt-clarifier", version: "3.0.0" }, { capabilities: { tools: {} } });
10
10
  server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
11
11
  tools: [
12
12
  {
13
13
  name: "clarify",
14
- description: "Affine un prompt utilisateur en posant des questions ciblées une par une, puis génère un prompt enrichi prêt à être exécuté par le LLM.",
14
+ description: "Returns a system prompt and user message that instruct the IDE's own LLM to ask targeted clarifying questions one at a time, then produces an enriched prompt once enough context is gathered. The MCP server manages session state only — no LLM calls are made server-side.",
15
15
  inputSchema: {
16
16
  type: "object",
17
17
  properties: {
18
18
  prompt: {
19
19
  type: "string",
20
- description: "Le prompt initial de l'utilisateur (requis au premier appel).",
20
+ description: "The initial user prompt (required on first call).",
21
21
  },
22
22
  session_id: {
23
23
  type: "string",
24
- description: "ID de session retourné par un appel précédent (pour continuer la conversation).",
24
+ description: "Session ID returned by a previous call (to continue the conversation).",
25
25
  },
26
26
  answer: {
27
27
  type: "string",
28
- description: "Réponse de l'utilisateur à la dernière question posée par l'agent.",
28
+ description: "The user's answer to the last clarifying question.",
29
29
  },
30
30
  },
31
31
  required: [],
@@ -35,33 +35,27 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
35
35
  }));
36
36
  server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
37
37
  if (request.params.name !== "clarify") {
38
- return { content: [{ type: "text", text: `Outil inconnu : ${request.params.name}` }] };
38
+ return { content: [{ type: "text", text: `Unknown tool: ${request.params.name}` }] };
39
39
  }
40
40
  const args = request.params.arguments;
41
41
  // --- New session ---
42
42
  if (!args.session_id) {
43
43
  if (!args.prompt) {
44
44
  return {
45
- content: [{ type: "text", text: "Erreur : `prompt` est requis pour démarrer une session." }],
45
+ content: [{ type: "text", text: "Error: `prompt` is required to start a session." }],
46
46
  };
47
47
  }
48
48
  const session = (0, session_js_1.createSession)(args.prompt);
49
- const firstQuestion = await (0, clarifier_js_1.getNextQuestion)(session.initialPrompt, []);
50
- if (!firstQuestion) {
51
- (0, session_js_1.deleteSession)(session.id);
52
- return {
53
- content: [{ type: "text", text: (0, clarifier_js_1.buildEnrichedPrompt)(session.initialPrompt, []) }],
54
- };
55
- }
56
- (0, session_js_1.saveSession)(session);
49
+ const domain = (0, clarifier_js_1.detectDomain)(args.prompt);
57
50
  return {
58
51
  content: [
59
52
  {
60
53
  type: "text",
61
54
  text: JSON.stringify({
62
55
  session_id: session.id,
63
- question: firstQuestion,
64
- instructions: "Réponds à cette question, puis rappelle l'outil clarify avec session_id et answer. Dis 'go' pour générer immédiatement le prompt final.",
56
+ system_prompt: (0, clarifier_js_1.buildClarifySystemPrompt)(args.prompt, [], domain),
57
+ user_message: `Here is the user prompt to clarify: ${args.prompt}`,
58
+ instructions: "Ask the first clarifying question now. Include the session_id in your response so the user knows to pass it back.",
65
59
  }),
66
60
  },
67
61
  ],
@@ -71,48 +65,44 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
71
65
  const session = (0, session_js_1.loadSession)(args.session_id);
72
66
  if (!session) {
73
67
  return {
74
- content: [{ type: "text", text: `Session introuvable : ${args.session_id}` }],
68
+ content: [{ type: "text", text: `Session not found: ${args.session_id}` }],
75
69
  };
76
70
  }
77
71
  const answer = args.answer ?? "";
78
- // User said "go" generate final prompt now
79
- if ((0, clarifier_js_1.isGoSignal)(answer)) {
80
- const enriched = (0, clarifier_js_1.buildEnrichedPrompt)(session.initialPrompt, session.qaHistory);
81
- (0, session_js_1.deleteSession)(session.id);
82
- return { content: [{ type: "text", text: enriched }] };
83
- }
84
- // Record the answer to the last question asked
85
- if (session.lastQuestion && answer.trim()) {
86
- session.qaHistory.push({ question: session.lastQuestion, answer });
72
+ // Save the answer to session
73
+ if (answer.trim()) {
74
+ session.qaHistory.push({ question: "", answer });
75
+ (0, session_js_1.saveSession)(session);
87
76
  }
88
- // Ask Claude for the next question
89
- const nextQuestion = await (0, clarifier_js_1.getNextQuestion)(session.initialPrompt, session.qaHistory);
90
- if (!nextQuestion) {
77
+ // Go signal or max questions reached → return final enriched prompt
78
+ if ((0, clarifier_js_1.isGoSignal)(answer) || session.qaHistory.length >= 5) {
91
79
  const enriched = (0, clarifier_js_1.buildEnrichedPrompt)(session.initialPrompt, session.qaHistory);
92
80
  (0, session_js_1.deleteSession)(session.id);
93
- return { content: [{ type: "text", text: enriched }] };
81
+ return {
82
+ content: [
83
+ {
84
+ type: "text",
85
+ text: JSON.stringify({ final_prompt: enriched }),
86
+ },
87
+ ],
88
+ };
94
89
  }
95
- session.lastQuestion = nextQuestion;
96
- (0, session_js_1.saveSession)(session);
90
+ const domain = (0, clarifier_js_1.detectDomain)(session.initialPrompt);
97
91
  return {
98
92
  content: [
99
93
  {
100
94
  type: "text",
101
95
  text: JSON.stringify({
102
96
  session_id: session.id,
103
- question: nextQuestion,
104
- qa_so_far: session.qaHistory.length,
105
- instructions: "Réponds à cette question, puis rappelle l'outil clarify avec session_id et answer. Dis 'go' pour générer immédiatement le prompt final.",
97
+ system_prompt: (0, clarifier_js_1.buildClarifySystemPrompt)(session.initialPrompt, session.qaHistory, domain),
98
+ user_message: `The user answered: ${answer}. Ask the next question.`,
99
+ qa_count: session.qaHistory.length,
106
100
  }),
107
101
  },
108
102
  ],
109
103
  };
110
104
  });
111
105
  async function main() {
112
- if (!process.env.ANTHROPIC_API_KEY) {
113
- process.stderr.write("Erreur : ANTHROPIC_API_KEY non définie.\n");
114
- process.exit(1);
115
- }
116
106
  const transport = new stdio_js_1.StdioServerTransport();
117
107
  await server.connect(transport);
118
108
  process.stderr.write("Prompt Clarifier MCP server v2.0 started (stdio)\n");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,wEAAmE;AACnE,wEAAiF;AACjF,iEAG4C;AAE5C,6CAKsB;AACtB,iDAAkF;AAElF,MAAM,MAAM,GAAG,IAAI,iBAAM,CACvB,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,OAAO,EAAE,EAC9C,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAChC,CAAC;AAEF,MAAM,CAAC,iBAAiB,CAAC,iCAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IAC5D,KAAK,EAAE;QACL;YACE,IAAI,EAAE,SAAS;YACf,WAAW,EACT,yIAAyI;YAC3I,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,+DAA+D;qBAC7E;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,iFAAiF;qB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AAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prompt-clarifier-mcp",
3
- "version": "2.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "MCP agent that clarifies user prompts before sending them to any LLM — works in Cursor, VS Code, IntelliJ, PyCharm, Claude Desktop",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -23,10 +23,9 @@
23
23
  "intellij",
24
24
  "jetbrains"
25
25
  ],
26
- "author": "DMI Agentix",
26
+ "author": "",
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "@anthropic-ai/sdk": "^0.39.0",
30
29
  "@modelcontextprotocol/sdk": "^1.0.0"
31
30
  },
32
31
  "devDependencies": {