Skip to content

Commit 31df562

Browse files
authored
Merge pull request #104 from UiPath/fix/register_folder_scoped
fix: register folder scoped
2 parents 3b90e84 + d35f904 commit 31df562

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-mcp"
3-
version = "0.0.87"
3+
version = "0.0.88"
44
description = "UiPath MCP SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"
@@ -83,4 +83,4 @@ addopts = "-ra -q"
8383
name = "testpypi"
8484
url = "https://test.pypi.org/simple/"
8585
publish-url = "https://test.pypi.org/legacy/"
86-
explicit = true
86+
explicit = true

src/uipath_mcp/_cli/_runtime/_runtime.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,16 +375,25 @@ async def _register(self) -> None:
375375

376376
logger.info(client_info)
377377

378+
folder_key = os.environ.get("UIPATH_FOLDER_KEY")
379+
if not folder_key:
380+
raise UiPathMcpRuntimeError(
381+
"REGISTRATION_ERROR",
382+
"No UIPATH_FOLDER_KEY environment variable set.",
383+
UiPathErrorCategory.USER,
384+
)
385+
378386
# Register with UiPath MCP Server
379387
await self._uipath.api_client.request_async(
380388
"POST",
381389
f"mcp_/mcp/{self._server.name}/runtime/start?runtimeId={self._runtime_id}",
382390
json=client_info,
391+
headers={"X-UIPATH-FolderKey": folder_key},
383392
)
384393
logger.info("Registered MCP Server type successfully")
385394
except Exception as e:
386395
logger.error(f"Error during registration: {e}")
387-
if (e.status_code == 400):
396+
if e.status_code == 400:
388397
logger.error(f"Error details: {e.response.text}")
389398

390399
raise UiPathMcpRuntimeError(

0 commit comments

Comments
 (0)