@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
32 lines (31 loc) • 1.41 kB
TypeScript
import { ControllerResponse } from '../types/common.types.js';
import { ExecCommandToolArgsType } from '../tools/aws.sso.types.js';
/**
* Execute an AWS CLI command with temporary credentials from SSO
*
* Gets temporary AWS credentials for the specified account and role via SSO,
* then executes the AWS CLI command with those credentials in the environment.
* Handles authentication verification, command execution, and result formatting.
*
* @async
* @param {ExecCommandToolArgsType} options - Command execution options
* @param {string} options.accountId - AWS account ID to get credentials for
* @param {string} options.roleName - AWS role name to assume via SSO
* @param {string} [options.region] - AWS region to use for the command (optional)
* @param {string} options.command - AWS CLI command to execute as string
* @returns {Promise<ControllerResponse>} - Formatted command execution result
* @throws {Error} If authentication fails, command execution fails, or parameters are invalid
* @example
* // Execute an S3 list command
* const result = await executeCommand({
* accountId: "123456789012",
* roleName: "AdminAccess",
* region: "us-east-1",
* command: "aws s3 ls"
* });
*/
declare function executeCommand(options: ExecCommandToolArgsType): Promise<ControllerResponse>;
declare const _default: {
executeCommand: typeof executeCommand;
};
export default _default;