How to Build & Deploy MCP Servers for UiPath: A Step-by-Step Developer Guide

Satish Prasad
12 Min Read

The Model Context Protocol (MCP) represents a groundbreaking standard that enables seamless communication between AI systems and external applications, data sources, and tools. Within the UiPath ecosystem, MCP Servers function as bridging components that allow intelligent agents, including large language models (LLMs), to interact with UiPath automation capabilities through a standardized protocol . This integration transforms how automation is orchestrated by connecting native platform assets, custom logic, and third-party integrations into a coherent, context-aware ecosystem for AI Agents and LLMs .

UiPath supports four distinct types of MCP Servers, each designed for specific integration scenarios and use cases. Understanding these types is crucial for selecting the right approach for your automation needs :

  • UiPath Type: Exposes UiPath artifacts as tools via MCP, including RPA workflows, agents, API workflows, and agentic processes
  • Coded Type: Hosts custom-coded MCP Servers developed using languages like Python
  • Command Type: Integrates external MCP Servers from package feeds via command-line interfaces
  • Remote Type: Connects to remotely deployed MCP Servers through secure tunneling

This comprehensive guide will walk you through the entire process of building, deploying, and managing MCP Servers within the UiPath platform, leveraging official documentation and resources to ensure best practices and optimal implementation.

Prerequisites and Environment Setup

System Requirements and Software Installation

Before developing MCP Servers, ensure your environment meets these prerequisites:

  • Python 3.11 or higher: Required for coded MCP Server development 
  • Package manager: pip or uv for dependency management 
  • UiPath Automation Cloud account: With appropriate permissions for MCP Server management 
  • UiPath Personal Access Token (PAT): With Orchestrator API Access scopes 
  • UiPath Python SDK: Install using pip install uipath-mcp or uv add uipath-mcp

Authentication Configuration

Proper authentication is essential for MCP Server operations. Configure your Personal Access Token with the necessary scopes:

  1. Navigate to UiPath Orchestrator → User → Preferences → Personal Access Token 
  2. Generate a new token with Orchestrator API Access (All) scopes 
  3. Store the token securely as it will be required for both development and client connections

Project Initialization

Set up your development environment using the following commands:

# Create project directory
mkdir example-mcp-server
cd example-mcp-server

# Initialize UV project (alternative to pip)
uv init . --python 3.11

# Create and activate virtual environment
uv venv
source .venv/bin/activate  # Linux/Mac
# or .venv\Scripts\activate  # Windows

# Install UiPath MCP package
uv add uipath-mcp
# or using pip
pip install uipath-mcp

Or Alternatively you can use the pip based on your preference !

How to Build & Deploy MCP Servers for UiPath: A Step-by-Step Developer Guide 3

Initialize your UiPath project with the necessary configuration files:

# Initialize UiPath project
uipath init

This command creates essential configuration files including:

  • .env: Environment variables and secrets (excluded from publishing)
  • uipath.json: Input/output JSON schemas and bindings

All Set !

How to Build & Deploy MCP Servers for UiPath: A Step-by-Step Developer Guide 4

Building MCP Servers: Development Process

Creating Your First MCP Server

UiPath provides a streamlined process for generating MCP Server templates. Create a new server using the following command:

# Create new MCP server
uipath new math-server

This command generates the necessary files for your MCP Server:

  • server.py: Sample MCP server implementation using FastMCP
  • mcp.json: Configuration file for coded UiPath MCP Servers
  • pyproject.toml: Project metadata and dependencies following PEP 518 

Important Note: The uipath new command removes all existing .py files in the current directory, so ensure you work in a dedicated project folder 

How to Build & Deploy MCP Servers for UiPath: A Step-by-Step Developer Guide 5

All good here – You should be able to see generated server.py file contains a template for your MCP Server implementation. Below is an example of a math server with basic arithmetic operations:

How to Build & Deploy MCP Servers for UiPath: A Step-by-Step Developer Guide 6

Alright – All required files and setup is done- next lets build our own custom code for our Logic.

Implementing Server Logic

# Banking Tools MCP Server

A Model Context Protocol (MCP) server implementation that provides banking-related tools and utilities for UiPath automation workflows. This server offers tools for customer data retrieval, fund holdings analysis, credit worthiness assessment, and comprehensive customer risk evaluation.

## Features

- 🏦 **Customer Information Retrieval**
  - Async PostgreSQL database integration
  - Efficient connection pooling
  - Comprehensive error handling

- 📊 **Fund Holdings Analysis**
  - Excel file processing with pandas
  - Asset allocation calculations
  - Historical holdings tracking

- 🔍 **Credit Assessment**
  - Sanctions list checking
  - News sentiment analysis
  - Risk score calculation

- 🏥 **Health Monitoring**
  - Database connectivity checks
  - Service status monitoring
  - Dependency health tracking
@mcp.tool()
async def get_fund_holdings(customer_id: str, month: str) -> Dict[str, Any]:
    """Read customer's fund holdings from Excel file for a specific month.

    Args:
        customer_id: Unique identifier for the customer
        month: Month for which to retrieve holdings (format: YYYY-MM)

    Returns:
        Dictionary containing:
        - Total holdings value
        - List of fund positions
        - Performance metrics

    Raises:
        HTTPException: If file not found or invalid data
    """
    try:
        # Use configured data directory
        file_path = os.path.join(DATA_DIR, month, f"customer_{customer_id}.xlsx")
        
        # Read Excel file using pandas
        df = pd.read_excel(file_path)
        
        # Calculate holdings summary
        holdings_summary = {
            "total_value": float(df["value"].sum()),
            "positions": df.to_dict(orient="records"),
            "asset_allocation": df.groupby("asset_class")["value"].sum().to_dict()
        }
        
        return holdings_summary
    except FileNotFoundError:
        raise HTTPException(status_code=404, detail="Holdings data not found")
    except Exception as e:
        raise HTTPException(status_code=500, detail=f"Error processing holdings: {str(e)}")

Configuration Files

Proper configuration is essential for MCP Server functionality. The mcp.json file defines server properties:

{
    "name": "math-server",
    "version": "0.1.0",
    "description": "A sample MCP server for mathematical operations",
    "keywords": ["math", "arithmetic", "calculations"],
    "contacts": [
        {
            "name": "Your Name",
            "email": "your.email@example.com"
        }
    ],
    "capabilities": {
        "resources": true,
        "tools": true
    }
}

The pyproject.toml file contains project metadata and dependencies:

[project]
name = "banking-tools-mcp"
version = "1.0.0"
description = "Basic Banking Tools MCP Server"
requires-python = ">=3.8"
dependencies = [
    "uipath-mcp>=0.0.101",
    "fastapi",
    "sqlalchemy[asyncpg]",
    "pandas",
    "python-dotenv",
    "aiohttp",
    "uvicorn"
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build]
include = [
    "*.py",
    "*.json",
    "*.md",
    "requirements.txt"
]

[tool.hatch.metadata]
allow-direct-references = true

[tool.ruff]
line-length = 100
target-version = "py38"
select = ["E", "F", "I"]
ignore = ["E501"]

[tool.ruff.isort]
known-first-party = ["banking_tools"]
known-third-party = ["fastapi", "sqlalchemy", "pandas", "aiohttp"]

Testing and Deployment

Test your MCP Server locally before deployment:

  • Set folder path environment variable:
How to Build & Deploy MCP Servers for UiPath: A Step-by-Step Developer Guide 7

The common issue you might face here is your environment variable is not set.

uipath run banking-server
How to Build & Deploy MCP Servers for UiPath: A Step-by-Step Developer Guide 8

Once started successfully, your MCP server will appear in Orchestrator’s MCP Servers tab

Test with MCP clients: Use tools like Claude Desktop or MCP Inspector to validate functionality

How to Build & Deploy MCP Servers for UiPath: A Step-by-Step Developer Guide 9

Packaging and Publication

Prepare your MCP Server for deployment to UiPath Automation Cloud:

Update package metadata in pyproject.toml:

authors = [{ name = "Your Name", email = "your.name@example.com" }]

Package your project:

uipath pack

Publish to Automation Cloud:

The --my-workspace flag simplifies deployment by automatically handling serverless machine allocation and permissions .

uipath publish --my-workspace

 

How to Build & Deploy MCP Servers for UiPath: A Step-by-Step Developer Guide 10

Orchestrator Configuration

After publishing, configure your MCP Server in UiPath Orchestrator:

  1. Navigate to the MCP Servers tab in your target folder
  2. Select Add MCP Server
  3. Choose the appropriate server type (Coded for custom servers)
  4. Select your published process (e.g., banking-server)
  5. Click Add to deploy the server 

Once deployed, the server automatically starts and registers its available tools. You can monitor the job status in the MCP Server side panel 

How to Build & Deploy MCP Servers for UiPath: A Step-by-Step Developer Guide 11

MCP Server Management and Best Practices

Orchestrator Management

UiPath Orchestrator provides comprehensive management capabilities for MCP Servers:

  • Server Creation: Add new MCP Servers through the Orchestrator interface, selecting from four types (UiPath, Coded, Command, or Remote) 
  • Tool Management: For UiPath-type servers, add tools that include UiPath artifacts such as RPA workflows, agents, API workflows, and agentic processes 
  • Editing and Updates: Modify server configurations through the Edit option (note: server type cannot be changed after creation) 
  • Deletion: Remove unnecessary servers through the Remove option 

Security Best Practices

Implement robust security measures for your MCP Servers:

  • Use trusted providers for external, coded, or remote servers 
  • Implement OAuth 2.1 compliance for HTTP-based transports 
  • Apply principle of least privilege for token scopes (Executions scope for listing tools, Jobs scope for starting jobs) 
  • Never use session IDs for authentication; generate non-predictable session identifiers 
  • Minimize data exposure in responses and implement proper error handling

Troubleshooting and Common Issues

Even with proper implementation, you may encounter challenges when working with MCP Servers. Here are common issues and their solutions:

How to Build & Deploy MCP Servers for UiPath: A Step-by-Step Developer Guide 12

Authentication Problems

Issue: “401 Unauthorized” or “403 Forbidden” errors when connecting to MCP Servers 
Solution:

  • Verify your PAT has the correct scopes (Orchestrator API Access)
  • Ensure the token is properly formatted in authorization headers: Authorization: Bearer <your_token>
  • Check token expiration and generate a new one if needed

Connection Issues

Issue: MCP Server not appearing in Orchestrator after deployment 
Solution:

  • Verify the UIPATH_FOLDER_PATH environment variable is correctly set
  • Check that the server is properly registered with UiPath during startup
  • Validate network connectivity and firewall settings

Tool Visibility Problems

Issue: Tools not visible or accessible in MCP clients 
Solution:

  • Ensure tools are properly decorated with @mcp.tool() decorator
  • Verify the MCP Server has the necessary capabilities declared in mcp.json
  • Check that the server is running and accessible

Documentation Gaps

Issue: Limited documentation for specific scenarios 
Solution:

  • Refer to the UiPath Community Forum for shared experiences
  • Check GitHub repositories for examples and sample implementations
  • Utilize the official UiPath documentation as the primary source 

Conclusion and Next Steps

Building MCP Servers in UiPath represents a powerful approach to integrating AI capabilities with robotic process automation. By following this step-by-step guide, you can create, deploy, and manage MCP Servers that enhance your automation workflows with intelligent context awareness and decision-making capabilities.

Continued Learning

To further develop your MCP Server expertise:

  • Explore the UiPath Python SDK documentation for advanced features and capabilities
  • Experiment with different MCP Server types to understand their respective strengths
  • Join the UiPath Community Forum to learn from others’ experiences and share your insights 
  • Review additional sample implementations on GitHub for practical inspiration

Strategic Implementation

As you advance in your MCP Server development:

  • Start with contained use cases before expanding to mission-critical processes
  • Prioritize security and governance from the beginning of your implementation
  • Design for scalability considering future growth and additional integrations
  • Establish monitoring practices to ensure reliability and performance

MCP Servers continue to evolve within the UiPath platform, offering increasingly sophisticated capabilities for intelligent automation. By mastering MCP Server development now, you position yourself and your organization to leverage the full potential of AI-enhanced automation as the technology continues to advance.

Share This Article
Follow:
Hey there, I'm Satish Prasad, and I've got a Master's Degree (MCA) from NIT Kurukshetra. With over 12 years in the game, I've been diving deep into Data Analytics, Delaware House, ETL, Production Support, Robotic Process Automation (RPA), and Intelligent Automation. I've hopped around various IT firms, hustling in functions like Investment Banking, Mutual Funds, Logistics, Travel, and Tourism. My jam? Building over 100 Production Bots to amp up efficiency. Let's connect! Join me in exploring the exciting realms of Data Analytics, RPA, and Intelligent Automation. It's been a wild ride, and I'm here to share insights, stories, and tech vibes that'll keep you in the loop. Catch you on the flip side
Leave a Comment