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

522 lines (521 loc) 13.2 kB
import { z } from 'zod'; /** * AWS SSO type definitions */ /** * Zod schema for AWS SSO configuration */ export declare const AwsSsoConfigSchema: z.ZodObject<{ /** * The SSO start URL */ startUrl: z.ZodString; /** * The AWS region */ region: z.ZodString; }, "strip", z.ZodTypeAny, { region: string; startUrl: string; }, { region: string; startUrl: string; }>; /** * AWS SSO configuration type inferred from Zod schema */ export type AwsSsoConfig = z.infer<typeof AwsSsoConfigSchema>; /** * Zod schema for SSO token data */ export declare const SsoTokenSchema: z.ZodObject<{ /** * The access token for SSO */ accessToken: z.ZodString; /** * The expiration time in seconds */ expiresIn: z.ZodNumber; /** * The refresh token for SSO */ refreshToken: z.ZodDefault<z.ZodOptional<z.ZodString>>; /** * The token type */ tokenType: z.ZodString; /** * The time the token was retrieved */ retrievedAt: z.ZodNumber; /** * The time the token expires */ expiresAt: z.ZodNumber; /** * The AWS region for the token */ region: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { accessToken: string; expiresIn: number; refreshToken: string; tokenType: string; retrievedAt: number; expiresAt: number; region?: string | undefined; }, { accessToken: string; expiresIn: number; tokenType: string; retrievedAt: number; expiresAt: number; region?: string | undefined; refreshToken?: string | undefined; }>; /** * SSO token data type inferred from Zod schema */ export type SsoToken = z.infer<typeof SsoTokenSchema>; /** * Zod schema for AWS SSO auth result */ export declare const AwsSsoAuthResultSchema: z.ZodObject<{ /** * The access token for SSO */ accessToken: z.ZodString; /** * The time the token expires (seconds since epoch) */ expiresAt: z.ZodNumber; /** * The refresh token (if available) */ refreshToken: z.ZodOptional<z.ZodNullable<z.ZodString>>; /** * The token expiration time in seconds */ expiresIn: z.ZodOptional<z.ZodNumber>; /** * The AWS region for the token */ region: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { accessToken: string; expiresAt: number; region?: string | undefined; expiresIn?: number | undefined; refreshToken?: string | null | undefined; }, { accessToken: string; expiresAt: number; region?: string | undefined; expiresIn?: number | undefined; refreshToken?: string | null | undefined; }>; /** * AWS SSO auth result type inferred from Zod schema */ export type AwsSsoAuthResult = z.infer<typeof AwsSsoAuthResultSchema>; /** * Zod schema for AWS SSO Role */ export declare const AwsSsoRoleSchema: z.ZodObject<{ /** * The name of the role */ roleName: z.ZodString; /** * The ARN of the role */ roleArn: z.ZodString; /** * The account ID the role belongs to */ accountId: z.ZodString; }, "strip", z.ZodTypeAny, { accountId: string; roleName: string; roleArn: string; }, { accountId: string; roleName: string; roleArn: string; }>; /** * AWS SSO Role type inferred from Zod schema */ export type AwsSsoRole = z.infer<typeof AwsSsoRoleSchema>; /** * Zod schema for AWS SSO Account with roles */ export declare const AwsSsoAccountWithRolesSchema: z.ZodObject<{ /** * The account ID */ accountId: z.ZodString; /** * The account name */ accountName: z.ZodString; /** * The account email */ accountEmail: z.ZodOptional<z.ZodString>; } & { /** * The roles in the account */ roles: z.ZodArray<z.ZodObject<{ /** * The name of the role */ roleName: z.ZodString; /** * The ARN of the role */ roleArn: z.ZodString; /** * The account ID the role belongs to */ accountId: z.ZodString; }, "strip", z.ZodTypeAny, { accountId: string; roleName: string; roleArn: string; }, { accountId: string; roleName: string; roleArn: string; }>, "many">; }, "strip", z.ZodTypeAny, { accountId: string; accountName: string; roles: { accountId: string; roleName: string; roleArn: string; }[]; accountEmail?: string | undefined; }, { accountId: string; accountName: string; roles: { accountId: string; roleName: string; roleArn: string; }[]; accountEmail?: string | undefined; }>; /** * AWS SSO Account with roles type inferred from Zod schema */ export type AwsSsoAccountWithRoles = z.infer<typeof AwsSsoAccountWithRolesSchema>; /** * Zod schema for AWS credentials */ export declare const AwsCredentialsSchema: z.ZodObject<{ /** * The access key ID */ accessKeyId: z.ZodString; /** * The secret access key */ secretAccessKey: z.ZodString; /** * The session token */ sessionToken: z.ZodString; /** * The expiration time */ expiration: z.ZodUnion<[z.ZodDate, z.ZodEffects<z.ZodNumber, Date, number>, z.ZodEffects<z.ZodString, Date, string>]>; /** * Optional region override */ region: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { accessKeyId: string; secretAccessKey: string; sessionToken: string; expiration: Date; region?: string | undefined; }, { accessKeyId: string; secretAccessKey: string; sessionToken: string; expiration: string | number | Date; region?: string | undefined; }>; /** * AWS credentials type inferred from Zod schema */ export type AwsCredentials = z.infer<typeof AwsCredentialsSchema>; /** * Zod schema for parameters for getting AWS credentials */ export declare const GetCredentialsParamsSchema: z.ZodObject<{ /** * The account ID to get credentials for */ accountId: z.ZodString; /** * The role name to assume */ roleName: z.ZodString; /** * Optional region override */ region: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { accountId: string; roleName: string; region?: string | undefined; }, { accountId: string; roleName: string; region?: string | undefined; }>; /** * Parameters for getting AWS credentials type inferred from Zod schema */ export type GetCredentialsParams = z.infer<typeof GetCredentialsParamsSchema>; /** * Zod schema for parameters for listing AWS SSO accounts */ export declare const ListAccountsParamsSchema: z.ZodObject<{ /** * Optional maximum number of accounts to return */ maxResults: z.ZodOptional<z.ZodNumber>; /** * Optional pagination token */ nextToken: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { maxResults?: number | undefined; nextToken?: string | undefined; }, { maxResults?: number | undefined; nextToken?: string | undefined; }>; /** * Parameters for listing AWS SSO accounts type inferred from Zod schema */ export type ListAccountsParams = z.infer<typeof ListAccountsParamsSchema>; /** * Zod schema for response for listing AWS SSO accounts */ export declare const ListAccountsResponseSchema: z.ZodObject<{ /** * The accounts returned */ accountList: z.ZodArray<z.ZodObject<{ /** * The account ID */ accountId: z.ZodOptional<z.ZodString>; /** * The account name */ accountName: z.ZodOptional<z.ZodString>; /** * The account email */ emailAddress: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { accountId?: string | undefined; accountName?: string | undefined; emailAddress?: string | undefined; }, { accountId?: string | undefined; accountName?: string | undefined; emailAddress?: string | undefined; }>, "many">; /** * Token for paginated results, if more are available */ nextToken: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { accountList: { accountId?: string | undefined; accountName?: string | undefined; emailAddress?: string | undefined; }[]; nextToken?: string | undefined; }, { accountList: { accountId?: string | undefined; accountName?: string | undefined; emailAddress?: string | undefined; }[]; nextToken?: string | undefined; }>; /** * Response for listing AWS SSO accounts type inferred from Zod schema */ export type ListAccountsResponse = z.infer<typeof ListAccountsResponseSchema>; /** * Zod schema for parameters for listing account roles */ export declare const ListAccountRolesParamsSchema: z.ZodObject<{ /** * The account ID to list roles for */ accountId: z.ZodString; /** * Optional maximum number of roles to return */ maxResults: z.ZodOptional<z.ZodNumber>; /** * Optional pagination token */ nextToken: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { accountId: string; maxResults?: number | undefined; nextToken?: string | undefined; }, { accountId: string; maxResults?: number | undefined; nextToken?: string | undefined; }>; /** * Parameters for listing account roles type inferred from Zod schema */ export type ListAccountRolesParams = z.infer<typeof ListAccountRolesParamsSchema>; /** * Zod schema for role information from AWS SSO API */ export declare const RoleInfoSchema: z.ZodObject<{ /** * The name of the role */ roleName: z.ZodOptional<z.ZodString>; /** * The ARN of the role (might not be present in all responses) */ roleArn: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { roleName?: string | undefined; roleArn?: string | undefined; }, { roleName?: string | undefined; roleArn?: string | undefined; }>; /** * Role information from AWS SSO API type inferred from Zod schema */ export type RoleInfo = z.infer<typeof RoleInfoSchema>; /** * Zod schema for response for listing account roles */ export declare const ListAccountRolesResponseSchema: z.ZodObject<{ /** * The roles returned */ roleList: z.ZodArray<z.ZodObject<{ /** * The name of the role */ roleName: z.ZodOptional<z.ZodString>; /** * The ARN of the role (might not be present in all responses) */ roleArn: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { roleName?: string | undefined; roleArn?: string | undefined; }, { roleName?: string | undefined; roleArn?: string | undefined; }>, "many">; /** * Token for paginated results, if more are available */ nextToken: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { roleList: { roleName?: string | undefined; roleArn?: string | undefined; }[]; nextToken?: string | undefined; }, { roleList: { roleName?: string | undefined; roleArn?: string | undefined; }[]; nextToken?: string | undefined; }>; /** * Response for listing account roles type inferred from Zod schema */ export type ListAccountRolesResponse = z.infer<typeof ListAccountRolesResponseSchema>; /** * Zod schema for device authorization information */ export declare const DeviceAuthorizationInfoSchema: z.ZodObject<{ /** * The client ID for SSO */ clientId: z.ZodString; /** * The client secret for SSO */ clientSecret: z.ZodString; /** * The device code for SSO */ deviceCode: z.ZodString; /** * The verification URI */ verificationUri: z.ZodOptional<z.ZodString>; /** * The complete verification URI including user code */ verificationUriComplete: z.ZodOptional<z.ZodString>; /** * The user code */ userCode: z.ZodOptional<z.ZodString>; /** * The expiration time in seconds */ expiresIn: z.ZodNumber; /** * The polling interval in seconds */ interval: z.ZodOptional<z.ZodNumber>; /** * The AWS region for SSO */ region: z.ZodString; }, "strip", z.ZodTypeAny, { region: string; expiresIn: number; clientId: string; clientSecret: string; deviceCode: string; verificationUri?: string | undefined; verificationUriComplete?: string | undefined; userCode?: string | undefined; interval?: number | undefined; }, { region: string; expiresIn: number; clientId: string; clientSecret: string; deviceCode: string; verificationUri?: string | undefined; verificationUriComplete?: string | undefined; userCode?: string | undefined; interval?: number | undefined; }>; /** * Device authorization information type inferred from Zod schema */ export type DeviceAuthorizationInfo = z.infer<typeof DeviceAuthorizationInfoSchema>;