UiPath MCP SDK

0.2.2 · active · verified Thu Apr 16

The UiPath MCP (Managed Cloud Platform) SDK for Python enables developers to build custom activities that integrate with the UiPath ecosystem. It provides the necessary interfaces and tools for creating and exposing automations as discoverable services within UiPath Orchestrator. The current version is 0.2.2, with releases typically aligned with the core `uipath` Python SDK.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart defines a simple UiPath MCP service by inheriting from `UiPathMCP` and implementing the `GetHealth` and `Process` methods. The `Process` method is where your custom automation logic resides. To run this, you need to set specific environment variables for authentication with UiPath Orchestrator.

import os
from uipath_mcp.mcp import UiPathMCP
from uipath_mcp.models import GetHealthResponse, ProcessRequest

class MyMCP(UiPathMCP):
    async def GetHealth(self) -> GetHealthResponse:
        print("Health check requested.")
        return GetHealthResponse(status="HEALTHY")

    async def Process(self, request: ProcessRequest) -> None:
        print(f"Received process request: {request.input}")
        # Implement your automation logic here based on request.input
        # For example, calling another UiPath process or external API

# Ensure these environment variables are set for authentication and server URL
# UIPATH_MCP_CLIENT_ID, UIPATH_MCP_CLIENT_SECRET, UIPATH_MCP_SERVER_URL
if __name__ == "__main__":
    # Basic check for required env vars for quickstart to avoid immediate failure
    if not all(os.environ.get(var) for var in ['UIPATH_MCP_CLIENT_ID', 'UIPATH_MCP_CLIENT_SECRET', 'UIPATH_MCP_SERVER_URL']):
        print("Warning: Please set UIPATH_MCP_CLIENT_ID, UIPATH_MCP_CLIENT_SECRET, UIPATH_MCP_SERVER_URL environment variables to run this example.")
        print("Example: export UIPATH_MCP_CLIENT_ID='your_client_id'")
    try:
        mcp = MyMCP()
        mcp.run() # This will start the server and listen for requests
    except Exception as e:
        print(f"An error occurred: {e}")
        print("Ensure all required environment variables are set and dependencies are correct.")

view raw JSON →