Documentation
¶
Overview ¶
Package kiro provides an adapter for AWS Kiro CLI MCP configuration.
Kiro uses a format similar to Claude, with mcpServers as the root key. It supports both local (stdio) and remote (HTTP/SSE) servers.
Key features:
- Environment variable substitution using ${ENV_VAR} syntax
- disabled field to disable servers without removing them
- Remote MCP with headers for authentication
File locations:
- Workspace: <project>/.kiro/settings/mcp.json
- User: ~/.kiro/settings/mcp.json
Index ¶
- Constants
- func ReadUserConfig() (*core.Config, error)
- func ReadWorkspaceConfig() (*core.Config, error)
- func UserConfigPath() (string, error)
- func WorkspaceConfigPath(projectRoot string) string
- func WriteUserConfig(cfg *core.Config) error
- func WriteWorkspaceConfig(cfg *core.Config) error
- type Adapter
- func (a *Adapter) DefaultPaths() []string
- func (a *Adapter) FromCore(cfg *core.Config) *Config
- func (a *Adapter) Marshal(cfg *core.Config) ([]byte, error)
- func (a *Adapter) Name() string
- func (a *Adapter) Parse(data []byte) (*core.Config, error)
- func (a *Adapter) ReadFile(path string) (*core.Config, error)
- func (a *Adapter) ToCore(kiroCfg *Config) *core.Config
- func (a *Adapter) WriteFile(cfg *core.Config, path string) error
- type Config
- type ServerConfig
Constants ¶
const ( // AdapterName is the identifier for this adapter. AdapterName = "kiro" // SettingsDir is the settings directory name. SettingsDir = "settings" // ConfigFileName is the MCP config file name. ConfigFileName = "mcp.json" // ProjectConfigDir is the project config directory. ProjectConfigDir = ".kiro" )
Variables ¶
This section is empty.
Functions ¶
func ReadUserConfig ¶
ReadUserConfig reads the user-level ~/.kiro/settings/mcp.json.
func ReadWorkspaceConfig ¶
ReadWorkspaceConfig reads the workspace-level .kiro/settings/mcp.json.
func UserConfigPath ¶
UserConfigPath returns the user-level config path.
func WorkspaceConfigPath ¶
WorkspaceConfigPath returns the workspace config path for a given project root.
func WriteUserConfig ¶
WriteUserConfig writes to the user-level ~/.kiro/settings/mcp.json.
func WriteWorkspaceConfig ¶
WriteWorkspaceConfig writes to the workspace-level .kiro/settings/mcp.json.
Types ¶
type Adapter ¶
type Adapter struct{}
Adapter implements core.Adapter for Kiro.
func (*Adapter) DefaultPaths ¶
DefaultPaths returns the default config file paths for Kiro.
type Config ¶
type Config struct {
MCPServers map[string]ServerConfig `json:"mcpServers"`
}
Config represents the Kiro MCP configuration file.
type ServerConfig ¶
type ServerConfig struct {
// Command is the executable to launch for stdio servers.
Command string `json:"command,omitempty"`
// Args are the command-line arguments passed to the command.
Args []string `json:"args,omitempty"`
// Env contains environment variables for the server process.
// Values can use ${ENV_VAR} syntax for substitution.
Env map[string]string `json:"env,omitempty"`
// URL is the endpoint for remote HTTP/SSE servers.
URL string `json:"url,omitempty"`
// Headers contains HTTP headers for authentication or configuration.
// Values can use ${ENV_VAR} syntax for secrets.
Headers map[string]string `json:"headers,omitempty"`
// Disabled indicates whether the server is disabled.
Disabled bool `json:"disabled,omitempty"`
}
ServerConfig represents a Kiro MCP server configuration.