Skip to main content
Glama

Dynatrace MCP Server

Official
dynatrace-oauth-base.ts1.15 kB
import { OAuthTokenResponse, OAuthTokenParams } from './types'; /** * Generic OAuth token request function that can handle different grant types * @param ssoBaseURL - SSO Base URL (e.g., sso.dynatrace.com) * @param params - OAuth parameters for the specific grant type (client_credentials, authorization_code, or refresh_token) * @returns Response of the OAuth Endpoint */ export const requestOAuthToken = async (ssoBaseURL: string, params: OAuthTokenParams): Promise<OAuthTokenResponse> => { const tokenUrl = new URL('/sso/oauth2/token', ssoBaseURL).toString(); const res = await fetch(tokenUrl, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: new URLSearchParams(params), }); // check if the response was okay (HTTP 2xx) or not (HTTP 4xx or 5xx) if (!res.ok) { // log the error console.error(`Failed to fetch token: ${res.status} ${res.statusText}`); // Note: Do not throw here, as we want to return the error response from the OAuth endpoint } // and return the JSON result, as it contains additional information return await res.json(); };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dynatrace-oss/dynatrace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server