UNPKG

@aashari/mcp-server-aws-sso

Version:

Node.js/TypeScript MCP server for AWS Single Sign-On (SSO). Enables AI systems (LLMs) with tools to initiate SSO login (device auth flow), list accounts/roles, and securely execute AWS CLI commands using temporary credentials. Streamlines AI interaction w

33 lines (32 loc) 1.39 kB
/** * Interface for HTTP request options */ export interface RequestOptions { method?: 'GET' | 'POST' | 'PUT' | 'DELETE'; headers?: Record<string, string>; body?: unknown; } /** * Generic and reusable function to fetch data from any API endpoint. * Handles standard HTTP request setup, response checking, basic error handling, and logging. * * @param url The full URL to fetch data from. * @param options Request options including method, headers, and body. * @returns The response data parsed as type T. * @throws {McpError} If the request fails, including network errors, non-OK HTTP status, or JSON parsing issues. */ export declare function fetchApi<T>(url: string, options?: RequestOptions): Promise<T>; /** * Convenience function to make a POST request using fetchApi * @param url The URL to send the POST request to * @param data The data to include in the request body * @returns The response data parsed as type T */ export declare function post<T>(url: string, data: Record<string, unknown>): Promise<T>; /** * Constructs a fully qualified AWS SSO OIDC endpoint URL * @param region The AWS region (e.g., 'us-east-1') * @param apiPath The API path (e.g., '/client/register', '/device_authorization', '/token') * @returns The fully constructed endpoint URL */ export declare function getSsoOidcEndpoint(region: string, apiPath: string): string;