Skip to content

Commit d31766a

Browse files
authored
Merge pull request #14 from jaseci-labs/code-update
fix
2 parents 60142a0 + 26c072e commit d31766a

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

data/mcp_servers.cl.jac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def:pub getMcpServers -> Any {
88
"namespace": "jaseci.org",
99
"transport": "http",
1010
"description": "Official Jac programming language MCP server. Validate, format, and convert Jac code with access to full language docs, grammar, and examples.",
11-
"url": "http://127.0.0.1:3002/mcp/",
11+
"url": "builtin://jac-mcp",
1212
"auth": "none",
1313
"authRequired": False
1414
},

pages/testmcp.jac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ cl {
3131
urlError = "Server URL is required";
3232
return False;
3333
}
34-
if not (url.startsWith("http://") or url.startsWith("https://")) {
34+
if not (url.startsWith("http://") or url.startsWith("https://") or url.startsWith("builtin://")) {
3535
urlError = "URL must start with http:// or https://";
3636
return False;
3737
}
@@ -124,7 +124,7 @@ cl {
124124
className="w-full bg-background border border-input rounded-lg px-4 py-2.5 text-sm text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring/50 focus:border-ring transition-colors"
125125
/>
126126
{urlError and <p className="text-xs text-destructive mt-1">{urlError}</p>}
127-
{(url.includes("localhost") or url.includes("127.0.0.1")) and not url.includes("127.0.0.1:3002") and window.location.hostname != "localhost" and window.location.hostname != "127.0.0.1" and
127+
{(url.includes("localhost") or url.includes("127.0.0.1")) and not url.startsWith("builtin://") and window.location.hostname != "localhost" and window.location.hostname != "127.0.0.1" and
128128
<div className="p-3 bg-warning/10 border border-warning/20 rounded-lg mt-1">
129129
<p className="text-xs text-warning font-medium">⚠ Local server detected</p>
130130
<p className="text-xs text-muted-foreground mt-1">

services/impl/mcp_proxy.impl.jac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ impl mcp_proxy(
66
headers: dict = {},
77
transport: str = "streamable-http"
88
) -> dict {
9+
# Resolve sentinel value to avoid WAF blocking internal IPs in request body
10+
if url == "builtin://jac-mcp" {
11+
url = "http://127.0.0.1:3002/mcp/";
12+
}
13+
914
request_headers = {
1015
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/120 Safari/537.36",
1116
"Content-Type": "application/json",

0 commit comments

Comments
 (0)