mcp tokens and urls fix
frdel committed
Aug 8, 2025 at 14:29 UTC
5f4eabdbed32eb87afcd842c8ce419c481f0a82a
3 files changed
+20
-4
python/helpers/mcp_server.py
+5
-1
@@ -273,6 +273,7 @@ class DynamicMcpProxy:
273
274
def __init__(self):
275
cfg = settings.get_settings()
276
+ self.token = ""
277
self.sse_app: ASGIApp | None = None
278
self.http_app: ASGIApp | None = None
279
self.http_session_manager = None
@@ -287,6 +288,9 @@ class DynamicMcpProxy:
288
return DynamicMcpProxy._instance
289
290
def reconfigure(self, token: str):
291
+ if self.token == token:
292
+ return
293
+
294
self.token = token
295
sse_path = f"/t-{self.token}/sse"
296
http_path = f"/t-{self.token}/http"
@@ -404,7 +408,7 @@ class DynamicMcpProxy:
408
# Route based on path
409
path = scope.get("path", "")
410
407
- if f"/t-{self.token}/sse" in path:
411
+ if f"/t-{self.token}/sse" in path or f"t-{self.token}/messages" in path:
412
# Route to SSE app
413
await sse_app(scope, receive, send)
414
elif f"/t-{self.token}/http" in path:
python/helpers/settings.py
+3
-2
@@ -1271,6 +1271,7 @@ def _read_settings_file() -> Settings | None:
1271
1272
1273
def _write_settings_file(settings: Settings):
1274
+ settings = settings.copy()
1275
_write_sensitive_settings(settings)
1276
_remove_sensitive_settings(settings)
1277
@@ -1308,7 +1309,7 @@ def get_default_settings() -> Settings:
1309
return Settings(
1310
version=_get_version(),
1311
chat_model_provider="openrouter",
1311
- chat_model_name="openai/gpt-5",
1312
+ chat_model_name="openai/gpt-5-chat",
1313
chat_model_api_base="",
1314
chat_model_kwargs={"temperature": "0"},
1315
chat_model_ctx_length=100000,
@@ -1333,7 +1334,7 @@ def get_default_settings() -> Settings:
1334
embed_model_rl_requests=0,
1335
embed_model_rl_input=0,
1336
browser_model_provider="openrouter",
1336
- browser_model_name="openai/gpt-5",
1337
+ browser_model_name="openai/gpt-5-chat",
1338
browser_model_api_base="",
1339
browser_model_vision=True,
1340
browser_model_rl_requests=0,
webui/components/settings/a2a/a2a-connection.html
+12
-1
@@ -9,6 +9,17 @@
9
<p>Agent Zero A2A Server enables FastA2A protocol communication with other agents.</p>
10
<p>Other agents can connect using the URL below (replace host if needed):</p>
11
12
+ <!-- API Token Information -->
13
+ <div
14
+ style="background-color: var(--color-bg-secondary); border: 1px solid var(--color-border); border-radius: 6px; padding: 12px; margin: 16px 0;">
15
+ <h4 style="margin: 0 0 8px 0; color: var(--color-text-primary);">API Token Information</h4>
16
+ <p style="margin: 0; color: var(--color-text-secondary); font-size: 14px;">
17
+ The token used in the URL is automatically generated from your username and password.
18
+ This same token is also used for external API endpoints. The token changes when you update your
19
+ credentials.
20
+ </p>
21
+ </div>
22
+
23
<h3>A2A Connection URL</h3>
24
<div id="a2a-connection-example"></div>
25
@@ -44,4 +55,4 @@
55
56
</body>
57
47
-</html>
58
+</html>
\ No newline at end of file