Skip to content

Commit 5cd01ec

Browse files
committed
revert back to original changes
1 parent 5cb8512 commit 5cd01ec

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

packages/mcp/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
### Changed
1616
- Updated API client to match the latest Sourcebot release. [#652](https://github.com/sourcebot-dev/sourcebot/pull/652)
1717

18+
### Fixed
19+
- Fixed invalid file and url MCP results for local indexed repos [#718](https://github.com/sourcebot-dev/sourcebot/pull/718)
20+
1821
## [1.0.10] - 2025-11-24
1922

2023
### Changed

packages/mcp/src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ server.tool(
106106
(acc, chunk) => acc + chunk.matchRanges.length,
107107
0,
108108
);
109-
110-
let text = `file: ${file.fileName.text}\nnum_matches: ${numMatches}\nrepository: ${file.repository}\nlanguage: ${file.language}`;
109+
const fileIdentifier = file.webUrl ?? file.fileName.text;
110+
let text = `file: ${fileIdentifier}\nnum_matches: ${numMatches}\nrepository: ${file.repository}\nlanguage: ${file.language}`;
111111

112112
if (includeCodeSnippets) {
113113
const snippets = file.chunks.map(chunk => {
@@ -201,9 +201,10 @@ server.tool(
201201

202202
// Format output
203203
const content: TextContent[] = paginated.map(repo => {
204+
const repoUrl = repo.webUrl ?? repo.repoCloneUrl;
204205
return {
205206
type: "text",
206-
text: `id: ${repo.repoName}\nurl: ${repo.repoCloneUrl}`,
207+
text: `id: ${repo.repoName}\nurl: ${repoUrl}`,
207208
}
208209
});
209210

0 commit comments

Comments
 (0)