@ng-annotate/mcp-server 0.1.2 → 0.1.5

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,8 @@
1
+ #!/usr/bin/env node
2
+ // Entry point for the ng-annotate-mcp binary.
3
+ // The shebang above causes npm to generate a correct Windows .cmd shim
4
+ // that prepends `node`, rather than trying to run the .js file directly.
5
+ import('../dist/index.js').catch(err => {
6
+ process.stderr.write('[ng-annotate-mcp] Fatal: ' + String(err) + '\n');
7
+ process.exit(1);
8
+ });
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ function log(msg) {
5
5
  process.stderr.write(`[ng-annotate-mcp] ${msg}\n`);
6
6
  }
7
7
  async function main() {
8
- log('starting up...');
8
+ log(`starting up (cwd: ${process.cwd()}, node: ${process.version})`);
9
9
  const server = new McpServer({
10
10
  name: 'ng-annotate',
11
11
  version: '0.1.0',
package/dist/store.js CHANGED
@@ -4,7 +4,11 @@ import { v4 as uuidv4 } from 'uuid';
4
4
  const EMPTY_STORE = { sessions: {}, annotations: {} };
5
5
  // ─── File paths ───────────────────────────────────────────────────────────────
6
6
  export const STORE_DIR = '.ng-annotate';
7
- export const STORE_PATH = path.join(process.cwd(), STORE_DIR, 'store.json');
7
+ // NG_ANNOTATE_PROJECT_ROOT lets the MCP server find the store even when its
8
+ // working directory differs from the Angular project root (e.g. when spawned
9
+ // by VS Code Copilot or Claude Code from a non-project cwd).
10
+ const PROJECT_ROOT = process.env.NG_ANNOTATE_PROJECT_ROOT ?? process.cwd();
11
+ export const STORE_PATH = path.join(PROJECT_ROOT, STORE_DIR, 'store.json');
8
12
  // ─── Store init ───────────────────────────────────────────────────────────────
9
13
  export function ensureStore() {
10
14
  const dir = path.join(process.cwd(), STORE_DIR);
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@ng-annotate/mcp-server",
3
- "version": "0.1.2",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "bin": {
6
- "ng-annotate-mcp": "dist/index.js"
6
+ "ng-annotate-mcp": "bin/ng-annotate-mcp.js"
7
7
  },
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/yngvebn/ngagentify"
11
11
  },
12
12
  "files": [
13
- "dist"
13
+ "dist",
14
+ "bin"
14
15
  ],
15
16
  "main": "dist/index.js",
16
17
  "types": "dist/index.d.ts",