SmitSPawar/servicenow-mcp-server-azure-ai-foundry
If you are the rightful owner of servicenow-mcp-server-azure-ai-foundry and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This project implements a Model Context Protocol (MCP) server for ServiceNow, designed to run on Azure Functions, enabling secure interaction with ServiceNow data using natural language.
ServiceNow MCP Server for Azure AI Foundry
This project implements a Model Context Protocol (MCP) server for ServiceNow, designed to run on Azure Functions. It enables Azure AI Foundry agents (and other MCP clients) to securely interact with ServiceNow data using natural language.
Features
- MCP Compliant: Implements the Model Context Protocol (JSON-RPC 2.0 & SSE).
- Serverless: Runs on Azure Functions (Python) for scalability and cost-efficiency.
- Secure Authentication: Uses OAuth 2.0 (Password Credentials Grant) to authenticate with ServiceNow.
- Tools Included:
search_incidents: Query incidents using ServiceNow encoded query strings.search_change_requests: Query change requests.
Prerequisites
- Azure Subscription: To deploy the Function App.
- ServiceNow Instance: A developer or enterprise instance.
- ServiceNow OAuth Client: You must register an endpoint in ServiceNow to get a Client ID and Secret.
- Azure CLI & Azure Functions Core Tools: For deployment.
Setup & Deployment
1. Clone & Initialize
git clone https://github.com/SmitSPawar/servicenow-mcp-server.git
cd servicenow-mcp-server
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
2. Configure ServiceNow OAuth
- In ServiceNow, go to System OAuth > Application Registry.
- Create a new Create an endpoint for external clients.
- Note the Client ID and Client Secret.
3. Deploy to Azure
az login
func azure functionapp publish <YOUR_FUNCTION_APP_NAME>
4. Configure Environment Variables
In the Azure Portal, navigate to your Function App > Settings > Environment Variables and set:
SERVICENOW_INSTANCE_URL:https://<instance>.service-now.comSERVICENOW_USERNAME: Service account username.SERVICENOW_PASSWORD: Service account password.SERVICENOW_CLIENT_ID: From Step 2.SERVICENOW_CLIENT_SECRET: From Step 2.
Integration with Azure AI Foundry
- Go to Azure AI Foundry > Agents.
- Add a Function tool.
- Set the MCP Endpoint:
https://<YOUR_APP>.azurewebsites.net/api/mcp. - The agent can now answer questions like:
"Show me the latest critical incidents." "Find change requests assigned to the database team."
Troubleshooting
- 401 Unauthorized: Check your Client ID, Secret, and User credentials. Ensure the user has API access roles (e.g.,
snc_platform_rest_api_access). - MFA Errors: Use a service account that does not have MFA enabled.
License
MIT