Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions changelog.d/unreleased/3160.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: fixed
issues:
- 3160
affected:
- src/CodeIndex/Mcp/McpServer.cs
- src/CodeIndex/Mcp/McpToolHandlers.cs
- tests/CodeIndex.Tests/McpServerTests.cs
---

## English

- **MCP project filter resolver failures now return structured invalid-argument errors (#3160)** — unresolved or inaccessible project filters now fail before tool execution with a bounded diagnostic instead of falling through to a generic sanitized tool failure.

## 日本語

- **MCP project filter resolver failure が structured invalid-argument error を返すようになりました (#3160)** — 解決できない、またはアクセスできない project filter は tool 実行前に bounded diagnostic 付きで失敗し、generic な sanitized tool failure に落ちないようになりました。
17 changes: 17 additions & 0 deletions changelog.d/unreleased/3182.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: fixed
issues:
- 3182
affected:
- src/CodeIndex/Mcp/McpToolDefinitions.cs
- src/CodeIndex/Mcp/McpToolHandlers.cs
- tests/CodeIndex.Tests/McpServerTests.cs
---

## English

- **MCP path/list argument validation now shares CLI path-filter bounds (#3182)** — path-like arrays now use the CLI count and length limits, and `tools/list` advertises those bounds for client-side validation.

## 日本語

- **MCP path/list 引数検証が CLI の path-filter 上限を共有するようになりました (#3182)** — path 系配列は CLI と同じ件数・長さ上限を使い、`tools/list` でもクライアント側検証用にその上限を広告します。
16 changes: 16 additions & 0 deletions changelog.d/unreleased/3184.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
category: fixed
issues:
- 3184
affected:
- src/CodeIndex/Mcp/McpToolHandlers.cs
- tests/CodeIndex.Tests/McpServerTests.cs
---

## English

- **MCP `impact_analysis` now enforces the shared query length limit (#3184)** — oversized impact queries now fail with the same structured invalid-argument response used by other query tools before impact analysis runs.

## 日本語

- **MCP `impact_analysis` が共有 query 長上限を適用するようになりました (#3184)** — 長すぎる impact query は impact analysis 実行前に、他の query tool と同じ structured invalid-argument response で失敗します。
17 changes: 17 additions & 0 deletions changelog.d/unreleased/3186.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: fixed
issues:
- 3186
affected:
- src/CodeIndex/Mcp/McpToolDefinitions.cs
- src/CodeIndex/Mcp/McpToolHandlers.cs
- tests/CodeIndex.Tests/McpServerTests.cs
---

## English

- **MCP required `path` arguments now fail before lookup when invalid (#3186)** — `outline` and `excerpt` now reject invalid indexed-file paths before database lookup, while `index` rejects non-string, overlong, or NUL-containing project paths before filesystem checks.

## 日本語

- **MCP の必須 `path` 引数が不正な場合 lookup 前に失敗するようになりました (#3186)** — `outline` と `excerpt` は不正な indexed-file path を database lookup 前に拒否し、`index` は non-string、長すぎる値、NUL を含む project path を filesystem check 前に拒否します。
15 changes: 15 additions & 0 deletions changelog.d/unreleased/3192.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
category: fixed
issues:
- 3192
affected:
- tests/CodeIndex.Tests/McpToolContractTests.cs
---

## English

- **MCP `search.cursor` contract is now regression-locked (#3192)** — `cursor` stays advertised, allowlisted, and string-typed across `tools/list` and server-side argument validation.

## 日本語

- **MCP `search.cursor` contract を regression lock しました (#3192)** — `cursor` が `tools/list` と server-side argument validation の両方で advertised / allowlisted / string-typed のまま保たれるよう確認します。
16 changes: 16 additions & 0 deletions changelog.d/unreleased/3194.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
category: fixed
issues:
- 3194
affected:
- src/CodeIndex/Mcp/McpToolHandlers.cs
- tests/CodeIndex.Tests/McpServerTests.cs
---

## English

- **MCP `definition` and `symbols` now reject invalid `since` values (#3194)** — invalid ISO 8601 timestamps now return the same structured invalid-argument response used by other MCP tools instead of silently dropping the freshness filter.

## 日本語

- **MCP `definition` / `symbols` が不正な `since` 値を拒否するようになりました (#3194)** — 不正な ISO 8601 timestamp は freshness filter を黙って無視せず、他の MCP tool と同じ structured invalid-argument response を返します。
16 changes: 16 additions & 0 deletions changelog.d/unreleased/3195.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
category: fixed
issues:
- 3195
affected:
- src/CodeIndex/Mcp/McpToolHandlers.cs
- tests/CodeIndex.Tests/McpServerTests.cs
---

## English

- **MCP pagination now rejects invalid lower bounds (#3195)** — non-positive `limit` values and negative `offset` values now return structured invalid-params errors instead of being silently clamped.

## 日本語

- **MCP pagination が不正な下限値を拒否するようになりました (#3195)** — 非正の `limit` と負の `offset` は、黙って補正されず structured invalid-params error を返すようになりました。
15 changes: 15 additions & 0 deletions changelog.d/unreleased/3196.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
category: fixed
issues:
- 3196
affected:
- tests/CodeIndex.Tests/McpToolContractTests.cs
---

## English

- **MCP `deps` argument contract is now regression-locked (#3196)** — `reverse`, `format`, and `cycles` stay advertised, allowlisted, and typed, while stale hidden arguments such as `direction` and `includeGenerated` stay absent.

## 日本語

- **MCP `deps` argument contract を regression lock しました (#3196)** — `reverse`、`format`、`cycles` が advertised / allowlisted / typed のまま保たれ、`direction` や `includeGenerated` のような古い hidden 引数が戻らないことを確認します。
15 changes: 15 additions & 0 deletions changelog.d/unreleased/3197.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
category: fixed
issues:
- 3197
affected:
- tests/CodeIndex.Tests/McpToolContractTests.cs
---

## English

- **MCP `map` argument contract is now regression-locked (#3197)** — `sections` and `depth` stay advertised, allowlisted, and validated with their documented JSON shapes.

## 日本語

- **MCP `map` argument contract を regression lock しました (#3197)** — `sections` と `depth` が advertised / allowlisted され、documented JSON shape のまま検証されることを確認します。
15 changes: 15 additions & 0 deletions changelog.d/unreleased/3198.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
category: fixed
issues:
- 3198
affected:
- tests/CodeIndex.Tests/McpToolContractTests.cs
---

## English

- **MCP `outline` and `validate` no-op argument contracts are now regression-locked (#3198)** — hidden no-op arguments stay absent and advertised arguments stay aligned with server-side allowlists.

## 日本語

- **MCP `outline` / `validate` の no-op 引数 contract を regression lock しました (#3198)** — hidden no-op 引数が戻らず、advertised 引数と server-side allowlist が一致し続けることを確認します。
9 changes: 9 additions & 0 deletions src/CodeIndex/Mcp/McpServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2479,6 +2479,15 @@ JsonObject CreateUnknownToolResponseForMetrics()
DeferFrameLog(BuildRateLimitedLog(toolName, _caller, decision.RetryAfterMs));
response = CreateRateLimitedErrorResponse(id, toolName, _caller, decision.RetryAfterMs);
}
else if (ValidateProjectFilterArguments(args) is JsonObject projectFilterError)
{
metricsError = "invalid_project_filter";
response = CreateToolErrorResponse(id, projectFilterError["message"]!.GetValue<string>(),
category: McpErrorEnvelope.CategoryInvalidArgument,
suggestion: "Use a project name or project path from the current workspace, or correct the solution filter.",
retrySafe: false,
extraData: projectFilterError);
}
else
{
response = toolName switch
Expand Down
45 changes: 40 additions & 5 deletions src/CodeIndex/Mcp/McpToolDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,48 @@ private static void ApplyCommonSchemaConstraint(string toolName, string name, Js
case "path":
case "project":
case "solution":
obj.TryAdd("minLength", 1);
obj.TryAdd("maxLength", 4096);
obj.TryAdd("pattern", @"^(?!/)(?![A-Za-z]:)(?!.*(^|/)\.\.(/|$))(?!.*\u0000).*$");
AppendConstraintDescription(obj, "Must be workspace-relative, non-empty, and must not contain NUL bytes or `..` path traversal segments.");
if (obj["type"]?.GetValue<string>() == "array")
{
obj.TryAdd("maxItems", MaxMcpArrayFilterCount);
}
else if (name == "path" && toolName == "index")
{
obj.TryAdd("minLength", 1);
obj.TryAdd("maxLength", MaxMcpArrayFilterStringLength);
obj.TryAdd("pattern", @"^(?!.*\u0000).+$");
AppendConstraintDescription(obj, "May be absolute or relative, but must be non-empty and must not contain NUL bytes.");
}
else
{
obj.TryAdd("minLength", 1);
obj.TryAdd("maxLength", MaxMcpArrayFilterStringLength);
obj.TryAdd("pattern", @"^(?!/)(?![A-Za-z]:)(?!.*(^|/)\.\.(/|$))(?!.*\u0000).*$");
AppendConstraintDescription(obj, "Must be workspace-relative, non-empty, and must not contain NUL bytes or `..` path traversal segments.");
}
break;
case "excludePaths":
obj.TryAdd("maxItems", 100);
if (obj["type"]?.GetValue<string>() == "array")
{
obj.TryAdd("maxItems", MaxMcpArrayFilterCount);
}
else
{
obj.TryAdd("minLength", 1);
obj.TryAdd("maxLength", MaxMcpArrayFilterStringLength);
obj.TryAdd("pattern", @"^(?!/)(?![A-Za-z]:)(?!.*(^|/)\.\.(/|$))(?!.*\u0000).*$");
AppendConstraintDescription(obj, "Must be workspace-relative, non-empty, and must not contain NUL bytes or `..` path traversal segments.");
}
break;
case "sections":
if (obj["type"]?.GetValue<string>() == "array")
{
obj.TryAdd("maxItems", MaxMcpArrayFilterCount);
}
else
{
obj.TryAdd("minLength", 1);
obj.TryAdd("maxLength", MaxMcpArrayFilterStringLength);
}
break;
case "limit":
obj.TryAdd("minimum", 1);
Expand Down
Loading
Loading