ServiceNow MCP Server

by osomai

274 301 downloads Not rated yet MIT

About

An MCP server implementation for interacting with ServiceNow instances.

Details

License
MIT

Explore

- Connect to ServiceNow instances using various authentication methods (Basic, OAuth, API Key)
- Query ServiceNow records and tables
- Create, update, and delete ServiceNow records
- Execute ServiceNow scripts and workflows
- Access and query the ServiceNow Service Catalog
- Analyze and optimize the ServiceNow Service Catalog
- Debug mode for troubleshooting
- Support for both stdio and Server-Sent Events (SSE) communication

- Python 3.11 or higher
- A ServiceNow instance with appropriate access credentials

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,
)

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.

Below are some example natural language queries you can use with Claude to interact with ServiceNow via the MCP server:


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
```

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.

A Model Completion Protocol (MCP) server implementation for ServiceNow, allowing Claude to interact with ServiceNow instances.

<a href="https://glama.ai/mcp/servers/@osomai/servicenow-mcp">
ServiceNow Server MCP server
</a>

Overview

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.

Features

- Connect to ServiceNow instances using various authentication methods (Basic, OAuth, API Key)
- Query ServiceNow records and tables
- Create, update, and delete ServiceNow records
- Execute ServiceNow scripts and workflows
- Access and query the ServiceNow Service Catalog
- Analyze and optimize the ServiceNow Service Catalog
- Debug mode for troubleshooting
- Support for both stdio and Server-Sent Events (SSE) communication

Installation

Prerequisites

- Python 3.11 or higher
- A ServiceNow instance with appropriate access credentials

Setup

1. Clone this repository:

   git clone https://github.com/echelon-ai-labs/servicenow-mcp.git
cd servicenow-mcp

2. Create a virtual environment and install the package:

   python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .

3. 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

Usage

Standard (stdio) Mode

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

Server-Sent Events (SSE) Mode

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.

Starting the SSE Server

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
Connecting to the SSE Server

The SSE server exposes two main endpoints:

- /sse - The SSE connection endpoint
- /messages/ - The endpoint for sending messages to the server

Example

See the examples/sse_server_example.py file for a complete example of setting up and running the SSE server.

```python
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

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.

Videos about ServiceNow MCP Server

Relevant YouTube tutorials, setups, and demos