mcp -servicenow
MCP server from divyashah0510/mcp-server-servicenow
claude mcp add --transport stdio divyashah0510-mcp-server-servicenow python -m servicenow \ --env GEMINI_API_KEY="optional_api_key_for AI capabilities" \ --env SERVICENOW_INSTANCE="ServiceNow instance URL (e.g., https://your-instance.service-now.com)" \ --env SERVICENOW_PASSWORD="your_password" \ --env SERVICENOW_USERNAME="your_username"
How to use
This MCP server provides a ServiceNow integration that exposes a set of tools to manage ServiceNow resources via the Model Context Protocol. It enables automated incident creation, knowledge base article management, client script and business rule automation, SLA definitions, and record producer creation. The server is built on FastAPI and uses environment-based credentials to securely connect to your ServiceNow instance. To get started, configure your environment variables, install the package in editable mode, and run the MCP workflow to connect your ServiceNow instance to the MCP ecosystem. Once running, you can invoke the available tools like create_incident, create_kb_article, create_client_script, create_business_rule, create_sla_definition, create_record_producer, and create_variable_set to programmatically perform common ServiceNow operations through MCP prompts and prompts-based automation.
How to install
Prerequisites:
- Python 3.12 or higher
- ServiceNow instance with appropriate API access
- Valid ServiceNow credentials
- Optional: Gemini API key for AI capabilities
- uvicorn (for running the server)
- FastAPI
- Clone the repository and navigate to it:
git clone https://github.com/your-org/mcp-server-now.git
cd mcp-server-now
- Create a virtual environment (optional but recommended) and activate it:
python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate
- Install dependencies in editable mode:
pip install -e .
- Create a .env file (or export environment variables) with ServiceNow credentials and optional Gemini API key:
SERVICENOW_INSTANCE=https://your-instance.service-now.com
SERVICENOW_USERNAME=your_username
SERVICENOW_PASSWORD=your_password
GEMINI_API_KEY=your_api_key # Optional
- Run the MCP server using the recommended config (the module name is servicenow as shown in the repository structure):
# Example using the MCP runner
mcp install servicenow.py
- Verify the server starts and is reachable via the MCP interface. You can then start issuing MCP commands to interact with ServiceNow resources.
Additional notes
Tips and common issues:\n- Ensure your ServiceNow instance URL is correctly set and accessible from your running environment.\n- The env variables SERVICENOW_USERNAME and SERVICENOW_PASSWORD should correspond to a user with API access in ServiceNow.\n- If you encounter authentication failures, double-check credentials and account permissions, and consider using a dedicated service account for MCP operations.\n- The Gemini API key is optional and only required if you plan to leverage AI capabilities within the MCP workflow.\n- When adding new tools, follow the pattern in servicenow.py by decorating functions with @mcp.tool() and providing clear input/output handling.\n- If you update dependencies, re-install in editable mode to ensure changes are picked up by the MCP runner.