UiPath AI Agent + Neo4j Integration
Overview
UiPath is a leading enterprise automation platform that combines Robotic Process Automation (RPA) with AI. UiPath’s Agentic Automation and Autopilot capabilities enable AI agents to execute complex business processes dynamically, orchestrating models to plan, execute, and adapt workflows.
These agents leverage powerful underlying LLMs (such as Anthropic Claude, seamlessly integrated natively via the UiPath Integration Service or AI experiences) to reason, synthesize answers, and orchestrate Model Context Protocol (MCP) tool calls natively within automations.
Key Features:
-
Enterprise-grade Robotic Process Automation (RPA)
-
Integration Service with hundreds of pre-built connectors
-
Native Agentic Automation capabilities (UiPath Autopilot) backed by powerful LLMs for planning and reasoning
-
Native Model Context Protocol (MCP) server support through UiPath Orchestrator
Official Resources:
-
Website: uipath.com
-
Documentation: UiPath Documentation
-
MCP/Integration docs: About MCP Servers in UiPath
MCP Integration Integration
The UiPath Platform offers full native MCP support natively through UiPath Orchestrator, enabling you to bring external tools directly into your automation workflows and expose them to your AI Agents.
UiPath supports several MCP Server connection types:
-
Remote: Connect to remote MCP Servers outside UiPath via secure tunneling. This is ideal for connecting to an externally hosted Neo4j MCP Server. This is the preferred approach for integration
-
Coded (Preview): Host a custom-coded MCP Server within UiPath’s package management. Given that UiPath’s platform is built on.NET, all activities take the form of a Nuget package (this is the
.nupkgfile that feeds in UiPath Studio’s package manager). -
Command (Preview): Bring an MCP Server from an external package feed (e.g., NPM or PyPI) and start it as an external process. You can use npx commands for Node.js projects or uvx for Python projects. Unfortunately, Neo4j MPC is build in golang
-
UiPath: Expose UiPath artifacts as tools via MCP - which is not relevant for the integration discussed here.
Connecting a Neo4j MCP Server (Remote Type)
The recommended approach to integrate Neo4j is by connecting a remote Neo4j MCP Server using the Remote connection type.
Setup Instructions:
-
Host the Neo4j MCP Server: Deploy the official Neo4j MCP server (
neo4j-mcp). Because UiPath connects over the network, you must run the server in HTTP mode instead of the default STDIO mode.
Example starting the server via Docker:
docker run -p 8080:8080 -e NEO4J_TRANSPORT_MODE=http neo4j/mcp
Or via binary:
neo4j-mcp --neo4j-transport-mode http --neo4j-http-port 8080
_Note: Ensure your server is accessible from UiPath Cloud (e.g., via a public IP, secure tunnel, or API Gateway)._
-
Navigate to Orchestrator: Go to your UiPath Automation Cloud and open the Orchestrator.
-
Add MCP Server: Navigate to the MCP Servers page and choose to add a new server.
-
Configure Remote Connection:
-
Type: Select
Remote. -
Name: e.g., "Neo4j MCP Server".
-
Endpoint: Provide the URL of your Neo4j MCP Server (e.g.,
https://your-domain.com/mcporhttps://your-domain.com/sse). -
Authentication: In HTTP mode,
neo4j-mcpaccepts credentials dynamically. Configure the HTTP headers to pass either Basic Auth or a Bearer Token corresponding to your Neo4j database credentials. In the remote MCP configuration additional auth headers can be provided:Authorization: Bearer <token>.
-
-
Assign to Agent: Once connected, the tools exposed by the Neo4j MCP server (e.g.,
read_cypher) will be available for UiPath AI Agents or Agentic processes to invoke directly within workflows.
Industry Research Agent Example
Scenario
A UiPath Agentic Process uses the connected Neo4j MCP Server to query a Company News Knowledge Graph.
-
The agent receives a request to research a specific company.
-
It automatically uses the
read_cyphertool (provided by the Neo4j MCP server). -
The agent passes parameters for the target company to retrieve its leadership and recent news.
-
The results are synthesized into a final report using UiPath’s generative capabilities.
Example Agent Configuration
You can find a complete, production-ready system prompt for the Industry Research Agent in the examples/system_prompt.md file. This prompt explicitly defines tool rules, the mandatory get_schema → read-cypher workflow, and robust fallbacks to UiPath’s Web Search tools.
The MCP server configuration, provided in the examples/configuration.json, is a snapshot of MCP tools configuration within UIPath.
Dataset Setup
Company News Knowledge Graph (Read-Only Access):
NEO4J_URI = "neo4j+s://demo.neo4jlabs.com:7687"
NEO4J_USERNAME = "companies"
NEO4J_PASSWORD = "companies"
NEO4J_DATABASE = "companies"
Data Model:
(:Organization)-[:HAS_CEO]->(:Person)
(:Organization)-[:HAS_COMPETITOR|HAS_SUPPLIER|HAS_SUBSIDIARY]->(:Person)
(:Article)-[:MENTIONS]->(:Organization)
Implementation
-
Deploy Neo4j MCP Server: Deploy the official Neo4j MCP server in HTTP mode.
neo4j-mcp --neo4j-transport-mode http \
--neo4j-http-port 8080
-
Connect via Orchestrator: In UiPath Orchestrator → MCP Servers → Add Server:
-
Name: Neo4j Research Tools
-
Type: Remote
-
Endpoint:
https://your-neo4j-mcp-server.com/mcporhttps://mcp.demo.neo4jlabs.com/mcpto use the demo environment -
Authentication: Add HTTP header
Authorization: Basic <base64(companies:companies)>or pass the Bearer token. image::examples/mcp_server_configuration.png[MCP Remote server configuration]
-
-
Agent Workflow: In UiPath Studio or Autopilot interface, create a new Agent. Add the newly created "Neo4j Research Tools" to the agent’s available tools. Prompt the Agent: "Research the leadership team and recent news for {CompanyName}." The agent will independently format the Cypher query, call the
read_cyphertool, and summarize the returned JSON.
Prompt Engineering & Tool Calling Best Practices
When configuring the UiPath Agent’s system prompt, you may encounter strict schema validation errors or hallucinated queries from the LLM. Based on testing with UiPath GenAI Activities, ensure your agent’s system prompt explicitly enforces the following patterns:
-
Explicit Schema Fetching (Avoid
Required properties ["properties"] are not presentError): The UiPath LLM might try to call the no-argumentget-schematool with an empty JSON object{}, which fails MCP schema validation.-
Prompt Fix: Add a strict rule: "Always invoke
get-schemawith exactly{ "properties": {} }. Never call it with{}or omit properties."
-
-
Correct Cypher Argument Name (Avoid
Query parameter is requiredError): The LLM frequently hallucinates the argument name forread-cypher, passing{ "statement": "MATCH…" }instead of the expectedqueryparameter.-
Prompt Fix: Add a strict rule: "When calling
read-cypher, always pass the query using thequeryattribute, e.g.,{ "query": "MATCH…" }."
-
-
Mandatory Query Workflow: To prevent invalid queries, explicitly enforce the order of operations in the prompt: To prevent invalid queries, explicitly enforce the order of operations in the prompt:
-
Step 1: Call
get-schemato understand node labels, properties, and relationships. -
Step 2: Formulate a read-only Cypher query based strictly on the retrieved schema.
-
Step 3: Call
read-cypherto execute the query.
-
-
Web Search Fallbacks: If the Graph Database yields no results, configure the agent to gracefully fall back to web search tools (like UiPath’s Web Search and Web Summary).
-
Prompt Fix: "If
read-cypherreturns empty results, immediately fall back to Web Search to source the data live. Label the output clearly so the user knows if the data came from the Neo4j Knowledge Graph or the web."
-