| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
- Modified web MCP server to check configured language models before registering the ask_codebase tool - Made createMcpServer() async to support awaiting the config check - Updated standalone MCP package to check /api/models before registering ask_codebase tool - Tool is now only visible when at least one language model is configured Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
|
Caution Review failedThe pull request is closed. Configuration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 16661059-74a2-441a-97f5-63feb05b5a09 📥 CommitsReviewing files that changed from the base of the PR and between 6b52d37 and cbf8f25. 📒 Files selected for processing (4)
WalkthroughThis change refactors MCP server initialization to be asynchronous and conditionally registers the ask_codebase tool only when language model providers are configured. The MCP route handler is updated to await async server creation. Documentation is updated to note the deprecation of packages/mcp package and changelog entry for the conditional tool visibility. Changes
Sequence DiagramsequenceDiagram
participant Client
participant RouteHandler as Route Handler
participant ServerInit as Server Init
participant LMService as LM Service
participant MCPServer as MCP Server
Client->>RouteHandler: POST /mcp (new session)
RouteHandler->>ServerInit: await createMcpServer()
ServerInit->>LMService: getConfiguredLanguageModels()
LMService-->>ServerInit: models list
ServerInit->>MCPServer: new McpServer()
alt hasLanguageModels = true
ServerInit->>MCPServer: register ask_codebase tool
else hasLanguageModels = false
ServerInit->>MCPServer: skip ask_codebase tool
end
MCPServer-->>ServerInit: server instance
ServerInit-->>RouteHandler: Promise resolved
RouteHandler->>MCPServer: mcpServer.connect(transport)
MCPServer-->>Client: connection established
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
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. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
The packages/mcp package is deprecated and should not be modified. Reverted the conditional ask_codebase registration changes from this package. Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
Summary
This PR hides the ask_codebase tool in MCP when no language model providers are configured. Previously, the tool was always visible but would return an error when invoked without configured models. Now the tool is simply not registered/visible when there are no models configured.
Changes
Web MCP Server (packages/web/src/features/mcp/server.ts)
MCP Route Handler (packages/web/src/app/api/(server)/mcp/route.ts)
AGENTS.md
Analysis: Making createMcpServer Async
Confirmed that making createMcpServer async is safe:
Testing
Verified the feature works correctly by testing the MCP API endpoint:
Without models configured (6 tools visible):
With models configured (7 tools visible):
All existing tests pass:
Fixes SOU-718
Linear Issue: SOU-718
Summary by CodeRabbit
Changed
Documentation