Documentation
¶
Overview ¶
Package config loads and validates runtime configuration for the aws-mcp server from environment variables.
Credentials are NOT read here: aws-mcp uses the standard AWS credential chain (environment, shared config/credentials files, SSO, or an attached IAM role) via aws-sdk-go-v2. This package only carries server behavior plus an optional region override.
Index ¶
Constants ¶
const ( EnvRegion = "AWS_REGION" // optional region override (standard AWS var) EnvToolsets = "AWS_TOOLSETS" // comma-separated toolset names, or "all" EnvReadOnly = "AWS_READONLY" // "true" disables all write tools )
Environment variable names recognised by the server. AWS_REGION is the standard SDK variable and is reused here as the region override.
const EnvFile = ".env"
EnvFile is the default dotenv filename loaded for local development.
Variables ¶
This section is empty.
Functions ¶
func LoadEnvFile ¶
LoadEnvFile loads KEY=VALUE pairs from a dotenv file into the process environment. It is intended for local development: run `cp .env.example .env`, fill it in, and the server picks it up on startup.
Lines may be blank, comments (#...), or KEY=VALUE (an optional leading "export " is ignored, and surrounding single/double quotes are stripped from the value). A variable that already has a non-empty value in the environment is left untouched, so real shell variables take precedence over the file. A missing file is not an error.
Types ¶
type Config ¶
type Config struct {
// Region overrides the credential-chain region when non-empty.
Region string
// Toolsets is the set of enabled toolset names. A nil/empty set means "all".
Toolsets []string
// ReadOnly, when true, suppresses mutating tools at registration time.
ReadOnly bool
}
Config holds validated server configuration.
func Load ¶
Load reads configuration from the process environment. aws-mcp has no required configuration (credentials come from the AWS chain), so Load never fails today; it returns an error for signature parity with the other servers.
func (*Config) AllToolsets ¶
AllToolsets reports whether every toolset should be enabled.
func (*Config) ToolsetEnabled ¶
ToolsetEnabled reports whether the named toolset should be registered.