UNPKG

@mseep/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.43 kB
import { ControllerResponse } from '../types/common.types.js'; import { ExecuteCommandOptions } from './aws.sso.exec.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 {ExecuteCommandOptions} 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 array of strings * @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 executeAwsCommand({ * accountId: "123456789012", * roleName: "AdminAccess", * region: "us-east-1", * command: ["aws", "s3", "ls"] * }); */ declare function executeAwsCommand(options: ExecuteCommandOptions): Promise<ControllerResponse>; declare const _default: { executeCommand: typeof executeAwsCommand; }; export default _default;