lola-mcp-server 0.2.0__py3-none-any.whl → 0.2.2__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.2.dist-info}/METADATA +2 -2
- lola_mcp_server-0.2.2.dist-info/RECORD +6 -0
- public_mcp_server.py +14 -4
- lola_mcp_server-0.2.0.dist-info/RECORD +0 -6
- {lola_mcp_server-0.2.0.dist-info → lola_mcp_server-0.2.2.dist-info}/WHEEL +0 -0
- {lola_mcp_server-0.2.0.dist-info → lola_mcp_server-0.2.2.dist-info}/entry_points.txt +0 -0
- {lola_mcp_server-0.2.0.dist-info → lola_mcp_server-0.2.2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
public_mcp_server.py,sha256=rbgiVeBk0Yyzv7B0m6Su9ctKbfU56dxxPGcX8F1XtPI,2145
|
|
2
|
+
lola_mcp_server-0.2.2.dist-info/METADATA,sha256=gi7xBfF5Ok4xiMmKXn7sSrTCGgP1rrXtxo-kNQOa98k,135
|
|
3
|
+
lola_mcp_server-0.2.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
4
|
+
lola_mcp_server-0.2.2.dist-info/entry_points.txt,sha256=7ohrLpfi22BMGEDWSgn0tQLet94CcyP5AX1Tk5DbalI,59
|
|
5
|
+
lola_mcp_server-0.2.2.dist-info/top_level.txt,sha256=mEMxVolBhbIAki_wnZGkv3e8U-6xFTL2TvC-iP2_MxU,18
|
|
6
|
+
lola_mcp_server-0.2.2.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
|
|
|
@@ -44,28 +46,36 @@ async def register_tools():
|
|
|
44
46
|
|
|
45
47
|
async with httpx.AsyncClient() as client:
|
|
46
48
|
res = await client.get(f"{BASE_URL}/tools_lola", headers=headers())
|
|
49
|
+
res.raise_for_status()
|
|
47
50
|
tools = res.json()["tools"]
|
|
48
51
|
|
|
49
52
|
for tool in tools:
|
|
50
53
|
name = tool["name"]
|
|
51
54
|
|
|
55
|
+
# Only expose tools allowed by token
|
|
52
56
|
if name not in allowed:
|
|
53
57
|
continue
|
|
54
58
|
|
|
55
|
-
schema = tool["input_schema"]
|
|
56
59
|
desc = tool.get("description", "")
|
|
57
60
|
|
|
58
|
-
|
|
61
|
+
# FastMCP derives schema from function signature
|
|
62
|
+
async def dynamic_tool(arguments: dict, name=name):
|
|
59
63
|
async with httpx.AsyncClient() as client:
|
|
60
64
|
r = await client.post(
|
|
61
65
|
f"{BASE_URL}/call_lola",
|
|
62
|
-
json={"name": name, "arguments":
|
|
66
|
+
json={"name": name, "arguments": arguments},
|
|
63
67
|
headers=headers(),
|
|
64
68
|
)
|
|
69
|
+
r.raise_for_status()
|
|
65
70
|
return r.json()
|
|
66
71
|
|
|
67
|
-
mcp.tool(
|
|
72
|
+
mcp.tool(
|
|
73
|
+
name=name,
|
|
74
|
+
description=desc,
|
|
75
|
+
)(dynamic_tool)
|
|
76
|
+
|
|
68
77
|
|
|
78
|
+
# -------- Startup --------
|
|
69
79
|
|
|
70
80
|
async def startup():
|
|
71
81
|
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
|