feat: use an env variable VITE_MCP_SERVER_URL to make it possible that devtools can point at a different url#449
Open
ppshobi wants to merge 2 commits intoalpic-ai:mainfrom
Conversation
Contributor
|
Hi @ppshobi ! Thanks for contributing :) Is it because you are using the devtools package without a skybridge mcp server ? |
Author
|
@qchuchu kind of, my mcp servers are at different urls, say |
…evtools can point at a different MCP url
87ff380 to
b641820
Compare
Author
|
@qchuchu I followed AI's suggestion to load ENV from VITE's mechanism. let me know if I am in the right direction please |
MCP_SERVER_URL to make it possible that devtools can point at a different urlVITE_MCP_SERVER_URL to make it possible that devtools can point at a different url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
see #444
This pull request adds a support that the devtools can point at a different mcp server url than the hardcoded
localhost:3000/mcp. while defaulting to the sameGreptile Overview
Greptile Summary
This PR changes the devtools MCP client initialization to allow overriding the default MCP endpoint (previously hardcoded to
http://localhost:3000/mcp) via an environment variable (MCP_SERVER_URL).The change is implemented in
packages/devtools/src/lib/mcp/index.ts, which is imported by multiple React UI components and therefore runs in the Vite browser bundle at module load time.Confidence Score: 2/5
process.env.MCP_SERVER_URLin code that is bundled for the browser via Vite. Without explicit Vitedefineconfiguration or usingimport.meta.env,processis typically undefined in the browser, which can crash the devtools UI at startup. Fixing the env access pattern should make the change safe.(2/5) Greptile learns from your feedback when you react with thumbs up/down!