Skip to content

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
ppshobi:feat/customize-devtools-target-mcp-server-url
Open

feat: use an env variable VITE_MCP_SERVER_URL to make it possible that devtools can point at a different url#449
ppshobi wants to merge 2 commits intoalpic-ai:mainfrom
ppshobi:feat/customize-devtools-target-mcp-server-url

Conversation

@ppshobi
Copy link

@ppshobi ppshobi commented Feb 10, 2026

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 same

Greptile 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

  • Not safe to merge as-is due to a likely browser runtime error in devtools.
  • The PR reads process.env.MCP_SERVER_URL in code that is bundled for the browser via Vite. Without explicit Vite define configuration or using import.meta.env, process is typically undefined in the browser, which can crash the devtools UI at startup. Fixing the env access pattern should make the change safe.
  • packages/devtools/src/lib/mcp/index.ts

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@qchuchu
Copy link
Contributor

qchuchu commented Feb 10, 2026

Hi @ppshobi ! Thanks for contributing :)

Is it because you are using the devtools package without a skybridge mcp server ?

@ppshobi
Copy link
Author

ppshobi commented Feb 11, 2026

@qchuchu kind of, my mcp servers are at different urls, say localhost:3000/xyz/mcp and to point the devtools to the correct one , I found this option easier

@ppshobi ppshobi force-pushed the feat/customize-devtools-target-mcp-server-url branch from 87ff380 to b641820 Compare February 11, 2026 04:07
@ppshobi
Copy link
Author

ppshobi commented Feb 11, 2026

@qchuchu I followed AI's suggestion to load ENV from VITE's mechanism. let me know if I am in the right direction please

@ppshobi ppshobi changed the title feat: use an env variable MCP_SERVER_URL to make it possible that devtools can point at a different url feat: use an env variable VITE_MCP_SERVER_URL to make it possible that devtools can point at a different url Feb 11, 2026
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.

2 participants

Comments