Fix frontend API base URL for remote access, pin mcp<2.0.0

api.ts and auth.tsx hardcoded API_BASE to http://localhost:8051 with
no override, unlike every other component which already checked
VITE_API_URL first. That's fine when the browser and server are on
the same machine, but breaks auth/chat/stats/documents entirely when
accessing the UI from a different machine than the one running
claude-os - "localhost" resolves to the browser's own machine, not
the server.

Also pins mcp<2.0.0 in requirements.txt: mcp 2.0.0 removed the
low-level Server.list_tools() API that mcp_server/claude_code_mcp.py
(the code-forge stdio MCP server) depends on, so an unbounded
mcp>=1.0.0 install silently breaks that integration.
This commit is contained in:
Rosie Val 2026-08-22 15:31:10 -04:00
parent 614a109378
commit 3512c615c9
3 changed files with 5 additions and 3 deletions

View file

@ -1,4 +1,4 @@
const API_BASE = 'http://localhost:8051';
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8051';
export interface ChatResponse {
response: string;

View file

@ -1,6 +1,6 @@
import { createContext, useContext, useState, useEffect, ReactNode } from 'react';
const API_BASE = 'http://localhost:8051';
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8051';
interface AuthContextType {
isAuthenticated: boolean;

View file

@ -26,7 +26,9 @@ sentence-transformers>=2.2.0
rank-bm25>=0.2.2
# MCP Server
mcp>=1.0.0
# Pinned <2.0.0: claude_code_mcp.py uses the low-level Server API
# (@server.list_tools() etc.) which mcp 2.0.0 removed/renamed.
mcp>=1.0.0,<2.0.0
fastapi>=0.104.0
uvicorn>=0.24.0
pydantic>=2.0.0