Skip to content

Conversation

@msukkari
Copy link
Contributor

@msukkari msukkari commented Jan 8, 2026

Fixes MCP results returning undefined filenames for local repositories by adding fallbacks for webUrl.

For local repositories, the webUrl field is inherently undefined. The MCP search_code and list_repos tools were directly using file.webUrl and repo.webUrl respectively, leading to "undefined" being displayed. This PR introduces fallbacks to file.fileName.text for search results and repo.repoCloneUrl for repo listings when webUrl is not available.

Fixes #717


Linear Issue: SOU-193

Open in Cursor Open in Web

…local repos

For local repositories, the webUrl field is undefined since there's no
web hosting URL. This fix makes both search_code and list_repos tools
fallback to the fileName.text and repoCloneUrl respectively when webUrl
is not available.
@cursor
Copy link

cursor bot commented Jan 8, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai
Copy link

coderabbitai bot commented Jan 8, 2026

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@msukkari msukkari marked this pull request as ready for review January 14, 2026 01:37
@msukkari
Copy link
Contributor Author

Heads up @brendan-kellam this PR will slightly change behavior of MCP code search tool to not include web url in file field. IMO this makes sense since this should really just be the path to the file. The result includes a repository field which includes the full repo info

Copy link
Contributor

to clarify, will file just be the path now?

Moved the changelog entry for PR #718 from the main CHANGELOG.md to
packages/mcp/CHANGELOG.md as requested.

Co-authored-by: brendan <[email protected]>
@msukkari msukkari merged commit ba085a9 into main Jan 14, 2026
9 checks passed
@msukkari msukkari deleted the cursor/SOU-193-mcp-undefined-filename-bug-9338 branch January 14, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] MCP results return undefined filename on local repos

4 participants