@m-velikov/cpp-quick-start-mcp 0.2.0 → 0.3.0

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/build/index.js CHANGED
@@ -3,7 +3,7 @@ import { serve } from "@hono/node-server";
3
3
  import { Hono } from "hono";
4
4
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
5
5
  import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
6
- import { ListPromptsRequestSchema, GetPromptRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ErrorCode, McpError, } from "@modelcontextprotocol/sdk/types.js";
6
+ import { ListPromptsRequestSchema, GetPromptRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ListToolsRequestSchema, CallToolRequestSchema, ErrorCode, McpError, } from "@modelcontextprotocol/sdk/types.js";
7
7
  import * as fs from "fs/promises";
8
8
  import * as path from "path";
9
9
  import { fileURLToPath } from "url";
@@ -18,6 +18,7 @@ const server = new Server({
18
18
  capabilities: {
19
19
  prompts: {},
20
20
  resources: {},
21
+ tools: {},
21
22
  },
22
23
  });
23
24
  // Resources: serve all SKILL.md files inside data/ folders
@@ -67,6 +68,89 @@ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
67
68
  throw new McpError(ErrorCode.InvalidRequest, `Resource not found: ${uri}`);
68
69
  }
69
70
  });
71
+ // Tools: explicitly expose list_resources and read_resource
72
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
73
+ return {
74
+ tools: [
75
+ {
76
+ name: "list_resources",
77
+ description: "List all available C++ scaffolding skills/resources that can be fetched via read_resource.",
78
+ inputSchema: {
79
+ type: "object",
80
+ properties: {},
81
+ required: [],
82
+ },
83
+ },
84
+ {
85
+ name: "read_resource",
86
+ description: "Read a specific C++ scaffolding skill/resource by its URI.",
87
+ inputSchema: {
88
+ type: "object",
89
+ properties: {
90
+ uri: {
91
+ type: "string",
92
+ description: "The URI of the resource to fetch (e.g., mcp://scaffold/best-practices-cpp).",
93
+ },
94
+ },
95
+ required: ["uri"],
96
+ },
97
+ },
98
+ ],
99
+ };
100
+ });
101
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
102
+ if (request.params.name === "list_resources") {
103
+ const dirs = await fs.readdir(DATA_DIR);
104
+ const resources = [];
105
+ for (const dir of dirs) {
106
+ if (dir === "meta-quickstart")
107
+ continue;
108
+ const skillPath = path.join(DATA_DIR, dir, "SKILL.md");
109
+ try {
110
+ await fs.access(skillPath);
111
+ resources.push(`mcp://scaffold/${dir}`);
112
+ }
113
+ catch (e) {
114
+ // ignore
115
+ }
116
+ }
117
+ return {
118
+ content: [
119
+ {
120
+ type: "text",
121
+ text: `Available resources:\n${resources.map(r => `- ${r}`).join("\\n")}`,
122
+ },
123
+ ],
124
+ };
125
+ }
126
+ if (request.params.name === "read_resource") {
127
+ const uri = request.params.arguments?.uri;
128
+ if (typeof uri !== "string") {
129
+ throw new McpError(ErrorCode.InvalidParams, "Invalid or missing 'uri' argument");
130
+ }
131
+ const match = uri.match(/^mcp:\/\/scaffold\/(.+)$/);
132
+ if (!match) {
133
+ throw new McpError(ErrorCode.InvalidRequest, `Invalid URI: ${uri}`);
134
+ }
135
+ const skillName = path.basename(match[1]);
136
+ const skillPath = path.join(DATA_DIR, skillName, "SKILL.md");
137
+ try {
138
+ const content = await fs.readFile(skillPath, "utf-8");
139
+ return {
140
+ content: [
141
+ {
142
+ type: "text",
143
+ text: content,
144
+ },
145
+ ],
146
+ };
147
+ }
148
+ catch (error) {
149
+ throw new McpError(ErrorCode.InvalidRequest, `Resource not found: ${uri}`);
150
+ }
151
+ }
152
+ throw new McpError(ErrorCode.MethodNotFound, `Tool not found: ${request.params.name}`);
153
+ });
70
154
  // Prompts: expose the meta-quickstart interview
71
155
  server.setRequestHandler(ListPromptsRequestSchema, async () => {
72
156
  return {
@@ -134,7 +218,7 @@ async function main() {
134
218
  app.all("/mcp", async (c) => {
135
219
  return transport.handleRequest(c.req.raw);
136
220
  });
137
- const HOST = values.host ?? process.env.HOST ?? "0.0.0.0";
221
+ const HOST = values.host ?? process.env.HOST ?? "127.0.0.1";
138
222
  console.log(`Starting C++ Quick Start MCP Server on http://${HOST}:${PORT}/mcp ...`);
139
223
  serve({
140
224
  fetch: app.fetch,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,wCAAwC,EAAE,MAAM,+DAA+D,CAAC;AACzH,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,SAAS,EACT,QAAQ,GACT,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEpD,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;IACE,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,OAAO;CACjB,EACD;IACE,YAAY,EAAE;QACZ,OAAO,EAAE,EAAE;QACX,SAAS,EAAE,EAAE;KACd;CACF,CACF,CAAC;AAEF,2DAA2D;AAC3D,MAAM,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E5D,OAAO,CAAC,GAAG,CACT,iDAAiD,IAAI,IAAI,IAAI,UAAU,CACxE,CAAC;IACF,KAAK,CAAC;QACJ,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
@@ -52,13 +52,19 @@ If the project already exists, **DO NOT** conduct the full Mode A interview.
52
52
  1. **Convention Scanning**: You MUST read the existing build files (e.g., `CMakeLists.txt`, `Makefile`) and a few source files to automatically infer the build system, package manager, directory layout, naming conventions, and code formatting style. Auto-detect whatever is possible.
53
53
  2. **Path Selection**: Ask the user: _"I see this is an existing project. Would you like to **1. Add new components** (libraries/executables), or **2. Modernize the codebase and augment it for agentic development**?"_
54
54
 
55
- **If the user chooses Path 1 (Add Components):** 3. **Component Interview**: Ask the user what new components to add, prompting repeatedly until they say "no more targets for now". 4. **Target Platforms**: Ask about support for major target platforms (e.g., Desktop vs. Mobile, Windows vs Linux, Android vs macOS). 5. **Layout Conformity Check**: Evaluate if adding these new components causes the project to violate its inferred directory layout conventions.
56
-
57
- - If it violates conventions or if the target platforms suggest a more robust layout, suggest a layout refactoring (e.g., migrating to Pitchfork layout).
58
-
55
+ **If the user chooses Path 1 (Add Components):**
56
+ 3. **Component Interview**: Ask the user what new components to add, prompting repeatedly until they say "no more targets for now".
57
+ 4. **Target Platforms**: Ask about support for major target platforms (e.g., Desktop vs. Mobile, Windows vs Linux, Android vs macOS).
58
+ 5. **Layout Conformity Check**: Evaluate if adding these new components causes the project to violate its inferred directory layout conventions.
59
+ - If it violates conventions or if the target platforms suggest a more robust layout, you MUST explicitly suggest a layout refactoring (e.g., migrating to Pitchfork layout).
59
60
  6. Proceed to **Step 2 (Implementation Plan)**.
60
61
 
61
- **If the user chooses Path 2 (Modernize & Augment):** 3. **Missing Tooling Interview**: Based on the auto-detected conventions, identify missing modern tooling (e.g., code hygiene like `.clang-format` and pre-commit hooks, `.clang-tidy`, testing frameworks, CI/CD, base configs like `.gitignore`). Ask the user which of these missing tools they would like to integrate. 4. **Build System Evaluation**: Evaluate the existing build system. Do NOT suggest migrating it to a completely different build system (e.g., do not migrate Makefiles to CMake). Instead, suggest improvements for the existing build system (e.g., modernizing legacy CMake to target-based CMake, or optimizing Makefiles). **If CMake is used, suggest generating a `CMakePresets.json` to standardize build configurations.** 5. **Target Platforms**: Ask the user about support for major target platforms (e.g., Desktop vs. Mobile, Windows vs Linux, Android vs macOS). Suggest migrating to the Pitchfork directory layout based on their answers if the current layout is insufficient. 6. Proceed to **Step 2 (Implementation Plan)**.
62
+ **If the user chooses Path 2 (Modernize & Augment):**
63
+ 3. **Missing Tooling Interview**: Based on the auto-detected conventions, identify missing modern tooling (e.g., code hygiene like `.clang-format` and pre-commit hooks, `.clang-tidy`, testing frameworks, CI/CD, base configs like `.gitignore`). Ask the user which of these missing tools they would like to integrate.
64
+ 4. **Build System Evaluation**: Evaluate the existing build system. Do NOT suggest migrating it to a completely different build system (e.g., do not migrate Makefiles to CMake). Instead, suggest improvements for the existing build system (e.g., modernizing legacy CMake to target-based CMake, or optimizing Makefiles). **If CMake is used, suggest generating a `CMakePresets.json` to standardize build configurations.**
65
+ 5. **Layout Refactoring**: You MUST explicitly ask the user if they would like to migrate to the standard Pitchfork directory layout, explaining its benefits for modern C++ projects, unless they are already strictly following it.
66
+ 6. **Target Platforms**: Ask the user about support for major target platforms (e.g., Desktop vs. Mobile, Windows vs Linux, Android vs macOS).
67
+ 7. Proceed to **Step 2 (Implementation Plan)**.
62
68
 
63
69
  ---
64
70
 
@@ -66,7 +72,9 @@ If the project already exists, **DO NOT** conduct the full Mode A interview.
66
72
 
67
73
  Based on the chosen Mode and the user's answers, create a formal implementation plan.
68
74
 
69
- **CRITICAL TOOLING RULE**: For every tool, build system, CI provider, code quality checker, or package manager selected by the user (or universally required, like `base-configs`), you MUST actively attempt to fetch its corresponding `mcp://scaffold/<name>` resource using the `read_resource` tool before writing files. If a specific resource exists, you must follow it strictly. However, if no specific resource exists for a chosen tool, you should still proceed and do your best to configure it correctly using your general knowledge.
75
+ **CRITICAL TOOLING RULE**: For every tool, build system, CI provider, code quality checker, or package manager selected by the user (or universally required, like `base-configs`), you MUST actively attempt to fetch its corresponding `mcp://scaffold/<name>` resource.
76
+ - **Resource Discovery**: First, invoke the `list_resources` tool (if available) to discover the exact URIs of all available `mcp://scaffold/*` resources. Do not guess the URIs blindly.
77
+ - **Resource Fetching**: Then, use the `read_resource` tool to fetch the content of the relevant URIs before writing files. If a specific resource exists for a chosen tool, you must follow it strictly. If no specific resource exists, you should still proceed and configure it correctly using your general knowledge.
70
78
 
71
79
  **If you are in Mode A (New Project):**
72
80
  Your plan must outline the exact file templates and commands needed to bootstrap the cross-platform C++ project using the chosen stack.
@@ -101,10 +109,10 @@ The workspace skills to create are:
101
109
 
102
110
  1. `skills/configure-project/SKILL.md`: Exact instructions and CLI commands for fetching dependencies, installing them, and configuring the project (e.g., `conan install` or `vcpkg install` followed by `cmake -B build`).
103
111
  2. `skills/build-project/SKILL.md`: Exact instructions and CLI commands for building the project (e.g., `cmake --build build -j`).
104
- 3. **Component Best Practices**: For each of the components and tools used in the project (e.g., CMake, vcpkg, GTest), create a dedicated skill containing best practices and usage instructions tailored to this specific project.
105
- 4. **Refactoring Best Practices**: Create a skill (e.g., `skills/best-practices-refactoring/SKILL.md`) detailing how to safely refactor code within the project's layout and test constraints. **Include the rule**: When creating or renaming a C++ namespace, review the names of the files and directories where members of the namespace are declared/defined; strive for consistency.
106
- 5. **Code Review Best Practices**: Create a skill (e.g., `skills/best-practices-code-review/SKILL.md`) containing guidelines for reviewing code to ensure compliance with the project's chosen formatting, style, and CI requirements.
107
- 6. **C++ Core Guidelines Best Practices**: Create a skill (e.g., `skills/best-practices-cpp/SKILL.md`) establishing fundamental C++ guidelines based on the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md).
112
+ 3. **Component Best Practices**: For each of the components and tools used in the project (e.g., CMake, vcpkg, GTest), create a dedicated skill containing best practices and usage instructions tailored to this specific project. **CRITICAL**: You MUST use the `read_resource` tool to fetch the corresponding `mcp://scaffold/best-practices-<name>` resource and include its contents IN FULL (do not summarize or truncate).
113
+ 4. **Refactoring Best Practices**: Create a skill (e.g., `skills/best-practices-refactoring/SKILL.md`) detailing how to safely refactor code within the project's layout and test constraints. **CRITICAL**: You MUST fetch the `mcp://scaffold/best-practices-refactoring` resource and include its contents IN FULL. **Also include the rule**: When creating or renaming a C++ namespace, review the names of the files and directories where members of the namespace are declared/defined; strive for consistency.
114
+ 5. **Code Review Best Practices**: Create a skill (e.g., `skills/best-practices-code-review/SKILL.md`) containing guidelines for reviewing code to ensure compliance with the project's chosen formatting, style, and CI requirements. **CRITICAL**: You MUST fetch the `mcp://scaffold/best-practices-code-review` resource and include its contents IN FULL.
115
+ 6. **C++ Core Guidelines Best Practices**: Create a skill (e.g., `skills/best-practices-cpp/SKILL.md`) establishing fundamental C++ guidelines based on the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md). **CRITICAL**: You MUST fetch the `mcp://scaffold/best-practices-cpp` resource and include its contents IN FULL.
108
116
 
109
117
  Wait for the user's explicit approval on the implementation plan before proceeding to Execution.
110
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m-velikov/cpp-quick-start-mcp",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "An MCP server for scaffolding modern C++ projects and agentic configurations.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -56,4 +56,4 @@
56
56
  "typescript": "^6.0.3",
57
57
  "typescript-eslint": "^8.13.0"
58
58
  }
59
- }
59
+ }