Skip to content

Commit 57d2ef5

Browse files
authored
Merge branch 'main' into michael/sou-200-kill-demo-instance
2 parents 521dcdb + ba085a9 commit 57d2ef5

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

packages/mcp/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
- Fixed invalid file and url MCP results for local indexed repos [#718](https://github.com/sourcebot-dev/sourcebot/pull/718)
12+
1013
## [1.0.11] - 2025-12-03
1114

1215
### Changed

packages/mcp/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ server.tool(
106106
(acc, chunk) => acc + chunk.matchRanges.length,
107107
0,
108108
);
109-
let text = `file: ${file.webUrl}\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}`;
110111

111112
if (includeCodeSnippets) {
112113
const snippets = file.chunks.map(chunk => {
@@ -200,9 +201,10 @@ server.tool(
200201

201202
// Format output
202203
const content: TextContent[] = paginated.map(repo => {
204+
const repoUrl = repo.webUrl ?? repo.repoCloneUrl;
203205
return {
204206
type: "text",
205-
text: `id: ${repo.repoName}\nurl: ${repo.webUrl}`,
207+
text: `id: ${repo.repoName}\nurl: ${repoUrl}`,
206208
}
207209
});
208210

0 commit comments

Comments
 (0)