connectry-architect-mcp 0.1.11 → 0.1.13

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/README.md CHANGED
@@ -22,6 +22,13 @@
22
22
  <a href="https://www.npmjs.com/package/connectry-architect-mcp"><img src="https://img.shields.io/npm/dm/connectry-architect-mcp?style=flat&colorA=18181B&colorB=E8784A" alt="npm downloads"></a>
23
23
  <a href="https://github.com/Connectry-io/connectrylab-architect-cert-mcp"><img src="https://img.shields.io/github/stars/Connectry-io/connectrylab-architect-cert-mcp?style=flat&colorA=18181B&colorB=E8784A" alt="GitHub stars"></a>
24
24
  <a href="https://github.com/Connectry-io/connectrylab-architect-cert-mcp/blob/master/LICENSE"><img src="https://img.shields.io/github/license/Connectry-io/connectrylab-architect-cert-mcp?style=flat&colorA=18181B&colorB=E8784A" alt="License"></a>
25
+ <a href="https://glama.ai/mcp/servers/Connectry-io/connectrylab-architect-cert-mcp"><img src="https://glama.ai/mcp/servers/Connectry-io/connectrylab-architect-cert-mcp/badges/score.svg" alt="Glama Score"></a>
26
+ </p>
27
+
28
+ <p align="center">
29
+ <a href="https://glama.ai/mcp/servers/Connectry-io/connectrylab-architect-cert-mcp">
30
+ <img src="https://glama.ai/mcp/servers/Connectry-io/connectrylab-architect-cert-mcp/badges/card.svg" alt="Connectry Architect Cert MCP server" />
31
+ </a>
25
32
  </p>
26
33
 
27
34
  <p align="center">
@@ -872,5 +879,6 @@ MIT © [Connectry Labs](https://connectry.io/labs)
872
879
  <p align="center">
873
880
  <a href="https://github.com/Connectry-io/connectrylab-architect-cert-mcp">GitHub</a> •
874
881
  <a href="https://www.npmjs.com/package/connectry-architect-mcp">npm</a> •
875
- <a href="https://connectry.io/labs">Website</a>
882
+ <a href="https://connectry.io/labs/architect-cert/">Architect Cert</a>
883
+ <a href="https://connectry.io/labs">Connectry Labs</a>
876
884
  </p>
package/dist/index.js CHANGED
@@ -4,10 +4,37 @@
4
4
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
5
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
6
 
7
- // src/db/store.ts
8
- import Database from "better-sqlite3";
7
+ // src/config.ts
9
8
  import fs from "fs";
10
9
  import path from "path";
10
+ import crypto from "crypto";
11
+ function getConfigDir() {
12
+ const home = process.env["HOME"] ?? process.env["USERPROFILE"] ?? ".";
13
+ return path.join(home, ".connectry-architect");
14
+ }
15
+ function getConfigPath() {
16
+ return path.join(getConfigDir(), "config.json");
17
+ }
18
+ function loadOrCreateUserConfig() {
19
+ const configPath = getConfigPath();
20
+ if (fs.existsSync(configPath)) {
21
+ const raw = fs.readFileSync(configPath, "utf-8");
22
+ return JSON.parse(raw);
23
+ }
24
+ const config = {
25
+ userId: crypto.randomUUID(),
26
+ displayName: null,
27
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
28
+ };
29
+ fs.mkdirSync(getConfigDir(), { recursive: true });
30
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
31
+ return config;
32
+ }
33
+
34
+ // src/db/lazy.ts
35
+ import fs2 from "fs";
36
+ import path2 from "path";
37
+ import { createRequire } from "module";
11
38
 
12
39
  // src/db/schema.ts
13
40
  var SCHEMA_SQL = `
@@ -134,50 +161,45 @@ CREATE TABLE IF NOT EXISTS capstone_build_steps (
134
161
  );
135
162
  `;
136
163
 
137
- // src/db/store.ts
138
- function createDatabase(dbPath2) {
139
- const db2 = new Database(dbPath2);
140
- db2.pragma("journal_mode = WAL");
141
- db2.pragma("foreign_keys = ON");
142
- db2.pragma("synchronous = NORMAL");
143
- db2.pragma("busy_timeout = 5000");
144
- db2.exec(SCHEMA_SQL);
145
- return db2;
146
- }
164
+ // src/db/lazy.ts
147
165
  function getDefaultDbPath() {
148
- const dir = path.join(
166
+ const dir = path2.join(
149
167
  process.env["HOME"] ?? process.env["USERPROFILE"] ?? ".",
150
168
  ".connectry-architect"
151
169
  );
152
- fs.mkdirSync(dir, { recursive: true });
153
- return path.join(dir, "progress.db");
154
- }
155
-
156
- // src/config.ts
157
- import fs2 from "fs";
158
- import path2 from "path";
159
- import crypto from "crypto";
160
- function getConfigDir() {
161
- const home = process.env["HOME"] ?? process.env["USERPROFILE"] ?? ".";
162
- return path2.join(home, ".connectry-architect");
163
- }
164
- function getConfigPath() {
165
- return path2.join(getConfigDir(), "config.json");
166
- }
167
- function loadOrCreateUserConfig() {
168
- const configPath = getConfigPath();
169
- if (fs2.existsSync(configPath)) {
170
- const raw = fs2.readFileSync(configPath, "utf-8");
171
- return JSON.parse(raw);
170
+ fs2.mkdirSync(dir, { recursive: true });
171
+ return path2.join(dir, "progress.db");
172
+ }
173
+ function createLazyDb() {
174
+ let instance = null;
175
+ function getInstance() {
176
+ if (!instance) {
177
+ const require2 = createRequire(import.meta.url);
178
+ const Database = require2("better-sqlite3");
179
+ const dbPath = process.env["CONNECTRY_DB_PATH"] ?? getDefaultDbPath();
180
+ instance = new Database(dbPath);
181
+ instance.pragma("journal_mode = WAL");
182
+ instance.pragma("foreign_keys = ON");
183
+ instance.pragma("synchronous = NORMAL");
184
+ instance.pragma("busy_timeout = 5000");
185
+ instance.exec(SCHEMA_SQL);
186
+ }
187
+ return instance;
172
188
  }
173
- const config = {
174
- userId: crypto.randomUUID(),
175
- displayName: null,
176
- createdAt: (/* @__PURE__ */ new Date()).toISOString()
177
- };
178
- fs2.mkdirSync(getConfigDir(), { recursive: true });
179
- fs2.writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
180
- return config;
189
+ return new Proxy({}, {
190
+ get(_target, prop, receiver) {
191
+ const db2 = getInstance();
192
+ const value = Reflect.get(db2, prop, receiver);
193
+ if (typeof value === "function") {
194
+ return value.bind(db2);
195
+ }
196
+ return value;
197
+ },
198
+ set(_target, prop, value) {
199
+ const db2 = getInstance();
200
+ return Reflect.set(db2, prop, value);
201
+ }
202
+ });
181
203
  }
182
204
 
183
205
  // src/tools/submit-answer.ts
@@ -3227,11 +3249,10 @@ var EXAM_INFO_MARKDOWN = `# Claude Certified Architect \u2014 Foundations
3227
3249
  // src/index.ts
3228
3250
  var server = new McpServer({
3229
3251
  name: "connectry-architect",
3230
- version: "0.1.0"
3252
+ version: "0.1.11"
3231
3253
  });
3232
- var dbPath = process.env["CONNECTRY_DB_PATH"] ?? getDefaultDbPath();
3233
- var db = createDatabase(dbPath);
3234
3254
  var userConfig = loadOrCreateUserConfig();
3255
+ var db = createLazyDb();
3235
3256
  registerTools(server, db, userConfig);
3236
3257
  registerPrompts(server, db, userConfig);
3237
3258
  registerResources(server, db, userConfig);