by echelon-ai-labs
A Model Completion Protocol (MCP) server implementation for ServiceNow, allowing Claude to interact with ServiceNow instances.
servicenow-mcp is a Model Completion Protocol (MCP) server that acts as a bridge between Claude (an AI) and ServiceNow instances. It enables Claude to connect to ServiceNow, retrieve data, and perform various actions through the ServiceNow API, facilitating seamless integration and automation of tasks within ServiceNow.
To use servicenow-mcp, you first need to install it by cloning the repository, creating a virtual environment, and installing the package. You'll also need to configure your ServiceNow credentials in a .env
file. The server can be run in two modes:
python -m servicenow_mcp.cli
.servicenow-mcp-sse
command, allowing for more flexible integration options.For integration with Claude, you can use the MCP CLI to install and register the server, or manually configure it in Claude Desktop by editing the claude_desktop_config.json
file with the server command, arguments, and environment variables.
service_desk
, catalog_builder
, change_coordinator
, etc.servicenow-mcp can be used for a variety of automation and interaction scenarios with ServiceNow, including:
Q: What are the prerequisites for installing servicenow-mcp? A: You need Python 3.11 or higher and a ServiceNow instance with appropriate access credentials.
Q: How can I manage the number of tools exposed to the language model?
A: You can use the "Tool Packaging" feature by setting the MCP_TOOL_PACKAGE
environment variable to a specific package name (e.g., catalog_builder
). This loads only a subset of tools defined in config/tool_packages.yaml
.
Q: What are the available authentication methods? A: servicenow-mcp supports Basic, OAuth, and API Key authentication methods.
Q: How can I troubleshoot common errors with Change Management Tools?
A: Common errors include incorrect parameter types (argument after ** must be a mapping, not CreateChangeRequestParams
), missing required parameters (Missing required parameter 'type'
), invalid parameter values (Invalid value for parameter 'type'
), and incorrect order of authentication parameters (Cannot find get_headers method in either auth_manager or server_config
). The documentation provides solutions for these issues, often involving ensuring correct parameter types, providing all required fields, using valid values, and checking parameter order.
Q: Can I contribute to servicenow-mcp? A: Yes, contributions are welcome. You can fork the repository, create a feature branch, commit your changes, and open a Pull Request.
A Model Completion Protocol (MCP) server implementation for ServiceNow, allowing Claude to interact with ServiceNow instances.
This project implements an MCP server that enables Claude to connect to ServiceNow instances, retrieve data, and perform actions through the ServiceNow API. It serves as a bridge between Claude and ServiceNow, allowing for seamless integration.
Clone this repository:
git clone https://github.com/yourusername/servicenow-mcp.git
cd servicenow-mcp
Create a virtual environment and install the package:
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
To start the MCP server:
python -m servicenow_mcp.cli
Or with 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
The ServiceNow MCP server can also run as a web server using Server-Sent Events (SSE) for communication, which allows for more flexible integration options.
You can start the SSE server using the provided CLI:
servicenow-mcp-sse --instance-url=https://your-instance.service-now.com --username=your-username --password=your-password
By default, the server will listen on 0.0.0.0:8080
. You can customize the host and port:
servicenow-mcp-sse --host=127.0.0.1 --port=8000
The SSE server exposes two main endpoints:
/sse
- The SSE connection endpoint/messages/
- The endpoint for sending messages to the serverSee the examples/sse_server_example.py
file for a complete example of setting up and running the SSE server.
from servicenow_mcp.server import ServiceNowMCP
from servicenow_mcp.server_sse import create_starlette_app
from servicenow_mcp.utils.config import ServerConfig, AuthConfig, AuthType, BasicAuthConfig
import uvicorn
# Create server configuration
config = ServerConfig(
instance_url="https://your-instance.service-now.com",
auth=AuthConfig(
type=AuthType.BASIC,
config=BasicAuthConfig(
username="your-username",
password="your-password"
)
),
debug=True,
)
# Create ServiceNow MCP server
servicenow_mcp = ServiceNowMCP(config)
# Create Starlette app with SSE transport
app = create_starlette_app(servicenow_mcp, debug=True)
# Start the web server
uvicorn.run(app, host="0.0.0.0", port=8080)
To manage the number of tools exposed to the language model (especially in environments with limits), the ServiceNow MCP server supports loading subsets of tools called "packages". This is controlled via the MCP_TOOL_PACKAGE
environment variable.
MCP_TOOL_PACKAGE
environment variable to the name of the desired package.
export MCP_TOOL_PACKAGE=catalog_builder
config/tool_packages.yaml
. You can customize this file to create your own packages.MCP_TOOL_PACKAGE
is set to a valid package name defined in config/tool_packages.yaml
, only the tools listed in that package will be loaded.MCP_TOOL_PACKAGE
is not set or is empty, the full
package (containing all tools) is loaded by default.MCP_TOOL_PACKAGE
is set to an invalid package name, the none
package is loaded (no tools except list_tool_packages
), and a warning is logged.MCP_TOOL_PACKAGE=none
explicitly loads no tools (except list_tool_packages
).The default config/tool_packages.yaml
includes the following role-based packages:
service_desk
: Tools for incident handling and basic user/knowledge lookup.catalog_builder
: Tools for creating and managing service catalog items, categories, variables, and related scripting (UI Policies, User Criteria).change_coordinator
: Tools for managing the change request lifecycle, including tasks and approvals.knowledge_author
: Tools for creating and managing knowledge bases, categories, and articles.platform_developer
: Tools for server-side scripting (Script Includes), workflow development, and deployment (Changesets).system_administrator
: Tools for user/group management and viewing system logs.agile_management
: Tools for managing user stories, epics, scrum tasks, and projects.full
: Includes all available tools (default).none
: Includes no tools (except list_tool_packages
).list_tool_packages
: Lists all available tool package names defined in the configuration and shows the currently loaded package. This tool is available in all packages except none
.Note: The availability of the following tools depends on the loaded tool package (see Tool Packaging section above). By default (full
package), all tools are available.
Story Management
Epic Management
Scrum Task Management
Project Management
The ServiceNow MCP server can be installed with the MCP CLI, which provides a convenient way to register the server with Claude.
# Install the ServiceNow MCP server with environment variables from .env file
mcp install src/servicenow_mcp/server.py -f .env
This command will register the ServiceNow MCP server with Claude and configure it to use the environment variables from the .env file.
To configure the ServiceNow MCP server in Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json
(macOS) or the appropriate path for your OS:{
"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"
}
}
}
}
Below are some example natural language queries you can use with Claude to interact with ServiceNow via the MCP server:
The repository includes example scripts that demonstrate how to use the tools:
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
Additional documentation is available in the docs
directory:
Error: argument after ** must be a mapping, not CreateChangeRequestParams
CreateChangeRequestParams
object instead of a dictionary to the create_change_request
function.Error: Missing required parameter 'type'
create_change_request
, both short_description
and type
are required.Error: Invalid value for parameter 'type'
type
parameter.Error: Cannot find get_headers method in either auth_manager or server_config
auth_manager
and server_config
parameters in the correct order. The functions have been updated to handle parameter swapping automatically.Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
Please log in to share your review and rating for this MCP.
Discover more MCP servers with similar functionality and use cases
by Skyvern-AI
Skyvern automates browser-based workflows using LLMs and computer vision, offering a robust solution for repetitive online tasks.
by PipedreamHQ
Connect APIs quickly, run event‑driven automations, and execute custom code in Node.js, Python, Go, or Bash on a hosted platform.
by czlonkowski
Provides AI assistants with structured access to n8n node documentation, properties, and operations, enabling automated workflow creation, validation, and management.
by executeautomation
mcp-playwright is a Model Context Protocol (MCP) server that enables large language models (LLMs) to perform browser automation and web scraping tasks using Playwright.
by browserbase
Provides cloud browser automation capabilities for LLMs, enabling web navigation, interaction, screenshot capture, and data extraction through Browserbase and Stagehand.
by haris-musa
excel-mcp-server is a Python-based Model Context Protocol (MCP) server that enables AI agents to programmatically create, read, and modify Excel files without requiring Microsoft Excel to be installed.
by mobile-next
Mobile-mcp is a Model Context Protocol (MCP) server designed for scalable mobile automation, app scraping, and development across iOS and Android devices, including physical devices, simulators, and emulators.
by anaisbetts
mcp-installer is an MCP server designed to automate the installation of other MCP servers, simplifying the process for users.
by leonardsellem
An MCP server that enables AI assistants to interact with n8n workflows through natural language.