Skip to content

fix(mcp-adapter): list lazy servers in proxy tool description - #1106

Open
thomasstrang-cast wants to merge 2 commits into
getkimchi:masterfrom
thomasstrang-cast:fix/lazy-mcp-server-visibility
Open

fix(mcp-adapter): list lazy servers in proxy tool description#1106
thomasstrang-cast wants to merge 2 commits into
getkimchi:masterfrom
thomasstrang-cast:fix/lazy-mcp-server-visibility

Conversation

@thomasstrang-cast

@thomasstrang-cast thomasstrang-cast commented Aug 28, 2026

Copy link
Copy Markdown

Problem

Before:
image

After:
image

Context:
Lazy MCP servers (configured but not yet connected) were silently skipped when injecting mcp description into contet, making them invisible to the agent. i.e. the agent did not know what MCPs are configured and not yet loaded.

Solution

Modified buildProxyDescription() in src/extensions/mcp-adapter/direct-tools.ts to list lazy servers with a (lazy) marker in the Servers: line instead of skipping them:

Servers: mcp-atlassian (63 tools), castai (lazy)

The agent can then connect on demand via mcp({ connect: "castai" }) to discover and use their tools.

Verification

  • pnpm run check passes (biome lint + tsc type check, 0 errors)
  • New test file passes 4/4
  • Full test suite: 8993 passed, 5 pre-existing failures (confirmed on clean master, unrelated to this change)

Co-Authored-By: Kimchi noreply@kimchi.dev

Lazy MCP servers (configured but not yet connected, no cached tool
metadata) were silently skipped by buildProxyDescription(), making them
invisible to the agent. The agent had no way to know these servers
existed without being told externally.

Now lazy servers appear in the 'Servers:' line with a (lazy) marker,
e.g. 'Servers: mcp-atlassian (63 tools), castai (lazy)'. The agent
can then connect on demand via mcp({ connect: 'server' }) to discover
and use their tools.

Co-Authored-By: Kimchi <noreply@kimchi.dev>
@readme-ai-writer

readme-ai-writer Bot commented Aug 28, 2026

Copy link
Copy Markdown

Documentation Changes Added

Page Section Action Summary
coding-mcp-serversGuides📝 UpdatedUpdated the lifecycle property description to mention that lazy servers appear with a (lazy) marker in the mcp tool description, making them visible to the agent.

🔗 View all changes in ReadMe


Actions

  • Merge documentation branch with PR merge
  • Delete documentation branch with PR close

If neither actions are selected, on PR close/merge the docs branch in ReadMe will remain open.

@kimchi-review

kimchi-review Bot commented Aug 28, 2026

Copy link
Copy Markdown

Kimchi Code Review

Property Value
Commit c7eb083
Author @thomasstrang-cast
Files changed 0
Review status Completed
Comments 1 (1 warning)
Duration 81s

Summary

📊 Review Score: 88/100 (overall code quality — 0 lowest, 100 highest)
⏱️ Estimated effort to review: 1/5 (1 = trivial, 5 = very complex)

🧪 Tests: yes — A new direct-tools.test.ts file covers lazy server visibility, multiple lazy servers, eager-only behaviour, and the no-servers case. It does not cover a cached server with zero tools/resources.

📝 Found 1 issue(s). See inline comments for details.

What to expect

Kimchi will analyze the changes in this pull request and post:

  • A summary of the overall changes
  • Inline comments on specific lines with findings categorized by issue type

The review typically completes within a few minutes. This comment will be updated once the review is ready.

Interact with Kimchi
  • @getkimchi review — re-trigger a full review on the latest commit
  • @getkimchi summary — regenerate the PR summary
  • @getkimchi ignore — skip this PR (no review will be posted)
  • Reply to any inline comment to ask follow-up questions or request clarification
Configuration

Reviews are configured by your organization admin.
Review instructions, excluded directories, and severity thresholds can be adjusted per repository in the Kimchi dashboard.


Powered by Kimchi — AI-powered code review by CAST AI

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Thanks for your first PR on kimchi! A maintainer will review it soon.
Please make sure your PR links to an open issue and your checklist is complete.

@kimchi-review kimchi-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Review Score: 88/100 (overall code quality — 0 lowest, 100 highest)
⏱️ Estimated effort to review: 1/5 (1 = trivial, 5 = very complex)

🧪 Tests: yes — A new direct-tools.test.ts file covers lazy server visibility, multiple lazy servers, eager-only behaviour, and the no-servers case. It does not cover a cached server with zero tools/resources.

📝 Found 1 issue(s). See inline comments for details.

Comment thread src/extensions/mcp-adapter/direct-tools.ts
A cached server with zero discoverable tools (e.g. all excluded by
filter) was incorrectly labelled (lazy). Now only servers with no cache
entry get the (lazy) marker; cached-but-empty servers are skipped silently.

Co-Authored-By: Kimchi <noreply@kimchi.dev>
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.

1 participant