@rockhopper-co/mcp-server 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/CHANGELOG.md CHANGED
@@ -4,6 +4,67 @@ All notable changes to this project are documented here. Follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
5
5
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.3.0] — 2026-04-24
8
+
9
+ Adds a **library entry point** so `@rockhopper-co/mcp-server` can be
10
+ consumed programmatically — most notably by the remote MCP gateway
11
+ ([`mcp-gateway`](https://github.com/Rockhopper-Co/mcp-gateway)) which
12
+ needs `createServer` and `ApiClient` to wire the Streamable HTTP
13
+ transport. The stdio CLI continues to work exactly as before.
14
+
15
+ ### Added
16
+ - **Library exports.** `import { createServer, ApiClient } from
17
+ '@rockhopper-co/mcp-server'` now works. The library entry is
18
+ side-effect free — importing it does NOT read `ROCKHOPPER_TOKEN`,
19
+ call `process.exit`, or open any transport. Stable surface:
20
+ - `createServer(apiClient: ApiClient): McpServer`
21
+ - `ApiClient` (class), `ApiClientConfig` (interface)
22
+ - All entity types (`Team`, `EnrolledFile`, `FileVersion`, ...)
23
+ - `package.json` `exports` field with explicit subpath conditions for
24
+ `.` (library) and `./package.json` (so consumers can read the
25
+ package version). Anything else is intentionally not part of the
26
+ public API.
27
+
28
+ ### Changed
29
+ - **CLI moved** from `src/index.ts` → `src/cli.ts` so the default
30
+ entrypoint can be a side-effect-free re-export. The `rockhopper-mcp`
31
+ bin still works the same; `npx -y @rockhopper-co/mcp-server` still
32
+ spawns the stdio server. Only difference: `dist/cli.js` is the
33
+ shebang file now (was `dist/index.js`).
34
+ - `package.json` `bin`, `start`, and `dev` scripts now reference
35
+ `cli.js` / `cli.ts`.
36
+ - Publish workflow's "Verify bin is executable" step now checks
37
+ `dist/cli.js`.
38
+
39
+ ### Internal
40
+ - New unit test `lib.exports.test.ts` enforces the side-effect-freedom
41
+ invariant — fails loud if anyone re-introduces top-level CLI
42
+ bootstrap into `index.ts` or `lib.ts`.
43
+ - Old `index.bootstrap.test.ts` renamed to `cli.bootstrap.test.ts`
44
+ with imports adjusted.
45
+
46
+ ## [0.2.1] — 2026-04-24
47
+
48
+ Publishing-pipeline hardening release. **No runtime or API changes** — the
49
+ package code is byte-equivalent to `0.2.0`. Bumped purely to validate the
50
+ CI/CD changes below on a real publish.
51
+
52
+ ### Changed
53
+ - **npm Trusted Publishing (OIDC).** `publish.yml` no longer uses the
54
+ long-lived `NPM_TOKEN` secret. The npm CLI exchanges a short-lived
55
+ GitHub OIDC token for a publishing credential at release time, per
56
+ https://docs.npmjs.com/trusted-publishers. Provenance attestation is
57
+ now implied (cannot be disabled).
58
+ - **Canonical GitHub owner casing in `package.json`.** `repository.url`
59
+ and `bugs.url` now use `Rockhopper-Co` (canonical) instead of
60
+ `rockhopper-co` (lowercase). npm provenance does an exact string
61
+ match against the GitHub-canonical owner — the lowercase URL caused
62
+ E422 on the `0.2.0` first publish attempt before the bootstrap
63
+ succeeded.
64
+ - **CI: npm CLI auto-upgraded** to >= 11.5.1 in the publish workflow
65
+ (Node 20 ships with npm 10.x, which doesn't support Trusted
66
+ Publishing).
67
+
7
68
  ## [0.2.0] — 2026-04-23
8
69
 
9
70
  First public release on npm as `@rockhopper-co/mcp-server`.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { ApiClient } from './api-client.js';
4
+ import { createServer } from './server.js';
5
+ const ROCKHOPPER_API_URL = process.env.ROCKHOPPER_API_URL || 'https://api.rockhopper.co';
6
+ const ROCKHOPPER_TOKEN = process.env.ROCKHOPPER_TOKEN;
7
+ if (!ROCKHOPPER_TOKEN) {
8
+ console.error('Error: ROCKHOPPER_TOKEN environment variable is required.\n' +
9
+ 'Create a Personal Access Token in Rockhopper Settings and set it as ROCKHOPPER_TOKEN.');
10
+ process.exit(1);
11
+ }
12
+ const apiClient = new ApiClient({
13
+ baseUrl: ROCKHOPPER_API_URL,
14
+ token: ROCKHOPPER_TOKEN,
15
+ });
16
+ const server = createServer(apiClient);
17
+ const transport = new StdioServerTransport();
18
+ await server.connect(transport);
19
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,kBAAkB,GACtB,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,2BAA2B,CAAC;AAChE,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;AAEtD,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACtB,OAAO,CAAC,KAAK,CACX,6DAA6D;QAC3D,uFAAuF,CAC1F,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC;IAC9B,OAAO,EAAE,kBAAkB;IAC3B,KAAK,EAAE,gBAAgB;CACxB,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;AAEvC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,11 @@
1
- #!/usr/bin/env node
2
- export {};
1
+ /**
2
+ * Default entry point. Re-exports the public library API from `./lib`.
3
+ *
4
+ * The CLI lives at `./cli.js` (the `rockhopper-mcp` bin). Importing
5
+ * this module is side-effect free; it does NOT start a stdio server.
6
+ *
7
+ * @see ./lib.ts for the canonical export list.
8
+ * @see ./cli.ts for the stdio CLI entrypoint.
9
+ */
10
+ export * from './lib.js';
3
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -1,19 +1,11 @@
1
- #!/usr/bin/env node
2
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
- import { ApiClient } from './api-client.js';
4
- import { createServer } from './server.js';
5
- const ROCKHOPPER_API_URL = process.env.ROCKHOPPER_API_URL || 'https://api.rockhopper.co';
6
- const ROCKHOPPER_TOKEN = process.env.ROCKHOPPER_TOKEN;
7
- if (!ROCKHOPPER_TOKEN) {
8
- console.error('Error: ROCKHOPPER_TOKEN environment variable is required.\n' +
9
- 'Create a Personal Access Token in Rockhopper Settings and set it as ROCKHOPPER_TOKEN.');
10
- process.exit(1);
11
- }
12
- const apiClient = new ApiClient({
13
- baseUrl: ROCKHOPPER_API_URL,
14
- token: ROCKHOPPER_TOKEN,
15
- });
16
- const server = createServer(apiClient);
17
- const transport = new StdioServerTransport();
18
- await server.connect(transport);
1
+ /**
2
+ * Default entry point. Re-exports the public library API from `./lib`.
3
+ *
4
+ * The CLI lives at `./cli.js` (the `rockhopper-mcp` bin). Importing
5
+ * this module is side-effect free; it does NOT start a stdio server.
6
+ *
7
+ * @see ./lib.ts for the canonical export list.
8
+ * @see ./cli.ts for the stdio CLI entrypoint.
9
+ */
10
+ export * from './lib.js';
19
11
  //# 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":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,kBAAkB,GACtB,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,2BAA2B,CAAC;AAChE,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;AAEtD,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACtB,OAAO,CAAC,KAAK,CACX,6DAA6D;QAC3D,uFAAuF,CAC1F,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC;IAC9B,OAAO,EAAE,kBAAkB;IAC3B,KAAK,EAAE,gBAAgB;CACxB,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;AAEvC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,UAAU,CAAC"}
package/dist/lib.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Library entry point for `@rockhopper-co/mcp-server`.
3
+ *
4
+ * This file is **side-effect free** — importing the package as a library
5
+ * (e.g. from the remote MCP gateway) gives you the building blocks
6
+ * (`createServer`, `ApiClient`, types) without spawning a stdio server
7
+ * or reading `ROCKHOPPER_TOKEN` from the environment.
8
+ *
9
+ * The CLI entry (the `rockhopper-mcp` bin) is `./cli.js` — running it
10
+ * directly is what spins up the stdio transport. Library consumers
11
+ * should never import `./cli.js`; they should compose `createServer`
12
+ * with their own transport (HTTP, in-memory, etc.).
13
+ *
14
+ * Stable API surface (semver-bound):
15
+ * - `createServer(apiClient): McpServer`
16
+ * - `ApiClient` (class) and `ApiClientConfig` (interface)
17
+ * - All `types` (Team, EnrolledFile, FileVersion, ...)
18
+ */
19
+ export { createServer } from './server.js';
20
+ export { ApiClient, type ApiClientConfig } from './api-client.js';
21
+ export * from './types.js';
22
+ //# sourceMappingURL=lib.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClE,cAAc,YAAY,CAAC"}
package/dist/lib.js ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Library entry point for `@rockhopper-co/mcp-server`.
3
+ *
4
+ * This file is **side-effect free** — importing the package as a library
5
+ * (e.g. from the remote MCP gateway) gives you the building blocks
6
+ * (`createServer`, `ApiClient`, types) without spawning a stdio server
7
+ * or reading `ROCKHOPPER_TOKEN` from the environment.
8
+ *
9
+ * The CLI entry (the `rockhopper-mcp` bin) is `./cli.js` — running it
10
+ * directly is what spins up the stdio transport. Library consumers
11
+ * should never import `./cli.js`; they should compose `createServer`
12
+ * with their own transport (HTTP, in-memory, etc.).
13
+ *
14
+ * Stable API surface (semver-bound):
15
+ * - `createServer(apiClient): McpServer`
16
+ * - `ApiClient` (class) and `ApiClientConfig` (interface)
17
+ * - All `types` (Team, EnrolledFile, FileVersion, ...)
18
+ */
19
+ export { createServer } from './server.js';
20
+ export { ApiClient } from './api-client.js';
21
+ export * from './types.js';
22
+ //# sourceMappingURL=lib.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAwB,MAAM,iBAAiB,CAAC;AAClE,cAAc,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "name": "@rockhopper-co/mcp-server",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Rockhopper MCP server — expose file metadata, versions, reviews, and comments to AI tools",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
8
15
  "bin": {
9
- "rockhopper-mcp": "dist/index.js"
16
+ "rockhopper-mcp": "dist/cli.js"
10
17
  },
11
18
  "files": [
12
19
  "dist",
@@ -16,8 +23,8 @@
16
23
  ],
17
24
  "scripts": {
18
25
  "build": "tsc -p tsconfig.build.json",
19
- "start": "node dist/index.js",
20
- "dev": "tsx watch src/index.ts",
26
+ "start": "node dist/cli.js",
27
+ "dev": "tsx watch src/cli.ts",
21
28
  "lint": "eslint src/",
22
29
  "typecheck": "tsc --noEmit",
23
30
  "test": "vitest run",