Skip to content

feat: rsdoctor mcp get auto port#1072

Merged
chenjiahan merged 5 commits intomainfrom
feat/ai-auto-port2
May 7, 2025
Merged

feat: rsdoctor mcp get auto port#1072
chenjiahan merged 5 commits intomainfrom
feat/ai-auto-port2

Conversation

@yifancong
Copy link
Copy Markdown
Contributor

@yifancong yifancong commented May 7, 2025

Summary

feat: rsdoctor mcp get auto port

This pull request introduces functionality to manage and retrieve MCP server port information, along with several related enhancements and fixes. The changes include adding utilities for handling MCP configuration (mcp.json), updating server and socket logic to use these utilities, and improving error handling and data processing in other parts of the codebase.

MCP Port Management Enhancements:

  • Added writeMcpPort and getMcpConfigPath utilities in packages/utils/src/common/global-config.ts to manage MCP port configuration in a mcp.json file. These utilities allow storing and retrieving port information for different builders.
  • Updated RsdoctorServer in packages/sdk/src/sdk/server/index.ts to write the MCP port to mcp.json upon server initialization and log the builder-specific server information. [1] [2]
  • Implemented getMcpPort in packages/ai/src/server/socket.ts to read the MCP port from mcp.json, supporting builder-specific ports. This function is used in the getPortFromArgs method to determine the server port dynamically. [1] [2]

Server and Tooling Updates:

  • Added a new getPort tool in packages/ai/src/server/tools.ts to retrieve the MCP server port dynamically. This tool is registered in the server and integrated with the getWsUrl function. [1] [2] [3]
  • Extended the Tools enum in packages/ai/src/server/tools.ts to include getPort.

Data Processing and Error Handling Improvements:

  • Enhanced APIDataLoader in packages/utils/src/common/data/index.ts to handle cases where module or chunk information is missing, improving robustness. [1] [2]
  • Limited the response size of getPackageDependency in packages/ai/src/server/tools.ts to 300 items to avoid processing overly large datasets.

Miscellaneous Changes:

  • Added GlobalConfig export in packages/utils/src/common/index.ts to make the new MCP utilities accessible to other modules.
  • Updated imports across files to integrate the new utilities and methods. [1] [2] [3]

Related Links

@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2025

Deploy Preview for rsdoctor ready!

Name Link
🔨 Latest commit 9d57142
🔍 Latest deploy log https://app.netlify.com/sites/rsdoctor/deploys/681b301281f88b0008852705
😎 Deploy Preview https://deploy-preview-1072--rsdoctor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@yifancong yifancong requested a review from chenjiahan May 7, 2025 01:56
Comment thread packages/ai/src/server/socket.ts Outdated
yifancong and others added 2 commits May 7, 2025 10:40
Comment thread packages/utils/src/common/global-config.ts Outdated
Comment thread packages/sdk/src/sdk/server/index.ts Outdated
@yifancong yifancong requested a review from chenjiahan May 7, 2025 10:04
@chenjiahan chenjiahan merged commit c92a1cf into main May 7, 2025
7 checks passed
@chenjiahan chenjiahan deleted the feat/ai-auto-port2 branch May 7, 2025 10:54
@yifancong yifancong mentioned this pull request May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants