@oss-scout/mcp 0.10.0 → 0.10.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/tools.js CHANGED
@@ -16,6 +16,12 @@ const PERSIST_WARNING = "Checkpoint failed: changes were applied in memory but c
16
16
  function withPersistWarning(payload, persisted) {
17
17
  return persisted ? payload : { ...payload, persistWarning: PERSIST_WARNING };
18
18
  }
19
+ /**
20
+ * Rejects when `ms` elapses, but does NOT cancel the underlying work — the
21
+ * scout call keeps running (consuming API budget and mutating scout state)
22
+ * after the tool has returned its timeout error. Acceptable for a local
23
+ * stdio server; revisit with AbortSignal threading if it ever matters (#295).
24
+ */
19
25
  function withTimeout(promise, ms = TOOL_TIMEOUT_MS) {
20
26
  let timeoutId;
21
27
  const timer = new Promise((_, reject) => {
@@ -27,8 +33,14 @@ export function registerTools(server, scout) {
27
33
  server.tool("search", "Search for open source issues matching your preferences", {
28
34
  maxResults: z
29
35
  .number()
36
+ .int()
37
+ .min(1)
38
+ // 100, not 50: the CLI's search count is unbounded, so a tight MCP
39
+ // cap made the two surfaces disagree for 1.5.0 clients while still
40
+ // needing SOME ceiling against absurd values (#317).
41
+ .max(100)
30
42
  .optional()
31
- .describe("Maximum number of results to return (default 10)"),
43
+ .describe("Maximum number of results to return (1-100, default 10)"),
32
44
  strategies: z
33
45
  .string()
34
46
  .optional()
@@ -57,10 +69,17 @@ export function registerTools(server, scout) {
57
69
  .describe("Diversity counterweight (#1244): fraction of result slots reserved for candidates that matched NEITHER preference list. Counters echo-chamber bias when boosts accumulate over time. 0 disables, 1 reserves every slot for diversity. Default 0."),
58
70
  }, async ({ maxResults, strategies, preferLanguages, preferRepos, avoidRepos, boostIssueTypes, diversityRatio, }) => {
59
71
  try {
72
+ // Validate each CSV entry with a readable error instead of letting a
73
+ // raw ZodError string reach the model (#295).
60
74
  const parsedStrategies = strategies
61
- ? strategies
62
- .split(",")
63
- .map((s) => SearchStrategySchema.parse(s.trim()))
75
+ ? strategies.split(",").map((s) => {
76
+ const trimmed = s.trim();
77
+ const parsed = SearchStrategySchema.safeParse(trimmed);
78
+ if (!parsed.success) {
79
+ throw new Error(`Invalid strategy "${trimmed}". Valid strategies: ${SearchStrategySchema.options.join(", ")}`);
80
+ }
81
+ return parsed.data;
82
+ })
64
83
  : undefined;
65
84
  const result = await withTimeout(scout.search({
66
85
  maxResults: maxResults ?? 10,
@@ -97,8 +116,11 @@ export function registerTools(server, scout) {
97
116
  server.tool("scout-features", "Surface feature-scoped contribution opportunities in repos where you have 3+ merged PRs", {
98
117
  maxResults: z
99
118
  .number()
119
+ .int()
120
+ .min(1)
121
+ .max(50)
100
122
  .optional()
101
- .describe("Maximum number of results to return (default 10)"),
123
+ .describe("Maximum number of results to return (1-50, default 10)"),
102
124
  anchorThreshold: z
103
125
  .number()
104
126
  .int()
@@ -225,6 +247,9 @@ export function registerTools(server, scout) {
225
247
  };
226
248
  }
227
249
  if (action === "remove") {
250
+ // Deliberately no URL validation, matching the CLI's runSkipRemove:
251
+ // entries stored before skip-add validation existed may be junk,
252
+ // and exact-match removal is the only way to clean them up.
228
253
  const wasPresent = scout
229
254
  .getSkippedIssues()
230
255
  .some((s) => s.url === issueUrl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-scout/mcp",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "MCP server for oss-scout — exposes issue discovery and vetting as MCP tools",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,8 +8,8 @@
8
8
  },
9
9
  "exports": {
10
10
  ".": {
11
- "import": "./dist/index.js",
12
- "types": "./dist/index.d.ts"
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
13
  }
14
14
  },
15
15
  "files": [
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@modelcontextprotocol/sdk": "^1.27.1",
20
20
  "zod": "^4.3.6",
21
- "@oss-scout/core": "^1.1.0"
21
+ "@oss-scout/core": "^1.5.2"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/node": "^25.5.0",