Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/uipath_mcp/_cli/_runtime/_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from pysignalr.client import CompletionMessage, SignalRClient
from uipath import UiPath
from uipath._cli._runtime._contracts import (
UiPathBaseRuntime,
UiPathErrorCategory,
Expand All @@ -26,6 +25,7 @@
from ._context import UiPathMcpRuntimeContext, UiPathServerType
from ._exception import UiPathMcpRuntimeError
from ._session import SessionServer
from uipath import UiPath

logger = logging.getLogger(__name__)
tracer = trace.get_tracer(__name__)
Expand Down Expand Up @@ -274,13 +274,18 @@ async def _register(self) -> None:
"""Register the MCP server with UiPath."""

folder_key = os.environ.get("UIPATH_FOLDER_KEY")
if not folder_key:
folder_path = os.environ.get("UIPATH_FOLDER_PATH")
if not folder_key and not folder_path:
raise UiPathMcpRuntimeError(
"REGISTRATION_ERROR",
"No UIPATH_FOLDER_KEY environment variable set.",
"Please set the UIPATH_FOLDER_KEY environment variable.",
"No UIPATH_FOLDER_PATH or UIPATH_FOLDER_KEY environment variable set.",
"Please set the UIPATH_FOLDER_PATH or UIPATH_FOLDER_KEY environment variable.",
UiPathErrorCategory.USER,
)
if not folder_key:
uipath = UiPath()
folder_key = uipath.folders.retrieve_key(folder_path=folder_path)

logger.info(f"Folder key: {folder_key}")

initialization_successful = False
Expand Down
9 changes: 9 additions & 0 deletions src/uipath_mcp/_cli/_templates/mcp.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"servers": {
"$server_name": {
"transport": "stdio",
"command": "python",
"args": ["server.py"]
}
}
}
9 changes: 9 additions & 0 deletions src/uipath_mcp/_cli/_templates/pyproject.toml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[project]
name = "$project_name"
version = "0.0.1"
description = "Description for '$project_name' project"
authors = [{ name = "John Doe", email = "[email protected]" }]
dependencies = [
"uipath-mcp>=0.0.96",
]
requires-python = ">=3.11"
Loading