Fix PyPI regex and switch Bicep modules to /api/bicep-modules endpoint
catalog.py: Fix HTML parsing regex — pypi-server.i80.dk uses relative hrefs like href="pkg-name/" not /simple/pkg-name/. Use simpler <a> text extractor. modules.py: Replace /call-tool POST (wrong) with GET /api/bicep-modules (new REST endpoint added to DevOpsMCP). Simpler, no MCP protocol overhead.
This commit is contained in:
@@ -55,12 +55,11 @@ class BicepModuleCatalog:
|
||||
|
||||
@classmethod
|
||||
async def _fetch_from_devops_mcp(cls) -> list[dict[str, Any]]:
|
||||
"""Call DevOpsMCP list_bicep_modules tool via HTTP."""
|
||||
url = f"{DEVOPS_MCP_URL}/call-tool"
|
||||
payload = {"tool": "list_bicep_modules", "arguments": {}}
|
||||
"""Call DevOpsMCP /api/bicep-modules REST endpoint."""
|
||||
url = f"{DEVOPS_MCP_URL}/api/bicep-modules"
|
||||
|
||||
async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=20)) as session:
|
||||
async with session.post(url, json=payload) as resp:
|
||||
async with session.get(url) as resp:
|
||||
if resp.status != 200:
|
||||
raise RuntimeError(f"DevOpsMCP returned {resp.status}")
|
||||
data = await resp.json()
|
||||
|
||||
Reference in New Issue
Block a user