Configure an MCP client to connect to an MCP server
Configure a Model Context Protocol (MCP) client to connect to an MCP server and prompt the server to perform a task.
Before you begin
Role required: none
About this task
The process to configure a client to connect to a server is dependent on the client used. The following procedure is a high-level overview of the workflow to configure a client to call a server. For more information, refer to the documentation for your AI application and client. For an example that demonstrates how to connect from a server on one instance to the ServiceNow Model Context Protocol Client on another instance, see the example following this procedure.
Procedure
Configure a client with the required server details as determined by the client.
Server details
Value
Server URL
`https://.service-now.com/sncapps/mcp-server/mcp/`To connect to the preconfigured Quickstart Server, use `https://.service-now.com/sncapps/mcp-server/mcp/sn_mcp_server_default`.
Host
`.service-now.com`
Base URL
`/sncapps/mcp-server`
Scope
mcp\_server
Authentication type
OAuth 2.0
Identity Provider
Generic OAuth 2
Authorization URL
`https://.service-now.com/oauth_auth.do`
Token URL
`https://.service-now.com/oauth_token.do`
Token Revocation URL
`https://.service-now.com/oauth_revoke.do`
Refresh URL
`https://.service-now.com/oauth_auth.do`
Redirect URL
`https://.service-now.com/oauth/callback`
Client ID
The client ID from the OAuth inbound integration on the server instance.
Client secret
The client secret from the OAuth inbound integration on the server instance.
After configuring these details, the client calls the server with the `Authorization: Bearer <token>` header. If the token is validated by the server, the client receives the list of tools available for use.
From the client, you can view the list of tools available to determine how to prompt the server.
Enter a prompt for the information you need or for the tool to perform an action on the instance.
For example, if the Look up Incident Records tool is available, you could enter "Get all open incidents." With the Case summarization tool, you could enter "Summarize all cases closed this week."
The server runs the relevant tools and returns the result to the client as JSON data. The client presents the response as formatted text.
Connecting to an MCP server from ServiceNow Model Context Protocol Client
This example demonstrates how to connect to a server from an AI agent on another instance using the ServiceNow Model Context Protocol Client. First, you configure the client to call the preconfigured Quickstart Server. From an AI agent, you access the Quickstart Server's list of tools and add individual tools to the agent. Lastly, you test the agent in AI Agent Studio by providing a prompt and seeing the agent's response. For more information, see the Model Context Protocol Client documentation.
Role required: sn_mcp_client.admin
On the server instance, create an OAuth inbound integration for the ServiceNow Model Context Protocol Client.
In the Choose a test type field, select AI agent or workflow.
Select the AI agent you configured and its version.
In the Task field, enter a prompt to get information or to perform an action on the instance.
The prompt should be based on which tools are available. For example, if you added the Look up Case Records and Case summarization tools, you can enter "Summarize all cases closed this week."
Image omitted: mcp-server-prompt-agent.png Prompting the AI agent for summaries of cases closed by Abel Tuter this week.
6. Select **Continue to Test Chat Response**.
The AI agent calls the server, and the server runs the tools requested based on the prompt. The server returns the information to the agent as JSON data, and the agent presents it as formatted text. In this example, the agent returns summaries of the cases closed by Abel Tuter in the past week.
Image omitted: mcp-server-agent-response.png The agent responds with summaries of two cases closed by Abel Tuter this week.