MCP Connection with OAuth

isqc
Kilo Guru

I have defined an MCP Server connection to an MCP Server which I control.

 

This works fine (after some hiccups, had to deal with this: https://support.servicenow.com/kb?id=kb_article_view&sys_kb_id=f2b77e69935efe188960fb2d6cba10be) when authentication is set to API key.

But when authentication is set to OAuth 2.1, the request to establish the connection is rejected with a 401 error, because it does not include the Authentication Bearer <token> Header. I have obtained an OAuth token from the connection which is used by my MCP Server definition, so I'm not sure what's going on.

 

I do see these errors in the system log

 

*** Script: sn_mcp_client.McpServerDao: Data not found in: sn_mcp_server
*** Script: sn_mcp_client.McpClientServerSessionMappingDao: Data not found in: sn_mcp_client_server_session_mapping
*** Script: sn_mcp_client.MCPConnectionManager: Error sending initialization request: Failed to execute Flow Action {0}, Error: {1}

But the MCP Server connection I am using IS defined in sn_mcp_server, with correct links to all the OAuth authentication records. 

 

Any help much appreciated

Thanks  

1 REPLY 1

Tanushree Maiti
Mega Sage

Have you tried to hit the endpoint using postman to check all integration parameter like url, credential is fine.

 

Check this links, if it helps you.

Solved: MCP Client Plugin not working - ServiceNow Community

Solved: MCP Client Plugin not working - ServiceNow Community

 

 

 

 

Please mark this response as Helpful & accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: