Skip to content

Commit 672f069

Browse files
authored
Merge pull request #8 from jritsema/add-kiro-support
Add kiro support
2 parents 4b0608f + ad2e77d commit 672f069

6 files changed

Lines changed: 147 additions & 8 deletions

File tree

.kiro/steering/product.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# MCP CLI Product Overview
2+
3+
MCP CLI is a command-line tool for managing Model Context Protocol (MCP) server configurations. It simplifies the pain points of working with MCP by providing a YAML-based configuration approach inspired by Docker Compose.
4+
5+
## Core Problems Solved
6+
7+
- Eliminates manual JSON file editing for MCP configurations
8+
- Manages similar config files across different AI tools (Amazon Q CLI, Claude Desktop, Cursor)
9+
- Handles secret environment variables securely
10+
- Enables experimentation with new MCP servers
11+
- Supports switching between different configurations based on context (programming, writing, research)
12+
13+
## Key Features
14+
15+
- **Profile-based organization**: Group MCP servers by use case using labels
16+
- **Multi-tool support**: Deploy configurations to various AI tools via shortcuts
17+
- **Environment variable expansion**: Secure handling of secrets and dynamic values
18+
- **Container support**: Works with both command-based and Docker image-based MCP servers
19+
- **Default configurations**: Sensible defaults with override capabilities
20+
21+
## Target Users
22+
23+
Developers and AI tool users who work with multiple MCP servers and need efficient configuration management across different AI tools and contexts.

.kiro/steering/structure.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Project Structure & Organization
2+
3+
## Directory Layout
4+
5+
```
6+
mcp/
7+
├── main.go # Application entry point with signal handling
8+
├── cmd/ # CLI command implementations
9+
│ ├── root.go # Root command and global flags
10+
│ ├── types.go # Shared data structures and utilities
11+
│ ├── list.go # List/ls command implementation
12+
│ ├── set.go # Set command implementation
13+
│ ├── clear.go # Clear command implementation
14+
│ └── config.go # Config command implementation
15+
├── go.mod # Go module definition
16+
├── go.sum # Go module checksums
17+
├── Makefile # Build automation
18+
├── mcp-compose.yml # Example MCP server configuration
19+
├── .env # Environment variables (gitignored)
20+
└── app # Built binary output
21+
```
22+
23+
## Command Structure
24+
25+
All CLI commands follow the Cobra pattern:
26+
27+
- Each command is a separate file in `cmd/`
28+
- Commands are registered in their `init()` functions
29+
- Shared functionality lives in `cmd/types.go`
30+
31+
## Configuration Files
32+
33+
### User Configuration Locations
34+
35+
- **Compose file**: `$HOME/.config/mcp/mcp-compose.yml` (default)
36+
- **CLI config**: `$HOME/.config/mcp/config.json`
37+
- **Environment**: `.env` file in same directory as compose file
38+
39+
### Tool-specific Output Locations
40+
41+
- **Amazon Q CLI**: `$HOME/.aws/amazonq/mcp.json`
42+
- **Claude Desktop**: `$HOME/Library/Application Support/Claude/claude_desktop_config.json`
43+
- **Cursor**: `$HOME/.cursor/mcp.json`
44+
45+
## Data Flow
46+
47+
1. Load `mcp-compose.yml` (Docker Compose format)
48+
2. Load environment variables from system + `.env` file
49+
3. Filter services by profile using `mcp.profile` labels
50+
4. Transform to MCP JSON format with environment expansion
51+
5. Write to tool-specific configuration location
52+
53+
## Key Conventions
54+
55+
- **Profile organization**: Use `mcp.profile` labels for grouping servers
56+
- **Environment expansion**: Support `${VAR}` and `$VAR` syntax
57+
- **Default behavior**: Services without profiles are considered "default"
58+
- **Container support**: Services can use `command` or `image` fields
59+
- **Error handling**: Exit with status 1 on errors, write to stderr

.kiro/steering/tech.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Technology Stack & Build System
2+
3+
## Tech Stack
4+
5+
- **Language**: Go 1.24.2
6+
- **CLI Framework**: Cobra (github.com/spf13/cobra v1.9.1)
7+
- **YAML Processing**: gopkg.in/yaml.v3 v3.0.1
8+
- **Build System**: Make + Go toolchain
9+
10+
## Architecture Patterns
11+
12+
- **Command Pattern**: Each CLI command is implemented as a separate Cobra command in the `cmd/` package
13+
- **Configuration as Code**: Uses Docker Compose YAML format for MCP server definitions
14+
- **Environment Variable Expansion**: Supports `${VAR}` and `$VAR` syntax with .env file loading
15+
- **Profile-based Filtering**: Uses Docker Compose labels for organizing servers by use case
16+
17+
## Key Dependencies
18+
19+
```go
20+
require (
21+
github.com/spf13/cobra v1.9.1 // CLI framework
22+
gopkg.in/yaml.v3 v3.0.1 // YAML parsing
23+
)
24+
```
25+
26+
## Common Commands
27+
28+
### Development
29+
30+
```bash
31+
make build # Build binary to ./app
32+
make test # Run unit tests with race detection
33+
make vet # Vet code for issues
34+
make start # Build and run locally
35+
```
36+
37+
### Auto-development
38+
39+
```bash
40+
make autobuild # Auto-rebuild on file changes (requires reflex)
41+
```
42+
43+
### Container Operations
44+
45+
```bash
46+
make dockerbuild # Build Docker image
47+
make deploy # Deploy to cloud dev environment
48+
```
49+
50+
## File Structure Conventions
51+
52+
- `main.go`: Entry point with signal handling
53+
- `cmd/`: All CLI commands and shared types
54+
- `cmd/root.go`: Root command and global flags
55+
- `cmd/types.go`: Shared data structures and utility functions
56+
- Binary output: `./app`

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ MCP CLI is a tool for managing MCP server configuration files.
44

55
## Why?
66

7-
Model Context Protocol (MCP) is a new technology and still evolving. As I've been using it, I have encountered several pain points:
7+
Model Context Protocol (MCP) is a new technology and still evolving. As I've been using it, I have encountered several pain points:
88

99
- Manually editing JSON files
1010
- Managing similar config files for different AI tools
1111
- Dealing with secret envvars
1212
- Experimenting with new MCP servers
1313
- Switching between different configurations based on what I'm doing (e.g., programming, writing, researching)
1414

15-
I decided to write up some specs for a tool (written in Go) that could help with these pain points and try to "vibe code" it. This is the result. Please don't judge the code quality. I didn't write or edit a single line :)
15+
I decided to write up some specs for a tool (written in Go) that could help with these pain points and try to "vibe code" it. This is the result. Please don't judge the code quality. I didn't write or edit a single line :)
1616

1717
## Usage
1818

@@ -88,6 +88,9 @@ mcp set programming -t cursor
8888
# Set a specific server for Claude Desktop
8989
mcp set -t claude-desktop -s github
9090

91+
# Set programming profile servers for Kiro IDE
92+
mcp set programming -t kiro
93+
9194
# Use a custom output location
9295
mcp set -c /path/to/output/mcp.json
9396
```
@@ -111,6 +114,7 @@ MCP CLI supports these predefined tool shortcuts for popular AI tools:
111114
- `q-cli` - Amazon Q CLI (`$HOME/.aws/amazonq/mcp.json`)
112115
- `claude-desktop` - Claude Desktop (`$HOME/Library/Application Support/Claude/claude_desktop_config.json`)
113116
- `cursor` - Cursor IDE (`$HOME/.cursor/mcp.json`)
117+
- `kiro` - Kiro IDE (`$HOME/.kiro/settings/mcp.json`)
114118

115119
### Setting Default AI Tool
116120

@@ -142,7 +146,6 @@ Organize your MCP servers with profiles using the `labels` field in your `mcp-co
142146

143147
```yaml
144148
services:
145-
146149
brave:
147150
image: mcp/brave-search
148151
environment:
@@ -164,7 +167,6 @@ mcp set programming -t claude-desktop
164167

165168
Services without the label are considered defaults.
166169

167-
168170
## How?
169171

170172
It turns out that the Docker Compose (`docker-compose.yml`) specification already has good support for MCP stdio configuration where services map to MCP servers with `command`s, `image`s, `environment`s/`env_files`s, and `label`s for profiles. Another added benefit of this is you can run `docker compose pull -f mcp-compose.yml` and it will pre-fetch all the container images.
@@ -174,7 +176,6 @@ Example:
174176
```yaml
175177
# MCP Servers
176178
services:
177-
178179
time:
179180
command: uvx mcp-server-time
180181

@@ -200,7 +201,6 @@ services:
200201
labels:
201202
mcp.profile: database
202203

203-
204204
# OR container based MCP servers
205205

206206
github-docker:

cmd/clear.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ var clearCmd = &cobra.Command{
4444
func init() {
4545
rootCmd.AddCommand(clearCmd)
4646
clearCmd.Flags().StringVarP(&configFile, "config", "c", "", "Path to write the MCP JSON configuration file")
47-
clearCmd.Flags().StringVarP(&toolShortcut, "tool", "t", "", "Tool shortcut (q-cli, claude-desktop, cursor)")
47+
clearCmd.Flags().StringVarP(&toolShortcut, "tool", "t", "", "Tool shortcut (q-cli, claude-desktop, cursor, kiro)")
4848
}

cmd/set.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var toolShortcuts = map[string]string{
2121
"q-cli": filepath.Join("${HOME}", ".aws", "amazonq", "mcp.json"),
2222
"claude-desktop": filepath.Join("${HOME}", "Library", "Application Support", "Claude", "claude_desktop_config.json"),
2323
"cursor": filepath.Join("${HOME}", ".cursor", "mcp.json"),
24+
"kiro": filepath.Join("${HOME}", ".kiro", "settings", "mcp.json"),
2425
}
2526

2627
// setCmd represents the set command
@@ -84,7 +85,7 @@ If no profile is specified, it uses default servers.`,
8485
func init() {
8586
rootCmd.AddCommand(setCmd)
8687
setCmd.Flags().StringVarP(&configFile, "config", "c", "", "Path to write the MCP JSON configuration file")
87-
setCmd.Flags().StringVarP(&toolShortcut, "tool", "t", "", "Tool shortcut (q-cli, claude-desktop, cursor)")
88+
setCmd.Flags().StringVarP(&toolShortcut, "tool", "t", "", "Tool shortcut (q-cli, claude-desktop, cursor, kiro)")
8889
setCmd.Flags().StringVarP(&singleServer, "server", "s", "", "Specify a single server to include")
8990
}
9091

0 commit comments

Comments
 (0)