@baitong-dev/question-mcp 0.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.
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
7
+ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
8
+ const zod_1 = __importDefault(require("zod"));
9
+ const question_txt_1 = __importDefault(require("../question.txt"));
10
+ const mcp_helpers_1 = require("@baitong-dev/mcp-helpers");
11
+ const MCP_NAME = 'Question MCP';
12
+ const MCP_VERSION = '0.0.1';
13
+ const server = new mcp_js_1.McpServer({
14
+ name: MCP_NAME,
15
+ version: MCP_VERSION
16
+ }, {
17
+ capabilities: {
18
+ logging: {}
19
+ }
20
+ });
21
+ const question = new mcp_helpers_1.Question(server);
22
+ server.registerTool('question', {
23
+ description: question_txt_1.default,
24
+ inputSchema: zod_1.default.object({
25
+ questions: mcp_helpers_1.Question.Questions,
26
+ toolInfo: mcp_helpers_1.Tool.Info
27
+ })
28
+ }, async (args, extra) => {
29
+ const result = await question.ask(args.questions, args.toolInfo, extra);
30
+ return {
31
+ content: [{ type: 'text', text: JSON.stringify(result) }],
32
+ structuredContent: result
33
+ };
34
+ });
35
+ async function main() {
36
+ const transport = new stdio_js_1.StdioServerTransport();
37
+ await server.connect(transport);
38
+ console.error(`${MCP_NAME} Server v${MCP_VERSION} running`);
39
+ }
40
+ main().catch(error => {
41
+ console.error('Fatal error in main():', error);
42
+ process.exit(1);
43
+ });
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@baitong-dev/question-mcp",
3
+ "version": "0.0.1",
4
+ "main": "./dist/index.js",
5
+ "bin": {
6
+ "@baitong-dev/question-mcp": "./dist/index.js"
7
+ },
8
+ "files": [
9
+ "dist",
10
+ "question.txt",
11
+ "README.md"
12
+ ],
13
+ "keywords": [
14
+ "mcp",
15
+ "question"
16
+ ],
17
+ "description": "question-mcp",
18
+ "dependencies": {
19
+ "@modelcontextprotocol/sdk": "^1.25.1",
20
+ "zod": "^4.3.4",
21
+ "@baitong-dev/mcp-helpers": "0.0.5"
22
+ },
23
+ "devDependencies": {
24
+ "typescript": "^5.9.2"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public",
28
+ "registry": "https://registry.npmjs.org"
29
+ },
30
+ "scripts": {
31
+ "tsc": "tsc ./src/index.ts --declaration --module commonjs --target es2021 --esModuleInterop --outDir ./dist"
32
+ }
33
+ }
package/question.txt ADDED
@@ -0,0 +1,10 @@
1
+ Use this tool when you need to ask the user questions during execution. This allows you to:
2
+ 1. Gather user preferences or requirements
3
+ 2. Clarify ambiguous instructions
4
+ 3. Get decisions on implementation choices as you work
5
+ 4. Offer choices to the user about what direction to take.
6
+
7
+ Usage notes:
8
+ - When `custom` is enabled (default), a "Type your own answer" option is added automatically; don't include "Other" or catch-all options
9
+ - Answers are returned as arrays of labels; set `multiple: true` to allow selecting more than one
10
+ - If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label