Skip to content

fix: return MCP load failures as tool strings - #18

Closed
Frankie-Xu wants to merge 1 commit into
mainfrom
cursor/mcp-load-errors-as-strings-bd8a
Closed

Frankie-Xu wants to merge 1 commit into
mainfrom
cursor/mcp-load-errors-as-strings-bd8a

Conversation

@Frankie-Xu

Copy link
Copy Markdown
Owner

Problem

MCP info() already returns a string when the path is not a KA. search, ask, and every export_* call _load_ka and let FileNotFoundError / ValueError / OSError (and client/template construction failures) escape. That tears down the stdio session.

Proposal

Wrap _load_ka at those tool entry points. Catch load/construction failures and return a string starting with Cannot load KA:. Keep the existing “index not built” and GraphTypeError / FileExistsError messages after a successful load.

Closes yifanfeng97#168

Out of scope

Open in Web Open in Cursor 

Co-authored-by: Frankie-Xu <Frankie-Xu@users.noreply.github.com>
@Frankie-Xu Frankie-Xu closed this Sep 15, 2026
@Frankie-Xu

Copy link
Copy Markdown
Owner Author

Opened against the fork by mistake. Review PR: yifanfeng97#169

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.

fix: MCP search/ask/export should not crash the stdio session on load failure

1 participant