@cognium-ai/mcp-server 0.4.0 → 0.4.2

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/dist/index.d.ts CHANGED
@@ -2,8 +2,17 @@
2
2
  /**
3
3
  * Entry point for the Cognium MCP server.
4
4
  *
5
- * Connects the server to stdio so MCP clients (e.g. cognium-code) can spawn
6
- * it as a subprocess and communicate over stdin/stdout.
5
+ * - As a bin (`cognium-mcp`): connects the server to stdio so MCP clients
6
+ * (e.g. cognium-code) can spawn it as a subprocess and communicate over
7
+ * stdin/stdout.
8
+ * - As a library import (`import { buildServer } from '@cognium-ai/mcp-server'`):
9
+ * re-exports `buildServer` so HTTP transport hosts (e.g. circle-pack's
10
+ * `/api/mcp`) can build and connect to a configured `McpServer` without
11
+ * spawning a subprocess. The stdio bootstrap is guarded by an
12
+ * `import.meta.url === file://${process.argv[1]}` check so library
13
+ * consumers never accidentally start a stdio server on the host process's
14
+ * stdin/stdout.
7
15
  */
8
- export {};
16
+ import { buildServer } from './server.js';
17
+ export { buildServer };
9
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -2,19 +2,33 @@
2
2
  /**
3
3
  * Entry point for the Cognium MCP server.
4
4
  *
5
- * Connects the server to stdio so MCP clients (e.g. cognium-code) can spawn
6
- * it as a subprocess and communicate over stdin/stdout.
5
+ * - As a bin (`cognium-mcp`): connects the server to stdio so MCP clients
6
+ * (e.g. cognium-code) can spawn it as a subprocess and communicate over
7
+ * stdin/stdout.
8
+ * - As a library import (`import { buildServer } from '@cognium-ai/mcp-server'`):
9
+ * re-exports `buildServer` so HTTP transport hosts (e.g. circle-pack's
10
+ * `/api/mcp`) can build and connect to a configured `McpServer` without
11
+ * spawning a subprocess. The stdio bootstrap is guarded by an
12
+ * `import.meta.url === file://${process.argv[1]}` check so library
13
+ * consumers never accidentally start a stdio server on the host process's
14
+ * stdin/stdout.
7
15
  */
8
16
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
9
17
  import { buildServer } from './server.js';
18
+ export { buildServer };
10
19
  async function main() {
11
20
  const server = buildServer();
12
21
  const transport = new StdioServerTransport();
13
22
  await server.connect(transport);
14
23
  }
15
- main().catch((err) => {
16
- // Logging to stderr keeps stdout clean for the JSON-RPC stream.
17
- console.error('Fatal error in cognium-mcp:', err);
18
- process.exit(1);
19
- });
24
+ // Only run the stdio bootstrap when invoked as an executable, not when
25
+ // imported as a library.
26
+ const isMain = import.meta.url === `file://${process.argv[1]}`;
27
+ if (isMain) {
28
+ main().catch((err) => {
29
+ // Logging to stderr keeps stdout clean for the JSON-RPC stream.
30
+ console.error('Fatal error in cognium-mcp:', err);
31
+ process.exit(1);
32
+ });
33
+ }
20
34
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,WAAW,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,gEAAgE;IAChE,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,WAAW,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/D,IAAI,MAAM,EAAE,CAAC;IACX,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,gEAAgE;QAChE,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;QAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognium-ai/mcp-server",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "MCP server exposing Cognium spec-conformance, spec-drift, and pattern-search tools over stdio",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -45,8 +45,8 @@
45
45
  ],
46
46
  "dependencies": {
47
47
  "@modelcontextprotocol/sdk": "^1.29.0",
48
- "circle-ir": "^3.23.3",
49
- "circle-ir-ai": "^2.8.3",
48
+ "circle-ir": "3.38.0",
49
+ "circle-ir-ai": "2.8.13",
50
50
  "minimatch": "^10.2.5",
51
51
  "zod": "^3.25.0"
52
52
  },