- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
06-27-2025 12:33 AM - edited 06-27-2025 12:56 AM
Using Neo4j with Claude Desktop and chat with ServiceNow scoped application
Understanding ServiceNow scoped applications can get complex and time taking, we can leverage the power of GEN AI and Agentic AI (MCP server and MCP clients) to efficiently interact with a ServiceNow scoped application. This work product / blog provides steps on how it can be achieved.
Pre-requisites
Local desktop setup
Install Neoj4 desktop client
Create a new local instance
Working Claude desktop setup
ServiceNow export
Export sys_metadata from sys_metadata table from ServiceNow for a given scoped application, sample url is provided below
Application Files | ServiceNow
Personalize columns to have following 4 columns
- Display name
- Update name
- Class
- Application
Export data as csv name the file as sys_metadata.csv
Save the file to Neo4j import folder sample path : C:\Users\XXXXXXXXXXXX\.Neo4jDesktop2\Data\dbmss\dbms-0c4f3390-53eb-4ae4-a3d2-8801f701bbfe\import
Load file to neo4j
Open neo4j desktop client and load the file
Cypher to load the file
:param {
// Define the file path root and the individual file names required for loading.
// https://neo4j.com/docs/operations-manual/current/configuration/file-locations/
file_path_root: 'file:///', // Change this to the folder your script can access the files at.
file_0: 'sys_metadata2.csv'
};
// CONSTRAINT creation
// -------------------
//
// Create node uniqueness constraints, ensuring no duplicates for the given node label and ID property exist in the database. This also ensures no duplicates are introduced in future.
//
// NOTE: The following constraint creation syntax is generated based on the current connected database version 2025.5.0.
CREATE CONSTRAINT `sys_update_name_Metadata_uniq` IF NOT EXISTS
FOR (n: `Metadata`)
REQUIRE (n.`sys_update_name`) IS UNIQUE;
:param {
idsToSkip: []
};
// NODE load
// ---------
//
// Load nodes in batches, one node label at a time. Nodes will be created using a MERGE statement to ensure a node with the same label and ID property remains unique. Pre-existing nodes found by a MERGE statement will have their other properties set to the latest values encountered in a load file.
//
// NOTE: Any nodes with IDs in the 'idsToSkip' list parameter will not be loaded.
LOAD CSV WITH HEADERS FROM ($file_path_root + $file_0) AS row
WITH row
WHERE NOT row.`sys_update_name` IN $idsToSkip AND NOT row.`sys_update_name` IS NULL
CALL {
WITH row
MERGE (n: `Metadata` { `sys_update_name`: row.`sys_update_name` })
SET n.`sys_update_name` = row.`sys_update_name`
SET n.`sys_name` = row.`sys_name`
SET n.`sys_class_name` = row.`sys_class_name`
SET n.`sys_scope` = row.`sys_scope`
MERGE (m: `ScopedApp` { `name`: row.`sys_scope` })
MERGE (m)-[r:Object {sys_class_name: row.sys_class_name}]->(n)
} IN TRANSACTIONS OF 10000 ROWS;
// RELATIONSHIP load
// -----------------
//
// Load relationships in batches, one relationship type at a time. Relationships are created using a MERGE statement, meaning only one relationship of a given type will ever be created between a pair of nodes.
Output
Configure claude desktop to access neo4j mcp server
Open claude_desktop_config.json file and add below mcp-server
"local-neo4j": {
"command": "uvx",
"args": [ "mcp-neo4j-cypher@0.2.3" ],
"env": {
"NEO4J_URI": "neo4j://127.0.0.1:7687",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "xxxxxxxx",
"NEO4J_DATABASE": "neo4j"
}
},
Review local instances to get above details
Testing
Test: Verify dataload
Open database and select relationship as Object
Graph appears as below showing all objects of the scoped application
Test: Connectivity to neo4j database from claude desktop
Prompt: connect with local neo4j database
I'll help you connect to your local Neo4j database. Let me start by checking the database schema to see what's available.
L
get_neo4j_schema
Request
{}
Response
Error: {code: Neo.ClientError.Procedure.ProcedureNotFound} {message: There is no procedure with the name `apoc.meta.data` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.}
The connection attempt shows that while we can reach the Neo4j database, the APOC (Awesome Procedures on Cypher) plugin is not installed or enabled. The APOC plugin provides useful procedures for database introspection and operations.
Let me try a basic connection test with a simple Cypher query instead:
L
read_neo4j_cypher
Request
{
`query`: `MATCH (n) RETURN count(n) as total_nodes LIMIT 1`
}
Response
[{"total_nodes": 16}]
Great! The connection to your local Neo4j database is working. I can see there are 16 nodes in your database.
Let me get some basic information about what's in your database:
L
read_neo4j_cypher
Request
{
`query`: `MATCH (n) RETURN DISTINCT labels(n) as node_labels, count(n) as count ORDER BY count DESC`
}
Response
[{"node_labels": ["Metadata"], "count": 15}, {"node_labels": ["ScopedApp"], "count": 1}]
L
read_neo4j_cypher
Request
{
`query`: `MATCH ()-[r]->() RETURN DISTINCT type(r) as relationship_types, count(r) as count ORDER BY count DESC`
}
Response
[{"relationship_types": "Object", "count": 15}, {"relationship_types": "ObjectOf", "count": 1}]
Perfect! Your local Neo4j database connection is established and working. Here's what I found:
Database Summary:
- Total Nodes: 16
- Node Types:
- 15 nodes with label "Metadata"
- 1 node with label "ScopedApp"
- Relationships:
- 15 "Object" relationships
- 1 "ObjectOf" relationship
The database appears to contain metadata-related information with a scoped application structure.
Test: Chat with scoped application find count of objects by their type
Please show various objects of MCP Client node from my local neo4j database group them by their sys_class_name
I'll query your Neo4j database to find objects related to MCP Client nodes and group them by their sys_class_name.
L
read_neo4j_cypher
Found an MCP Client node! Let me now find objects related to this MCP Client and group them by sys_class_name:
L
read_neo4j_cypher
Now let me group these objects by their sys_class_name for a cleaner view:
L
read_neo4j_cypher
Perfect! Here's a summary of the various objects associated with the MCP Client node in your Neo4j database, grouped by their sys_class_name:
MCP Client Objects by Class Name
Topic (5 objects)
- "Agentic AI" (appears twice)
- "_PRVW__987fd1c8cf424fc7892fc2993e1cea1c" (preview object)
- "_PRVW__04f7ec7e0fac48ffb4d4d6dbe09a4d46" (preview object)
- "_PRVW__7cb0c2b2e1fb4060a57cb431fb7aeb7e" (preview object)
Published Topic (4 objects)
- "FlowTopic" (4 instances with different sys_update_names)
Message (3 objects)
- "agentic ai"
- "hi welcome to mcp client"
- "ask your mcp client"
CB Topic Language (1 object)
- (unnamed object)
CS Topic Language (1 object)
- (unnamed object)
Action Type (1 object)
- "Invoke Powershell Script"
The MCP Client appears to be a ServiceNow scoped application focused on AI and automation, containing various topics related to "Agentic AI", flow topics for integration, user interface messages, and PowerShell script execution capabilities. The preview objects (starting with "PRVW_") suggest this application is still in development or testing phase.
Would you like me to explore any specific class of objects in more detail?
Test: Get List of topics
what are different Topics that are part of my MCP client application in my local neo4j database
Edit
I'll query your Neo4j database to get detailed information about all the Topics that are part of your MCP Client application.
L
read_neo4j_cypher
Let me also check if there are any additional properties or details we can get about these topics:
L
read_neo4j_cypher
Here are the different Topics that are part of your MCP Client application in your local Neo4j database:
Topics in MCP Client Application
- Agentic AI (2 instances)
- CB Topic: sys_cb_topic_8b8435f2839e6a14fbe1c2dfeeaad36f
- CS Topic: sys_cs_topic_8bbe7d7a8312aa14fbe1c2dfeeaad387
This appears to be the main topic focusing on Agentic AI functionality, with both CB (Conversation Builder) and CS (Customer Service) implementations.
- Preview Topics (3 instances)
These appear to be development/preview topics with generated GUIDs:
- _PRVW__04f7ec7e0fac48ffb4d4d6dbe09a4d46
- Update Name: sys_cs_topic_4ccebd7a8312aa14fbe1c2dfeeaad349
- _PRVW__7cb0c2b2e1fb4060a57cb431fb7aeb7e
- Update Name: sys_cs_topic_8a6e317a8312aa14fbe1c2dfeeaad374
- _PRVW__987fd1c8cf424fc7892fc2993e1cea1c
- Update Name: sys_cs_topic_08bef97a8312aa14fbe1c2dfeeaad375
Summary
Your MCP Client application contains 5 total topics:
- One main functional topic: "Agentic AI" (with 2 implementations - CB and CS)
- Three preview/development topics: With GUID-based names indicating they're likely in development or testing phase
The naming pattern suggests this is a ServiceNow application focused on AI agent functionality, with both Conversation Builder (CB) and Customer Service (CS) topic implementations. The preview topics are likely prototypes or test versions being developed.
Would you like me to explore any specific topic in more detail or look at other aspects of your MCP Client application?
Test: Get list of flow actions
I'll query your Neo4j database to find all the actions that are part of your MCP Client application.
L
read_neo4j_cypher
Request
{
`query`: `MATCH (mcp) WHERE mcp.name = 'MCP Client'
MATCH (mcp)-[:Object]-(action)
WHERE action.sys_class_name CONTAINS 'Action'
RETURN action.sys_class_name as class_name,
action.sys_name as action_name,
action.sys_update_name as update_name,
action.sys_scope as scope,
action
ORDER BY action.sys_class_name, action.sys_name`
}
Response
[{"class_name": "Action Type", "action_name": "Invoke Powershell Script", "update_name": "sys_hub_action_type_definition_3d4fcc7283126a14fbe1c2dfeeaad3ec", "scope": "MCP Client", "action": {"sys_update_name": "sys_hub_action_type_definition_3d4fcc7283126a14fbe1c2dfeeaad3ec", "sys_name": "Invoke Powershell Script", "sys_scope": "MCP Client", "sys_class_name": "Action Type"}}]
Let me also check if there are any other action-related objects or flow actions that might be part of the MCP Client:
L
read_neo4j_cypher
Request
{
`query`: `MATCH (mcp) WHERE mcp.name = 'MCP Client'
MATCH (mcp)-[:Object]-(obj)
WHERE obj.sys_class_name CONTAINS 'Action' OR
obj.sys_class_name CONTAINS 'Flow' OR
obj.sys_class_name CONTAINS 'Script' OR
obj.sys_name CONTAINS 'action' OR
obj.sys_name CONTAINS 'script'
RETURN obj.sys_class_name as class_name,
obj.sys_name as object_name,
obj.sys_update_name as update_name,
keys(obj) as available_properties,
obj
ORDER BY obj.sys_class_name`
}
Response
[{"class_name": "Action Type", "object_name": "Invoke Powershell Script", "update_name": "sys_hub_action_type_definition_3d4fcc7283126a14fbe1c2dfeeaad3ec", "available_properties": ["sys_update_name", "sys_name", "sys_class_name", "sys_scope"], "obj": {"sys_update_name": "sys_hub_action_type_definition_3d4fcc7283126a14fbe1c2dfeeaad3ec", "sys_name": "Invoke Powershell Script", "sys_scope": "MCP Client", "sys_class_name": "Action Type"}}]
Let me also check if there might be any flow-related actions or other executable components:
L
read_neo4j_cypher
Request
{
`query`: `MATCH (mcp) WHERE mcp.name = 'MCP Client'
MATCH (mcp)-[:Object]-(obj)
WHERE toLower(obj.sys_class_name) CONTAINS 'flow' OR
toLower(obj.sys_class_name) CONTAINS 'step' OR
toLower(obj.sys_class_name) CONTAINS 'hub' OR
toLower(obj.sys_update_name) CONTAINS 'action' OR
toLower(obj.sys_update_name) CONTAINS 'flow'
RETURN DISTINCT obj.sys_class_name as class_name,
obj.sys_name as object_name,
obj.sys_update_name as update_name,
obj
ORDER BY obj.sys_class_name`
}
Response
[{"class_name": "Action Type", "object_name": "Invoke Powershell Script", "update_name": "sys_hub_action_type_definition_3d4fcc7283126a14fbe1c2dfeeaad3ec", "obj": {"sys_update_name": "sys_hub_action_type_definition_3d4fcc7283126a14fbe1c2dfeeaad3ec", "sys_name": "Invoke Powershell Script", "sys_scope": "MCP Client", "sys_class_name": "Action Type"}}]
Here are the Actions that are part of your MCP Client application in your local Neo4j database:
Actions in MCP Client Application
Action Type (1 action)
- Invoke Powershell Script
- Class: Action Type
- Update Name: sys_hub_action_type_definition_3d4fcc7283126a14fbe1c2dfeeaad3ec
- Scope: MCP Client
- Type: Hub Action Type Definition
Test: A larger scoped application with more than 500 sys_metadata records
Export data from Servicenow and import data to Neo4j
Cyper to load data from sys_metdata.csv file
:param {
// Define the file path root and the individual file names required for loading.
// https://neo4j.com/docs/operations-manual/current/configuration/file-locations/
file_path_root: 'file:///', // Change this to the folder your script can access the files at.
file_0: 'sys_metadata.csv'
};
// CONSTRAINT creation
// -------------------
//
// Create node uniqueness constraints, ensuring no duplicates for the given node label and ID property exist in the database. This also ensures no duplicates are introduced in future.
//
// NOTE: The following constraint creation syntax is generated based on the current connected database version 2025.5.0.
CREATE CONSTRAINT `sys_update_name_Metadata_uniq` IF NOT EXISTS
FOR (n: `Metadata`)
REQUIRE (n.`sys_update_name`) IS UNIQUE;
:param {
idsToSkip: []
};
// NODE load
// ---------
//
// Load nodes in batches, one node label at a time. Nodes will be created using a MERGE statement to ensure a node with the same label and ID property remains unique. Pre-existing nodes found by a MERGE statement will have their other properties set to the latest values encountered in a load file.
//
// NOTE: Any nodes with IDs in the 'idsToSkip' list parameter will not be loaded.
LOAD CSV WITH HEADERS FROM ($file_path_root + $file_0) AS row
WITH row
WHERE NOT row.`sys_update_name` IN $idsToSkip AND NOT row.`sys_update_name` IS NULL
CALL {
WITH row
MERGE (n: `Metadata` { `sys_update_name`: row.`sys_update_name` })
SET n.`sys_update_name` = row.`sys_update_name`
SET n.`sys_name` = row.`sys_name`
SET n.`sys_class_name` = row.`sys_class_name`
SET n.`sys_scope` = row.`sys_scope`
MERGE (m: `ScopedApp` { `name`: row.`sys_scope` })
MERGE (m)-[r:Object {sys_class_name: row.sys_class_name}]->(n)
} IN TRANSACTIONS OF 10000 ROWS;
// RELATIONSHIP load
// -----------------
//
// Load relationships in batches, one relationship type at a time. Relationships are created using a MERGE statement, meaning only one relationship of a given type will ever be created between a pair of nodes.
Ensure that only relevant classes are in scope of the export
Once export is complete below would be the graph
Prompt: What are various business rules that are part of AwesomeNowCreativeWorks in my local neo4j
Find out business rules that are part of scoped application (ex: AwesomeNowCreativeWorks)
Test: Build simple design document
Build a simple design document based on objects that are part of AwesomeNowCreativeWorks in my local neo4j include only tables, business rules, UI actions for now
AwesomeNow CreativeWorks - Design Document
Application Overview
Application Name: AwesomeNow CreativeWorks
Scope: AwesomeNowCreativeWorks
Purpose: A ServiceNow application for managing creative works, digital assets, and graph-based relationship visualization.
Table Definitions
Core Data Tables
- file (x_146833_creativ_0_file)
- Purpose: Central table for managing file objects and digital assets
- Key Features: Supports file state management and type classification
- Relationships: Connected to graph and graphics tables
- graph (x_146833_creativ_0_graph)
- Purpose: Stores graph definitions and configurations for visualization
- Key Features: Manages graph structures and their associated data
- Relationships: Parent table for nodes, edges, and graphics
- node (x_146833_creativ_0_node)
- Purpose: Represents individual nodes within graph structures
- Key Features: Stores node properties and relationships
- Relationships: Child of graph table, connected to edges
- edge (x_146833_creativ_0_edge)
- Purpose: Defines connections and relationships between nodes
- Key Features: Manages directional relationships in graphs
- Relationships: Connects nodes within graphs
- graphics (x_146833_creativ_0_graphics)
- Purpose: Stores graphical representations and visual elements
- Key Features: Manages visual assets for graph rendering
- Relationships: Associated with nodes and graphs
Lookup and Reference Tables
- LabelGraphics (x_146833_creativ_0_labelgraphics)
- Purpose: Manages label graphics for visual elements
- Key Features: Provides graphical label definitions
- Record Types: Configurable record type classifications
- Label Graphics Lookup (x_146833_creativ_0_label_graphics_lookup)
- Purpose: Lookup table for label graphics relationships
- Key Features: Maps labels to their graphical representations
- Record Types: Supports multiple record type configurations
- Creativ 0 Hex Color Codes (x_146833_creativ_0_hex_color_codes)
- Purpose: Centralized color palette management
- Key Features: Stores hex color codes for consistent theming
- Usage: Referenced throughout the application for color consistency
- Creativ 0 Allowed Classes (x_146833_creativ_0_allowed_classes)
- Purpose: Defines which ServiceNow classes can be used within the application
- Key Features: Access control and class validation
- Usage: Referenced for security and data integrity
Data Loading and Integration Tables
- File Application (x_146833_creativ_0_file_application)
- Purpose: Links files to specific applications
- Key Features: Manages file-application relationships
- Usage: Supports multi-application file management
- Creativ 0 Appl File (x_146833_creativ_0_creativ_0_appl_file)
- Purpose: Application-specific file management
- Key Features: Enhanced file categorization and management
- Usage: Extends basic file functionality
- Creativ 0 Scopedapp Loader (x_146833_creativ_0_creativ_0_scopedapp_loader)
- Purpose: Manages scoped application loading processes
- Key Features: Handles application metadata and loading sequences
- Usage: Data import and application management
- Creativ 0 Graphic Lookup Loader (x_146833_creativ_0_creativ_0_graphic_lookup_loader)
- Purpose: Loads and manages graphic lookup data
- Key Features: Batch processing of graphic definitions
- Usage: Data import for graphics management
- ACW-Get EdgeData (x_146833_creativ_0_acw_get_edgedata)
- Purpose: Data source table for edge information
- Key Features: Manages edge data import and processing
- Usage: Integration with external graph data sources
- Incidentloaderapi (x_146833_creativ_0_incidentloaderapi)
- Purpose: API interface for incident data loading
- Key Features: Handles incident data integration
- Usage: External system integration for incident management
Business Rules
- Set Target when missing
- Table: Applied to edge or node tables
- Purpose: Automatically sets target values when they are missing
- Trigger: Before insert/update
- Logic: Ensures data integrity by populating required target fields
- SetIdToNumber
- Table: Applied to core data tables
- Purpose: Automatically generates or converts ID fields to numeric format
- Trigger: Before insert/update
- Logic: Maintains consistent ID formatting across the application
- cascade Delete Nodes Edges and Graphics
- Table: Applied to graph table
- Purpose: Maintains referential integrity during deletion operations
- Trigger: Before delete
- Logic: Automatically removes dependent records (nodes, edges, graphics) when parent graph is deleted
UI Actions
- Create App Digital Twin
- Purpose: Creates a digital twin representation of an application
- Location: Application forms or lists
- Functionality:
- Generates comprehensive digital representation
- Creates associated graph structures
- Initializes visualization components
- User Experience: One-click digital twin creation
- Create CI Digital Twin
- Purpose: Creates a digital twin representation of a Configuration Item (CI)
- Location: CI forms or CMDB interfaces
- Functionality:
- Maps CI relationships to graph structures
- Creates visual representation of CI dependencies
- Generates interactive digital twin
- User Experience: Seamless CI-to-digital-twin conversion
Data Model Relationships
Primary Relationships
graph (1) → (n) node
graph (1) → (n) edge
graph (1) → (n) graphics
file (1) → (n) graphics
node (n) → (n) edge (source/target relationships)
Lookup Relationships
LabelGraphics → Label Graphics Lookup
graphics → Creativ 0 Hex Color Codes
file → File Application
Data Loading Relationships
External Sources → ACW-Get EdgeData → edge
External Sources → Incidentloaderapi → incident data
External Sources → Creativ 0 Graphic Lookup Loader → graphics
Key Features and Capabilities
Graph Visualization
- Interactive node-edge graph rendering
- Customizable visual themes using hex color codes
- Label graphics with configurable record types
Digital Twin Creation
- Application digital twins with complete dependency mapping
- CI digital twins with CMDB integration
- Automated graph structure generation
Data Integration
- Multiple data source support
- Automated data loading processes
- API integration capabilities
File Management
- Multi-application file support
- State-based file processing
- Type classification system
Technical Architecture
Data Flow
- Input: Files and external data sources
- Processing: Business rules ensure data integrity
- Storage: Structured data in core tables
- Visualization: Graph rendering using graphics and lookup tables
- Interaction: UI actions provide user functionality
Security Model
- Scoped application isolation
- Allowed classes validation
- Role-based access control integration
Performance Considerations
- Optimized lookup table structure
- Cascading delete operations for data cleanup
- Batch loading processes for large datasets
Future Enhancements
Potential Extensions
- Additional visualization types beyond graphs
- Enhanced API integrations
- Real-time data synchronization
- Advanced analytics and reporting
Scalability Considerations
- Table partitioning for large datasets
- Caching strategies for frequent lookups
- Asynchronous processing for bulk operations
Link to published document: https://claude.ai/public/artifacts/7942a843-3b58-43f6-8fe3-1f1783b70542
References
mcp-neo4j/servers/mcp-neo4j-cypher at main · neo4j-contrib/mcp-neo4j
Model Context Protocol (MCP) Integrations for Neo4j - Developer Guides
Default file locations - Operations Manual
Neo4j Fundamentals | Foundational | Free Neo4j Courses from GraphAcademy
- 1,291 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @VaranAwesomenow,
are you sure this is related to ServiceNow? Also, is this asking for help or you were sharing an article?
It is not clear, how can we help you.