Connecting to an MCP server from an MCP client
Connect to a Model Context Protocol (MCP) server from an MCP client by creating an OAuth inbound integration and configuring the client with the server details.
With the Quickstart Server or after creating a server, you can complete the following steps to connect to a server from a client:
- Create an OAuth inbound integration for an MCP client
- Configure an MCP client to connect to an MCP server
The process to configure a client to connect to a server is dependent on the client used. For more information, refer to the documentation for your AI application and client.
Create an OAuth inbound integration for an MCP client
Secure access to Model Context Protocol (MCP) servers on an instance by creating an OAuth inbound integration for each MCP client.
Before you begin
Role required: oauth_admin, mi_admin, admin
About this task
For each client that you want to access servers on an instance, create an OAuth inbound integration in Machine Identity Console. To create the OAuth integration, you need a redirect URL from the client. For more information, refer to the documentation for your AI application and client.
Procedure
What to do next
Configure the client to use the client ID and client secret to authenticate with servers on the instance.
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
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.
For more information, see Create an OAuth inbound integration for an MCP client.
- On the client instance, navigate to .
- Select Manage MCP Servers.
- Select New.
- Add the Quickstart Server.
For more information about this step, see Add an MCP server with OAuth 2.1.
- On the Add MCP server form, fill in the fields.
Table 3. Add MCP server form Field Value Name Quickstart Server Authentication Type OAuth 2.1 MCP server URL https://<server-instance>.service-now.com/sncapps/mcp-server/mcp/sn_mcp_server_default - Select Next.
- On the form, fill in the fields.
Table 4. Add MCP server form Field Value Client registration type Manual Registration Grant type Authorization Code Token authentication method Client Secret Post Client ID The client ID from the OAuth inbound integration for the Model Context Protocol Client on the server instance. Client secret The client secret from the OAuth inbound integration for the Model Context Protocol Client on the server instance. Authorization URL https://<server-instance>.service-now.com/oauth_auth.do Token URL https://<server-instance>.service-now.com/oauth_token.do Token Revocation URL https://<server-instance>.service-now.com/oauth_revoke.do - Select Save.
- On the Add MCP server form, fill in the fields.
- Verify the OAuth configuration.
- Select Authenticate.
- Select Allow to allow the client to connect to the server.
- Add tools from the Quickstart Server to an AI agent.
For more information about this step, see Add an MCP server tool to an AI agent.
- In AI Agent Studio, select the Create and manage tab.
- From the AI agents tab, select an existing agent or create one.
For information about creating an agent, see Create an AI agent.
- Select Add tools and information.
- Select .
- On the form, fill in the fields.
Table 5. Add a Model Context Protocol Tool form Field Value Select Model Context Protocol server Quickstart Server Select tool Select the tools from the Quickstart Server that you want to use with this AI agent. - Select Add.
- Select Save and continue.
- Test the AI agent.
For more information about this step, see Test an AI agent.
- In AI Agent Studio, select the Testing tab.
- Select Start manual test.
- 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."
- 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.