{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":23036,"path":"intelligent-experiences/configure-client-connect-server.md","title":"Configure an MCP client to connect to an MCP server","bundle":null,"doc_type":null,"release":"australia","body":"\n# Configure an MCP client to connect to an MCP server\n\nConfigure a Model Context Protocol \\(MCP\\) client to connect to an MCP server and prompt the server to perform a task.\n\n## Before you begin\n\nRole required: sn\\_mcp\\_server.viewer\n\n## About this task\n\nThe 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.\n\n**Note:**\n\n-   MCP Server Console supports the Streamable HTTP transport. By default, tool calls return a single JSON response. Server-Sent Events \\(SSE\\) are optionally available for streaming response types. Stdio is not supported.\n-   The MCP rate limit is not configurable currently, and adjusting the rate limit requires a service restart. Contact your ServiceNow representative to learn more.\n\n## Procedure\n\n1.  Configure a client with the required server details as determined by the client.\n\n<table id=\"table_btb_gvf_hhc\"><thead><tr><th>\n\nServer details\n\n</th><th>\n\nValue\n\n</th></tr></thead><tbody><tr><td>\n\nServer URL\n\n</td><td>\n\n`https://<server-instance>.service-now.com/sncapps/mcp-server/mcp/<server-name>`To connect to the preconfigured Quickstart Server, use `https://<server-instance>.service-now.com/sncapps/mcp-server/mcp/sn_mcp_server_default`.\n\n</td></tr><tr><td>\n\nHost\n\n</td><td>\n\n`<server-instance>.service-now.com`\n\n</td></tr><tr><td>\n\nBase URL\n\n</td><td>\n\n`/sncapps/mcp-server`\n\n</td></tr><tr><td>\n\nScope\n\n</td><td>\n\nmcp\\_server\n\n</td></tr><tr><td>\n\nAuthentication type\n\n</td><td>\n\nOAuth 2.0\n\n</td></tr><tr><td>\n\nIdentity Provider\n\n</td><td>\n\nGeneric OAuth 2\n\n</td></tr><tr><td>\n\nAuthorization URL\n\n</td><td>\n\n`https://<server-instance>.service-now.com/oauth_auth.do`\n\n</td></tr><tr><td>\n\nAccess Token URL\n\n</td><td>\n\n`https://<server-instance>.service-now.com/oauth_token.do`\n\n</td></tr><tr><td>\n\nToken Revocation URL\n\n</td><td>\n\n`https://<server-instance>.service-now.com/oauth_revoke.do`\n\n</td></tr><tr><td>\n\nRefresh Token URL\n\n</td><td>\n\n`https://<server-instance>.service-now.com/oauth_auth.do`\n\n</td></tr><tr><td>\n\nRedirect or Callback URL\n\n</td><td>\n\n`https://<server-instance>.service-now.com/oauth/callback`\n\n</td></tr><tr><td>\n\nClient ID\n\n</td><td>\n\nThe client ID from the OAuth inbound integration on the server instance.**Note:** For clients that support Client ID Metadata Document \\(CIMD\\) authentication, you can register a CIMD client and provide a CIMD URL instead of a client ID. For more information, see [Configure a CIMD client](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/configure-cimd-client.md)\n\n</td></tr><tr><td>\n\nClient secret\n\n</td><td>\n\nThe client secret from the OAuth inbound integration on the server instance.If you use CIMD authentication, you don't need to provide a client secret.\n\n</td></tr></tbody>\n</table>    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.\n\n2.  From the client, you can view the list of tools available to determine how to prompt the server.\n\n3.  Enter a prompt for the information you need or for the tool to perform an action on the instance.\n\n    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\".\n\n    **Note:** When calling a Scripted REST API tool from a client, you must provide inputs in your request. If a required parameter, such as a record number, a date range, or a filter value, is not present in the request, the tool will not be able to complete the task.\n\n    The server runs the relevant tools and returns the result to the client as JSON data. The client presents the response as formatted text.\n\n    **Important:** The MCP service limits the size of tool call payloads. If a request payload from the MCP client exceeds 26 KB, the MCP service returns an error stating that the request payload is too big. If a response payload exceeds 64 KB, the MCP service returns an error stating that the response payload is too big. The minimum version for this restriction is Brail patch 1, Australia patch 7 and Zurich patch 13.\n\n    **Note:** If you don't receive the expected data in the response, review the following troubleshooting tips:\n\n    -   If you receive an empty or incomplete response rather than an error, first check the ACL configuration for the invoked tool. For more information, see [Creating tools for a Model Context Protocol server](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/creating-tools-mcp-server.md).\n    -   If you receive a 401 error, generate a new authentication token from the client.\n    -   If you receive a 403 error, confirm that the calling user or client has the required role and ACL access for the invoked tool.\n\nIf you run into other issues connecting to a server, see the following additional resources to help you troubleshoot:\n\n-   [Creating tools for a Model Context Protocol server](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/creating-tools-mcp-server.md)\n-   [MCP Server Console FAQ](https://www.servicenow.com/community/now-assist-articles/mcp-server-console-faq/ta-p/3550125) in the ServiceNow Community\n-   [OAuth Inbound Authentication with ServiceNow: Authorization Code Grant Flow Using Postman](https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2058755) article in the Now Support Knowledge Base\n\n## Connecting to an MCP server from ServiceNow Model Context Protocol Client\n\nThis 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 Legacy](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/mcp-client.md) documentation.\n\nRole required: sn\\_mcp\\_server.viewer and sn\\_mcp\\_client.admin\n\n1.  On the server instance, create an OAuth inbound integration for the ServiceNow Model Context Protocol Client.\n\n    For more information, see [Create an OAuth inbound integration for an MCP client](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/create-oauth-inbound-integration-mcp-client.md).\n\n2.  On the client instance, navigate to **All** &gt; **AI Agent Studio** &gt; **Settings**.\n3.  Select **Manage MCP Servers**.\n4.  Select **New**.\n5.  Add the Quickstart Server.\n\n    For more information about this step, see [Add an MCP server with OAuth 2.1](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/add-an-oauth-2-1-mcp-server.md).\n\n    1.  On the Add MCP server form, fill in the fields.\n\n        |Field|Value|\n        |-----|-----|\n        |Name|Quickstart Server|\n        |Authentication Type|OAuth 2.1|\n        |MCP server URL|`https://<server-instance>.service-now.com/sncapps/mcp-server/mcp/sn_mcp_server_default`|\n\n    2.  Select **Next**.\n    3.  On the form, fill in the fields.\n\n        |Field|Value|\n        |-----|-----|\n        |Client registration type|Manual Registration|\n        |Grant type|Authorization Code|\n        |Token authentication method|Client Secret Post|\n        |Client ID|The client ID from the OAuth inbound integration for the Model Context Protocol Client on the server instance.|\n        |Client secret|The client secret from the OAuth inbound integration for the Model Context Protocol Client on the server instance.|\n        |Authorization URL|`https://<server-instance>.service-now.com/oauth_auth.do`|\n        |Token URL|`https://<server-instance>.service-now.com/oauth_token.do`|\n        |Token Revocation URL|`https://<server-instance>.service-now.com/oauth_revoke.do`|\n\n    4.  Select **Save**.\n6.  Verify the OAuth configuration.\n    1.  Select **Authenticate**.\n    2.  Select **Allow** to allow the client to connect to the server.\n7.  Add tools from the Quickstart Server to an AI agent.\n\n    For more information about this step, see [Add an MCP server tool to an AI agent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/add-mcp-server-tool.md).\n\n    1.  In AI Agent Studio, select the **Create and manage** tab.\n    2.  From the AI agents tab, select an existing agent or create one.\n\n        For information about creating an agent, see [Create an AI agent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/configure-next-best-action-agent.md).\n\n    3.  Select **Add tools and information**.\n    4.  Select **Add tool** &gt; **MCP server tool**.\n    5.  On the form, fill in the fields.\n\n        |Field|Value|\n        |-----|-----|\n        |Select Model Context Protocol server|Quickstart Server|\n        |Select tool|Select the tools from the Quickstart Server that you want to use with this AI agent.|\n\n        \\[Omitted image \"mcp-server-tools-list.png\"\\] Alt text: Viewing the tools list for the Quickstart Server from an AI agent in AI Agent Studio.\n\n    6.  Select **Add**.\n    7.  Select **Save and continue**.\n8.  Test the AI agent.\n\n    For more information about this step, see [Test an AI agent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/test-ai-agent-mcp.md).\n\n    1.  In AI Agent Studio, select the **Testing** tab.\n    2.  Select **Start manual test**.\n    3.  In the Choose a test type field, select **AI agent or workflow**.\n    4.  Select the AI agent you configured and its version.\n    5.  In the Task field, enter a prompt to get information or to perform an action on the instance.\n\n        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.\"\n\n        \\[Omitted image \"mcp-server-prompt-agent.png\"\\] Alt text: Prompting the AI agent for summaries of cases closed by Abel Tuter this week.\n\n    6.  Select **Continue to Test Chat Response**.\n    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.\n\n    \\[Omitted image \"mcp-server-agent-response.png\"\\] Alt text: The agent responds with summaries of two cases closed by Abel Tuter this week.\n\n\n**Parent Topic:**[Connecting to an MCP server from an MCP client](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/connect-mcp-server-client.md)\n\n"}}