@oss-scout/mcp 0.7.0 → 0.9.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/dist/bin.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/bin.js ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Executable entry for the `oss-scout-mcp` binary. The shebang lives here
4
+ * (this is the esbuild bundle entry); importing the package (`index.ts`)
5
+ * stays side-effect-free (#148).
6
+ */
7
+ import { runServer } from "./index.js";
8
+ runServer().catch((err) => {
9
+ process.stderr.write(`oss-scout-mcp fatal: ${err instanceof Error ? err.message : String(err)}\n`);
10
+ process.exit(1);
11
+ });
package/dist/index.d.ts CHANGED
@@ -1 +1,26 @@
1
- export {};
1
+ /**
2
+ * Library entry point for @oss-scout/mcp.
3
+ *
4
+ * Importing this module has NO side effects: it does not start a server,
5
+ * read a token, or call process.exit (#148). The executable lives in
6
+ * `bin.ts`, which the published `oss-scout-mcp` binary bundles.
7
+ */
8
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
9
+ import { registerTools } from "./tools.js";
10
+ export { registerTools } from "./tools.js";
11
+ export { registerResources } from "./resources.js";
12
+ /** Server identity, kept in one place for the bin and any embedding host. */
13
+ export declare const SERVER_INFO: {
14
+ readonly name: "oss-scout-mcp";
15
+ readonly version: "0.9.0";
16
+ };
17
+ /**
18
+ * Build a fully-wired MCP server (tools + resources) around a scout.
19
+ * Side-effect-free: the caller owns transport and lifecycle.
20
+ */
21
+ export declare function createServer(scout: Parameters<typeof registerTools>[1]): McpServer;
22
+ /**
23
+ * Boot the stdio MCP server: resolve a token, build the scout, and connect.
24
+ * Throws on a missing token (the bin maps that to a stderr message + exit).
25
+ */
26
+ export declare function runServer(): Promise<void>;
package/dist/index.js CHANGED
@@ -1,23 +1,44 @@
1
+ /**
2
+ * Library entry point for @oss-scout/mcp.
3
+ *
4
+ * Importing this module has NO side effects: it does not start a server,
5
+ * read a token, or call process.exit (#148). The executable lives in
6
+ * `bin.ts`, which the published `oss-scout-mcp` binary bundles.
7
+ */
1
8
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
9
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
10
  import { createScout, getGitHubToken } from "@oss-scout/core";
4
11
  import { registerTools } from "./tools.js";
5
12
  import { registerResources } from "./resources.js";
6
- async function main() {
13
+ export { registerTools } from "./tools.js";
14
+ export { registerResources } from "./resources.js";
15
+ /** Server identity, kept in one place for the bin and any embedding host. */
16
+ export const SERVER_INFO = {
17
+ name: "oss-scout-mcp",
18
+ version: "0.9.0", // x-release-please-version
19
+ };
20
+ /**
21
+ * Build a fully-wired MCP server (tools + resources) around a scout.
22
+ * Side-effect-free: the caller owns transport and lifecycle.
23
+ */
24
+ export function createServer(scout) {
25
+ const server = new McpServer({ name: SERVER_INFO.name, version: SERVER_INFO.version }, { capabilities: { resources: {}, tools: {} } });
26
+ registerTools(server, scout);
27
+ registerResources(server, scout);
28
+ return server;
29
+ }
30
+ /**
31
+ * Boot the stdio MCP server: resolve a token, build the scout, and connect.
32
+ * Throws on a missing token (the bin maps that to a stderr message + exit).
33
+ */
34
+ export async function runServer() {
7
35
  const token = getGitHubToken();
8
36
  if (!token) {
9
- process.stderr.write("oss-scout-mcp: GitHub token required.\n" +
10
- "Set GITHUB_TOKEN or run `gh auth login`.\n");
11
- process.exit(1);
37
+ throw new Error("GitHub token required. Set GITHUB_TOKEN or run `gh auth login`.");
12
38
  }
13
- const scout = await createScout({ githubToken: token });
14
- const server = new McpServer({ name: "oss-scout-mcp", version: "0.2.1" }, { capabilities: { resources: {}, tools: {} } });
15
- registerTools(server, scout);
16
- registerResources(server, scout);
17
- const transport = new StdioServerTransport();
18
- await server.connect(transport);
39
+ // Local persistence: read and write ~/.oss-scout/state.json so the server
40
+ // sees the user's preferences and history and survives restarts (#113).
41
+ const scout = await createScout({ githubToken: token, persistence: "local" });
42
+ const server = createServer(scout);
43
+ await server.connect(new StdioServerTransport());
19
44
  }
20
- main().catch((err) => {
21
- process.stderr.write(`oss-scout-mcp fatal: ${err instanceof Error ? err.message : String(err)}\n`);
22
- process.exit(1);
23
- });