docs / getting-started / first-tool-call
This guide walks through the complete flow from a running server to your first successful tool call.
- Server running locally (
npm run dev) — see Local Development - ServiceNow OAuth app configured — see ServiceNow OAuth Setup
- A ServiceNow user with
snc_platform_rest_api_access
Confirm the server and Redis are healthy:
curl -s http://localhost:8080/health | jqYou should see "status": "healthy" and "redis": "connected".
Configure your MCP client to connect to the server. For Claude Desktop, add to your config:
{
"mcpServers": {
"servicenow": {
"type": "streamablehttp",
"url": "http://localhost:8080/mcp"
}
}
}The MCP client will automatically discover the OAuth endpoints via /.well-known/oauth-authorization-server and handle PKCE-based authentication. When you first connect, the client will redirect you to ServiceNow for login/consent, then exchange tokens automatically.
See Client Configuration for more examples.
Once connected, try a simple read operation:
get_my_profile— returns the authenticated user's ServiceNow profile (no parameters needed)get_my_tasks— returns open tasks assigned to yousearch_incidents— search incidents (try{ "limit": 5 })
If you get an authentication error, ensure your MCP client completed the OAuth flow successfully. Check that the server logs show a successful token exchange.
- Your MCP client discovered OAuth metadata via
/.well-known/oauth-authorization-server - The client registered dynamically and performed PKCE-based authorization
- After ServiceNow login, the client exchanged an authorization code for a bearer token
- The client sent
POST /mcpwithAuthorization: Bearerand aninitializerequest - The server created a new
McpServer+StreamableHTTPServerTransportpair - When you called a tool, the server resolved the bearer token → user → SN OAuth token
- A fresh
ServiceNowClientwas created with your access token - The request was made to ServiceNow's REST API as you
See Session Lifecycle and Request Flow for the full trace.
See also: Tools Overview · OAuth Flow · Troubleshooting