Skip to content

fix(web): use app url for MCP endpoint - #33

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
akmhatey-ai:fix/mcp-endpoint-app-url
May 16, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
akmhatey-ai:fix/mcp-endpoint-app-url

Conversation

@akmhatey-ai

Copy link
Copy Markdown
Contributor

Summary

  • Use NEXT_PUBLIC_APP_URL as the canonical base for the Settings API Keys MCP endpoint.
  • Reuse one computed endpoint string for both the displayed URL and copy button.

Context

Fixes #27.

The settings page was using window.location.origin directly for the MCP endpoint, while the rest of the app uses NEXT_PUBLIC_APP_URL for canonical app URLs.

Changes

  • Added a small MCP endpoint helper in api-keys-section.tsx.
  • Normalized a trailing slash from NEXT_PUBLIC_APP_URL.
  • Kept window.location.origin as the fallback when the env var is not configured.

Testing

  • corepack yarn eslint src/components/settings/api-keys-section.tsx
  • corepack yarn typecheck
  • npm run version:check
  • git diff --check
  • git diff --cached --check
  • gitleaks protect --staged --no-banner --redact

Notes

corepack yarn lint is currently blocked by existing unrelated lint errors outside this change:

  • web/src/app/[locale]/invite/[token]/page.tsx:24
  • web/src/components/layout/sidebar.tsx:33

I did not run the dashboard manually because full local app startup requires environment-backed services that are outside this fix.

@vercel

vercel Bot commented May 16, 2026

Copy link
Copy Markdown

@akmhatey-ai is attempting to deploy a commit to the gkhngyk's projects Team on Vercel.

A member of the Team first needs to authorize it.

@gkhngyk

gkhngyk commented May 16, 2026

Copy link
Copy Markdown
Contributor

Welcome to Ansvisor, and thank you for the contribution! Merging now.

Nice clean fix — the module-level configuredAppUrl constant + trailing-slash normalize were both bonus moves the issue didn't ask for and both are the right defensive choices. Collapsing the two call sites into a single mcpEndpoint variable is also a tidier shape than what the issue described.

If you'd like to keep an eye on where Ansvisor goes next, a ⭐ on the repo helps others discover it (and Watch sends you a ping when related issues land). Either way — looking forward to your next one.

@gkhngyk
gkhngyk merged commit 2d606ef into ansvisor:main May 16, 2026
@gkhngyk gkhngyk mentioned this pull request May 26, 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.

fix(ui): use NEXT_PUBLIC_APP_URL for the MCP endpoint shown in Settings → API Keys

2 participants