The ServiceNow MCP server provides a bridge between Claude and ServiceNow instances, allowing you to interact with ServiceNow data and functionality directly through natural language. This server implements the Model Completion Protocol (MCP) to enable seamless integration with Claude.
Clone the repository and set up the environment:
git clone https://github.com/yourusername/servicenow-mcp.git
cd servicenow-mcp
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .
Create a .env
file with your ServiceNow credentials:
SERVICENOW_INSTANCE_URL=https://your-instance.service-now.com
SERVICENOW_USERNAME=your-username
SERVICENOW_PASSWORD=your-password
SERVICENOW_AUTH_TYPE=basic # or oauth, api_key
Start the MCP server with:
python -m servicenow_mcp.cli
Or with inline environment variables:
SERVICENOW_INSTANCE_URL=https://your-instance.service-now.com SERVICENOW_USERNAME=your-username SERVICENOW_PASSWORD=your-password SERVICENOW_AUTH_TYPE=basic python -m servicenow_mcp.cli
You can also run the server using SSE for more flexible integration:
servicenow-mcp-sse --instance-url=https://your-instance.service-now.com --username=your-username --password=your-password
Customize host and port if needed:
servicenow-mcp-sse --host=127.0.0.1 --port=8000
SERVICENOW_AUTH_TYPE=basic
SERVICENOW_USERNAME=your-username
SERVICENOW_PASSWORD=your-password
SERVICENOW_AUTH_TYPE=oauth
SERVICENOW_CLIENT_ID=your-client-id
SERVICENOW_CLIENT_SECRET=your-client-secret
SERVICENOW_TOKEN_URL=https://your-instance.service-now.com/oauth_token.do
SERVICENOW_AUTH_TYPE=api_key
SERVICENOW_API_KEY=your-api-key
The server supports loading specific subsets of tools using packages. Control this with the MCP_TOOL_PACKAGE
environment variable:
export MCP_TOOL_PACKAGE=catalog_builder
Available packages include:
service_desk
: Incident handling and user/knowledge lookupcatalog_builder
: Service catalog managementchange_coordinator
: Change request managementknowledge_author
: Knowledge base managementplatform_developer
: Server-side scripting and workflow developmentsystem_administrator
: User/group management and system logsagile_management
: User stories, epics, and scrum tasksfull
: All available tools (default)none
: No tools (except list_tool_packages
)Install the ServiceNow MCP server with the MCP CLI:
mcp install src/servicenow_mcp/server.py -f .env
Edit your Claude Desktop configuration file:
{
"mcpServers": {
"ServiceNow": {
"command": "/Users/yourusername/dev/servicenow-mcp/.venv/bin/python",
"args": [
"-m",
"servicenow_mcp.cli"
],
"env": {
"SERVICENOW_INSTANCE_URL": "https://your-instance.service-now.com",
"SERVICENOW_USERNAME": "your-username",
"SERVICENOW_PASSWORD": "your-password",
"SERVICENOW_AUTH_TYPE": "basic"
}
}
}
}
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "ServiceNow" '{"command":"python","args":["-m","servicenow_mcp.cli"],"env":{"SERVICENOW_INSTANCE_URL":"https://your-instance.service-now.com","SERVICENOW_USERNAME":"your-username","SERVICENOW_PASSWORD":"your-password","SERVICENOW_AUTH_TYPE":"basic"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"ServiceNow": {
"command": "python",
"args": [
"-m",
"servicenow_mcp.cli"
],
"env": {
"SERVICENOW_INSTANCE_URL": "https://your-instance.service-now.com",
"SERVICENOW_USERNAME": "your-username",
"SERVICENOW_PASSWORD": "your-password",
"SERVICENOW_AUTH_TYPE": "basic"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"ServiceNow": {
"command": "python",
"args": [
"-m",
"servicenow_mcp.cli"
],
"env": {
"SERVICENOW_INSTANCE_URL": "https://your-instance.service-now.com",
"SERVICENOW_USERNAME": "your-username",
"SERVICENOW_PASSWORD": "your-password",
"SERVICENOW_AUTH_TYPE": "basic"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect