lola-mcp-server 0.2.0__py3-none-any.whl → 0.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lola_mcp_server-0.2.0.dist-info → lola_mcp_server-0.2.1.dist-info}/METADATA +1 -1
- lola_mcp_server-0.2.1.dist-info/RECORD +6 -0
- public_mcp_server.py +18 -2
- lola_mcp_server-0.2.0.dist-info/RECORD +0 -6
- {lola_mcp_server-0.2.0.dist-info → lola_mcp_server-0.2.1.dist-info}/WHEEL +0 -0
- {lola_mcp_server-0.2.0.dist-info → lola_mcp_server-0.2.1.dist-info}/entry_points.txt +0 -0
- {lola_mcp_server-0.2.0.dist-info → lola_mcp_server-0.2.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
public_mcp_server.py,sha256=RcB7GkIRPFN0DWFeX93_Ntch3Nny5Wyzz1pJQWz-Iig,2371
|
|
2
|
+
lola_mcp_server-0.2.1.dist-info/METADATA,sha256=stzIOuIYDt2FtHasFRChULjDnc9DrRoIMzbbIZHSXl4,145
|
|
3
|
+
lola_mcp_server-0.2.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
4
|
+
lola_mcp_server-0.2.1.dist-info/entry_points.txt,sha256=7ohrLpfi22BMGEDWSgn0tQLet94CcyP5AX1Tk5DbalI,59
|
|
5
|
+
lola_mcp_server-0.2.1.dist-info/top_level.txt,sha256=mEMxVolBhbIAki_wnZGkv3e8U-6xFTL2TvC-iP2_MxU,18
|
|
6
|
+
lola_mcp_server-0.2.1.dist-info/RECORD,,
|
public_mcp_server.py
CHANGED
|
@@ -11,6 +11,8 @@ BASE_URL = os.getenv("LOLA_API_BASE_URL")
|
|
|
11
11
|
ACCESS_TOKEN = os.getenv("LOLA_ACCESS_TOKEN")
|
|
12
12
|
AUTH_TOKEN = os.getenv("LOLA_AUTH_TOKEN")
|
|
13
13
|
|
|
14
|
+
# -------- Safety checks --------
|
|
15
|
+
|
|
14
16
|
if not BASE_URL or not BASE_URL.startswith("http"):
|
|
15
17
|
raise RuntimeError("LOLA_API_BASE_URL invalid")
|
|
16
18
|
|
|
@@ -42,19 +44,26 @@ def allowed_tools():
|
|
|
42
44
|
async def register_tools():
|
|
43
45
|
allowed = allowed_tools()
|
|
44
46
|
|
|
47
|
+
# Normalize allowed tool names from token
|
|
48
|
+
allowed_normalized = {t.lower().strip() for t in allowed}
|
|
49
|
+
|
|
45
50
|
async with httpx.AsyncClient() as client:
|
|
46
51
|
res = await client.get(f"{BASE_URL}/tools_lola", headers=headers())
|
|
52
|
+
res.raise_for_status()
|
|
47
53
|
tools = res.json()["tools"]
|
|
48
54
|
|
|
49
55
|
for tool in tools:
|
|
50
56
|
name = tool["name"]
|
|
57
|
+
normalized_name = name.lower().strip()
|
|
51
58
|
|
|
52
|
-
|
|
59
|
+
# Match token tools with server tools
|
|
60
|
+
if normalized_name not in allowed_normalized:
|
|
53
61
|
continue
|
|
54
62
|
|
|
55
63
|
schema = tool["input_schema"]
|
|
56
64
|
desc = tool.get("description", "")
|
|
57
65
|
|
|
66
|
+
# Important: capture name correctly
|
|
58
67
|
async def dynamic_tool(name=name, **kwargs):
|
|
59
68
|
async with httpx.AsyncClient() as client:
|
|
60
69
|
r = await client.post(
|
|
@@ -62,10 +71,17 @@ async def register_tools():
|
|
|
62
71
|
json={"name": name, "arguments": kwargs},
|
|
63
72
|
headers=headers(),
|
|
64
73
|
)
|
|
74
|
+
r.raise_for_status()
|
|
65
75
|
return r.json()
|
|
66
76
|
|
|
67
|
-
mcp.tool(
|
|
77
|
+
mcp.tool(
|
|
78
|
+
name=name,
|
|
79
|
+
description=desc,
|
|
80
|
+
input_schema=schema
|
|
81
|
+
)(dynamic_tool)
|
|
82
|
+
|
|
68
83
|
|
|
84
|
+
# -------- Startup --------
|
|
69
85
|
|
|
70
86
|
async def startup():
|
|
71
87
|
await register_tools()
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
public_mcp_server.py,sha256=oHhe4s6D5Va7PzlElZxwD4MsUTRVbhIDzSH5fUkvWQs,1925
|
|
2
|
-
lola_mcp_server-0.2.0.dist-info/METADATA,sha256=41CPkpuO7z6G_JAq-ctDJBKlf4MApb-EexKO2ESnHWs,145
|
|
3
|
-
lola_mcp_server-0.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
4
|
-
lola_mcp_server-0.2.0.dist-info/entry_points.txt,sha256=7ohrLpfi22BMGEDWSgn0tQLet94CcyP5AX1Tk5DbalI,59
|
|
5
|
-
lola_mcp_server-0.2.0.dist-info/top_level.txt,sha256=mEMxVolBhbIAki_wnZGkv3e8U-6xFTL2TvC-iP2_MxU,18
|
|
6
|
-
lola_mcp_server-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|