mady22070/servicenow-mcp
If you are the rightful owner of servicenow-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The ServiceNow MCP Server is a comprehensive Model Context Protocol server designed to integrate AI assistants with ServiceNow, enabling automated operations and advanced troubleshooting.
ServiceNow MCP Server
A comprehensive Model Context Protocol (MCP) server that provides AI assistants with powerful ServiceNow integration capabilities. This server enables automated operations, advanced troubleshooting, and sophisticated development workflows within ServiceNow instances.
π Features
Core Capabilities
- Multi-environment support (dev/test/prod)
- Comprehensive ServiceNow operations through modular "packs"
- Built-in security guards and workspace management
- Advanced caching and connection pooling
- Comprehensive error handling and logging
Senior Developer Features
- Story-to-Implementation Pipeline: Convert user stories into executable ServiceNow plans
- Advanced CMDB Troubleshooting: Sophisticated duplicate detection and data quality analysis
- Root Cause Analysis: Systematic problem investigation with correlation analysis
- Development Planning: Automated task decomposition and dependency management
Supported ServiceNow Areas
- ITSM: Incidents, Problems, Changes, Requests
- CMDB: Configuration items, relationships, discovery
- Development: Scripts, business rules, UI policies, flows
- Platform: Tables, fields, users, groups, notifications
- Automation: Workflows, scheduled jobs, integrations
- Quality: ATF testing, data validation, performance monitoring
π Prerequisites
- Python 3.8 or higher
- ServiceNow instance (any version)
- ServiceNow user account with appropriate permissions
- MCP-compatible AI assistant (Claude Desktop, etc.)
π οΈ Installation
1. Clone the Repository
git clone https://github.com/mady22070/servicenow-mcp.git
cd servicenow-mcp
2. Set Up Virtual Environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
3. Install Dependencies
pip install -r requirements.txt
4. Configure Environment
Create environment variables for your ServiceNow instance:
# Development environment
export SERVICENOW_DEV_INSTANCE_URL=https://devXXX.service-now.com
export SERVICENOW_DEV_USERNAME=your_username
export SERVICENOW_DEV_PASSWORD=your_password
# Optional: Production environment
export SERVICENOW_PROD_INSTANCE_URL=https://yourinstance.service-now.com
export SERVICENOW_PROD_USERNAME=prod_username
export SERVICENOW_PROD_PASSWORD=prod_password
# Optional: Restrict table access during testing
export MCP_ALLOW_TABLES=sys_script,sys_script_include,ui_policy,ui_policy_action
π Quick Start
For Claude Desktop Users (Most Common)
π
Quick Summary:
- Clone this repository and install dependencies
- Configure your ServiceNow credentials in
.env
file - Add MCP server to Claude Desktop configuration
- Restart Claude Desktop and start using ServiceNow with AI!
For Developers
1. Start the MCP Server
python mcp_adapter.py
2. Configure Your MCP Client
Add to your MCP client configuration:
{
"mcpServers": {
"servicenow": {
"command": "python",
"args": ["/path/to/servicenow-mcp/mcp_adapter.py"],
"env": {
"SERVICENOW_DEV_INSTANCE_URL": "https://devXXX.service-now.com",
"SERVICENOW_DEV_USERNAME": "your_username",
"SERVICENOW_DEV_PASSWORD": "your_password"
}
}
}
}
3. Test the Connection
# Run health check
python doctor.py
π Usage Examples
Basic Operations
# Create an incident
create_incident(
short_description="Server outage in production",
description="Web servers are not responding",
additional_fields={"urgency": "1", "impact": "1"}
)
# Query records
query_table(
table="incident",
query="state=1^urgency=1",
fields=["number", "short_description", "state"],
limit=10
)
Story-Driven Development
# Convert user story to implementation plan
story_to_implementation(
story="As a service desk agent, I want to automatically assign incidents based on category so that tickets are routed to the right team faster"
)
Advanced CMDB Analysis
# Detect and analyze CMDB duplicates
troubleshoot_cmdb_duplicates(
ci_class="cmdb_ci_server",
analysis_fields=["name", "ip_address", "serial_number"],
limit=100
)
Root Cause Analysis
# Investigate system issues
root_cause_analysis(
issue_description="Users reporting slow form loading times",
related_table="incident",
time_range_hours=24
)
ποΈ Architecture
The ServiceNow MCP server is built with a modular architecture:
servicenow_mcp/
βββ mcp_adapter.py # Main MCP server entry point
βββ client_manager.py # Connection pooling and lifecycle
βββ tool_registry.py # Centralized tool registration
βββ config.py # Environment configuration
βββ decorators.py # Cross-cutting concerns
βββ packs/ # Functional modules
β βββ query_pack.py # Data querying and statistics
β βββ build_pack.py # Application development
β βββ senior_dev_pack.py # Advanced development features
β βββ story_driven_pack.py # Story-to-implementation
β βββ ... # 20+ specialized packs
βββ utils/ # Utility functions
β βββ guard.py # Security controls
β βββ plan.py # Multi-step execution
β βββ workspace.py # Workspace management
βββ tools/ # Tool definitions by area
βββ ...
π Security
- Table Guards: Configurable access controls for sensitive tables
- Environment Isolation: Separate configurations for dev/test/prod
- Dry Run Mode: Test operations without making changes
- Audit Logging: Comprehensive operation tracking
- Credential Management: Secure environment variable handling
π§ͺ Testing
# Run basic health checks
python doctor.py
# Test specific functionality
python -c "from servicenow_mcp.client_manager import client_manager; print(client_manager.health_check())"
# Validate configuration
python -c "from servicenow_mcp.config import Config; print(Config.for_env('dev'))"
π Documentation
- - Complete step-by-step setup for Claude Desktop
- - Common commands and usage examples
- - Complete tool documentation
- - Setup and environment management
- - Real-world usage scenarios
π€ Contributing
We welcome contributions! Please see our for details.
Development Setup
# Clone and setup
git clone https://github.com/mady22070/servicenow-mcp.git
cd servicenow-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
# Run tests
python -m pytest tests/
# Format code
black servicenow_mcp/
isort servicenow_mcp/
π License
This project is licensed under the MIT License - see the file for details.
π Acknowledgments
- Model Context Protocol for the foundational framework
- ServiceNow for the platform APIs
- FastMCP for the MCP server implementation
π Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Wiki
πΊοΈ Roadmap
- GraphQL API support
- Advanced workflow automation
- Machine learning integration
- Performance optimization tools
- Extended ITOM capabilities
- Custom app scaffolding templates
Made with β€οΈ for the ServiceNow community