From 4d30ce8c2b9c97b9b6df8e3af095bd7c58d49f56 Mon Sep 17 00:00:00 2001 From: johnyeo Date: Wed, 3 Jun 2026 12:23:27 +0100 Subject: [PATCH] fix: leaf --- apps/leaf/src/lib/env.ts | 2 +- packages/mcp/README.md | 14 +++++++------- scripts/dev.ts | 6 +----- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/apps/leaf/src/lib/env.ts b/apps/leaf/src/lib/env.ts index 96296598e..6d6e878f4 100644 --- a/apps/leaf/src/lib/env.ts +++ b/apps/leaf/src/lib/env.ts @@ -7,7 +7,7 @@ const optionalString = z.preprocess( const envSchema = z .object({ - AUTUMN_MCP_URL: z.string().min(1).default("http://localhost:2718/mcp"), + AUTUMN_MCP_URL: z.string().min(1).default("http://localhost:3099/mcp"), BETTER_AUTH_SECRET: optionalString, CHAT_MODEL: z.string().min(1).default("anthropic/claude-sonnet-4-6"), CHAT_NAME: z.string().min(1).default("Autumn"), diff --git a/packages/mcp/README.md b/packages/mcp/README.md index fda3015e5..9abe0f38b 100644 --- a/packages/mcp/README.md +++ b/packages/mcp/README.md @@ -46,21 +46,21 @@ executes it only after a follow-up confirmation. ## Local -From the repo root: +The routes are served by the `@autumn/leaf` app. From the repo root: ```sh -bun run mcp +bun run leaf ``` -This starts both MCP routes: +This starts both MCP routes (on the leaf port, `3099` by default): -- `http://localhost:2718/mcp` -- `http://localhost:2718/internal/mcp` +- `http://localhost:3099/mcp` +- `http://localhost:3099/internal/mcp` OAuth metadata is route-aware: -- `http://localhost:2718/.well-known/oauth-protected-resource/mcp` -- `http://localhost:2718/.well-known/oauth-protected-resource/internal/mcp` +- `http://localhost:3099/.well-known/oauth-protected-resource/mcp` +- `http://localhost:3099/.well-known/oauth-protected-resource/internal/mcp` OAuth uses the Autumn Better Auth issuer from `--server-url`: OAuth uses the Autumn Better Auth issuer from `MCP_SERVER_URL`: diff --git a/scripts/dev.ts b/scripts/dev.ts index 2cf857517..0c428a003 100644 --- a/scripts/dev.ts +++ b/scripts/dev.ts @@ -18,9 +18,6 @@ const SERVER_PORT = process.env.SERVER_PORT const CHECKOUT_PORT = process.env.CHECKOUT_PORT ? Number.parseInt(process.env.CHECKOUT_PORT, 10) : 3001 + portOffset; -const MCP_PORT = process.env.MCP_PORT - ? Number.parseInt(process.env.MCP_PORT, 10) - : 2718 + portOffset; const CHAT_PORT = process.env.CHAT_PORT ? Number.parseInt(process.env.CHAT_PORT, 10) : 3099 + portOffset; @@ -134,7 +131,7 @@ async function startDev() { } else { console.log("Cleaning up local dev ports...\n"); killPorts({ - ports: [VITE_PORT, SERVER_PORT, CHECKOUT_PORT, MCP_PORT, CHAT_PORT], + ports: [VITE_PORT, SERVER_PORT, CHECKOUT_PORT, CHAT_PORT], }); } @@ -289,7 +286,6 @@ async function startDev() { VITE_PORT: VITE_PORT.toString(), SERVER_PORT: SERVER_PORT.toString(), CHECKOUT_PORT: CHECKOUT_PORT.toString(), - MCP_PORT: MCP_PORT.toString(), CHAT_PORT: CHAT_PORT.toString(), MCP_DEBUG_PENDING_ACTIONS: process.env.MCP_DEBUG_PENDING_ACTIONS ?? "1", MCP_SERVER_URL: