diff --git a/pyproject.toml b/pyproject.toml index 409cd8c..34eb954 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-mcp" -version = "0.0.87" +version = "0.0.88" description = "UiPath MCP SDK" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.10" @@ -83,4 +83,4 @@ addopts = "-ra -q" name = "testpypi" url = "https://test.pypi.org/simple/" publish-url = "https://test.pypi.org/legacy/" -explicit = true \ No newline at end of file +explicit = true diff --git a/src/uipath_mcp/_cli/_runtime/_runtime.py b/src/uipath_mcp/_cli/_runtime/_runtime.py index 83d513c..58c146f 100644 --- a/src/uipath_mcp/_cli/_runtime/_runtime.py +++ b/src/uipath_mcp/_cli/_runtime/_runtime.py @@ -375,16 +375,25 @@ async def _register(self) -> None: logger.info(client_info) + folder_key = os.environ.get("UIPATH_FOLDER_KEY") + if not folder_key: + raise UiPathMcpRuntimeError( + "REGISTRATION_ERROR", + "No UIPATH_FOLDER_KEY environment variable set.", + UiPathErrorCategory.USER, + ) + # Register with UiPath MCP Server await self._uipath.api_client.request_async( "POST", f"mcp_/mcp/{self._server.name}/runtime/start?runtimeId={self._runtime_id}", json=client_info, + headers={"X-UIPATH-FolderKey": folder_key}, ) logger.info("Registered MCP Server type successfully") except Exception as e: logger.error(f"Error during registration: {e}") - if (e.status_code == 400): + if e.status_code == 400: logger.error(f"Error details: {e.response.text}") raise UiPathMcpRuntimeError(