kiro

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 4 Imported by: 0

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

View Source
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

func ReadUserConfig() (*core.Config, error)

ReadUserConfig reads the user-level ~/.kiro/settings/mcp.json.

func ReadWorkspaceConfig

func ReadWorkspaceConfig() (*core.Config, error)

ReadWorkspaceConfig reads the workspace-level .kiro/settings/mcp.json.

func UserConfigPath

func UserConfigPath() (string, error)

UserConfigPath returns the user-level config path.

func WorkspaceConfigPath

func WorkspaceConfigPath(projectRoot string) string

WorkspaceConfigPath returns the workspace config path for a given project root.

func WriteUserConfig

func WriteUserConfig(cfg *core.Config) error

WriteUserConfig writes to the user-level ~/.kiro/settings/mcp.json.

func WriteWorkspaceConfig

func WriteWorkspaceConfig(cfg *core.Config) error

WriteWorkspaceConfig writes to the workspace-level .kiro/settings/mcp.json.

Types

type Adapter

type Adapter struct{}

Adapter implements core.Adapter for Kiro.

func NewAdapter

func NewAdapter() *Adapter

NewAdapter creates a new Kiro adapter.

func (*Adapter) DefaultPaths

func (a *Adapter) DefaultPaths() []string

DefaultPaths returns the default config file paths for Kiro.

func (*Adapter) FromCore

func (a *Adapter) FromCore(cfg *core.Config) *Config

FromCore converts canonical config to Kiro format.

func (*Adapter) Marshal

func (a *Adapter) Marshal(cfg *core.Config) ([]byte, error)

Marshal converts canonical config to Kiro format.

func (*Adapter) Name

func (a *Adapter) Name() string

Name returns the adapter name.

func (*Adapter) Parse

func (a *Adapter) Parse(data []byte) (*core.Config, error)

Parse parses Kiro config data into the canonical format.

func (*Adapter) ReadFile

func (a *Adapter) ReadFile(path string) (*core.Config, error)

ReadFile reads a Kiro config file.

func (*Adapter) ToCore

func (a *Adapter) ToCore(kiroCfg *Config) *core.Config

ToCore converts Kiro config to canonical format.

func (*Adapter) WriteFile

func (a *Adapter) WriteFile(cfg *core.Config, path string) error

WriteFile writes canonical config to a Kiro format file.

type Config

type Config struct {
	MCPServers map[string]ServerConfig `json:"mcpServers"`
}

Config represents the Kiro MCP configuration file.

func NewConfig

func NewConfig() *Config

NewConfig creates a new Kiro config.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL