From da3129c89b15e61145c9ad702f2ff552cad0a3a4 Mon Sep 17 00:00:00 2001 From: Saravana Achu Mac Date: Tue, 5 May 2026 09:19:11 -0700 Subject: [PATCH] fix(platform): align mcp service urls --- README.md | 1 + docker-compose.yml | 1 + docs/PRODUCTION_READINESS_HANDOFF_ROADMAP.md | 4 ++-- web/.env.example | 2 +- web/src/app/(app)/settings/page.tsx | 4 ++-- web/src/lib/product-config.ts | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 400221f..f40914f 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ Production requirements: - `COSMOS_ENDPOINT`, `COSMOS_KEY`, and `COSMOS_DATABASE` - `FIELD_ENCRYPT_ENABLED=true` with `FIELD_ENCRYPT_KEY_PROVIDER=akv` or a managed key provider and required key material - `PLATFORM_SERVICE_URL`, `EXTRACTION_SERVICE_URL`, and `MCP_SERVER_URL` +- `NEXT_PUBLIC_MCP_SERVER_URL=http://localhost:4007/api` for local web settings/agent guidance - `TELEMETRY_ENABLED=true` and `FEATURE_FLAGS_ENABLED=true` when platform services are available - `LLM_PROVIDER` plus provider credentials (`OPENAI_API_KEY` or Azure OpenAI settings) for non-mock AI behavior diff --git a/docker-compose.yml b/docker-compose.yml index 95feb3d..364a6e1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,6 +52,7 @@ services: - NEXT_PUBLIC_NOTES_API_URL=http://backend:4016/api - NEXT_PUBLIC_PLATFORM_SERVICE_URL=${PLATFORM_SERVICE_URL:-http://localhost:4003}/api - NEXT_PUBLIC_EXTRACTION_SERVICE_URL=${EXTRACTION_SERVICE_URL:-http://localhost:4005} + - NEXT_PUBLIC_MCP_SERVER_URL=${MCP_SERVER_URL:-http://localhost:4007}/api - NEXT_PUBLIC_DIAGNOSTICS_URL=${DIAGNOSTICS_URL:-http://localhost:3000} - NEXT_PUBLIC_TELEMETRY_TRANSPORT=fetch depends_on: diff --git a/docs/PRODUCTION_READINESS_HANDOFF_ROADMAP.md b/docs/PRODUCTION_READINESS_HANDOFF_ROADMAP.md index f55d7eb..f37c0b6 100644 --- a/docs/PRODUCTION_READINESS_HANDOFF_ROADMAP.md +++ b/docs/PRODUCTION_READINESS_HANDOFF_ROADMAP.md @@ -32,7 +32,7 @@ This baseline is from repo inspection on May 5, 2026. - Mobile still has hardcoded colors in a few screens, especially provider/intake labels and button text. These should move to `NoteLettTheme` or shared token-derived mappings. - Backend startup still writes Cosmos init messages through `process.stdout` / `process.stderr`; production paths should use `app.log` or shared logger patterns. - Backend config has development-friendly defaults (`DB_PROVIDER=memory`, default JWT secret, telemetry/flags off). Production must fail closed unless explicitly configured. -- Web default MCP URL uses `http://localhost:4050/mcp`, while common platform documents `mcp-server` on port `4007`. Align URL defaults and examples. +- Web MCP defaults are aligned by P2.1 to the common-platform `mcp-server` on port `4007`. - CI currently covers backend and web lint/typecheck/test/build, and mobile typecheck. It should also run mobile tests, web E2E where practical, Docker builds, and shared platform smoke checks. - The repo uses many common platform packages already, but production readiness should verify runtime behavior against platform-service, extraction-service, blob, telemetry, diagnostics, flags, kill switch, and MCP rather than only checking dependencies. @@ -121,7 +121,7 @@ Acceptance criteria: Goal: prove that NoteLett is using common platform services and packages at runtime, not just declaring dependencies. -- [ ] **P2.1** Align MCP URL defaults and examples across `web/src/lib/product-config.ts`, `web/.env.example`, settings copy, Docker env, and docs. Use common platform `mcp-server` port `4007` unless the shared server exposes a different production route. Commit: +- [x] **P2.1** Align MCP URL defaults and examples across `web/src/lib/product-config.ts`, `web/.env.example`, settings copy, Docker env, and docs. Use common platform `mcp-server` port `4007` unless the shared server exposes a different production route. Commit: `pending`; Verified: legacy MCP port audit returned no matches outside git history, and `rg "NEXT_PUBLIC_MCP_SERVER_URL|MCP_SERVER_URL" web README.md docker-compose.yml docs/PRODUCTION_READINESS_HANDOFF_ROADMAP.md` shows web default/env/settings/Docker now use `http://localhost:4007/api`, matching common-platform `mcp-server` tool routes. - [ ] **P2.2** Add or update platform smoke documentation for `platform-service`, `extraction-service`, `mcp-server`, telemetry, diagnostics, flags, kill switch, blob, and NoteLett backend health. Commit: - [ ] **P2.3** Add a local smoke script or extend existing scripts to check `GET /health`, `GET /api/bootstrap`, platform dependencies, and one authenticated product-backend flow in memory mode. Prefer reusing common platform smoke/self-test conventions. Commit: - [ ] **P2.4** Verify web and mobile shared clients propagate product identity, auth token, and request IDs where supported by common platform clients. Add tests where behavior is local. Commit: diff --git a/web/.env.example b/web/.env.example index 9f2a1eb..0a38c58 100644 --- a/web/.env.example +++ b/web/.env.example @@ -6,4 +6,4 @@ NEXT_PUBLIC_EXTRACTION_SERVICE_URL=http://localhost:4005 NEXT_PUBLIC_DIAGNOSTICS_URL=http://localhost:3000 NEXT_PUBLIC_TELEMETRY_TRANSPORT=fetch NEXT_PUBLIC_WEB_APP_ORIGIN=http://localhost:3000 -NEXT_PUBLIC_MCP_SERVER_URL=http://localhost:4050/mcp +NEXT_PUBLIC_MCP_SERVER_URL=http://localhost:4007/api diff --git a/web/src/app/(app)/settings/page.tsx b/web/src/app/(app)/settings/page.tsx index ec88220..07a2776 100644 --- a/web/src/app/(app)/settings/page.tsx +++ b/web/src/app/(app)/settings/page.tsx @@ -120,7 +120,7 @@ export default function SettingsPage() {
Connect your agent (MCP)

- Use your platform access token with the shared MCP server. Point tools at the NoteLett backend and product id{" "} + Use your platform access token with the shared MCP server on port 4007. Point tools at the NoteLett backend and product id{" "} {PRODUCT_ID}.

           {`Notes API base: ${NOTES_API_URL}
 Platform API: ${PLATFORM_SERVICE_URL}
-MCP server (example): ${MCP_SERVER_URL}
+MCP API base: ${MCP_SERVER_URL}
 
 # Example Cursor / Claude MCP entry (adjust to your installer):
 # "mcpServers": {
diff --git a/web/src/lib/product-config.ts b/web/src/lib/product-config.ts
index caf0687..85ee440 100644
--- a/web/src/lib/product-config.ts
+++ b/web/src/lib/product-config.ts
@@ -13,7 +13,7 @@ export function getWebAppOrigin(): string {
   if (typeof window !== "undefined") return window.location.origin;
   return process.env.NEXT_PUBLIC_WEB_APP_ORIGIN ?? "";
 }
-export const MCP_SERVER_URL = process.env.NEXT_PUBLIC_MCP_SERVER_URL ?? "http://localhost:4050/mcp";
+export const MCP_SERVER_URL = process.env.NEXT_PUBLIC_MCP_SERVER_URL ?? "http://localhost:4007/api";
 export const EXTRACTION_SERVICE_URL = process.env.NEXT_PUBLIC_EXTRACTION_SERVICE_URL ?? "http://localhost:4005";
 export const DIAGNOSTICS_URL = process.env.NEXT_PUBLIC_DIAGNOSTICS_URL ?? PLATFORM_SERVICE_ORIGIN;
 export const TELEMETRY_TRANSPORT =