diff --git a/kiro-cli/README.md b/kiro-cli/README.md new file mode 100644 index 0000000..cc4af03 --- /dev/null +++ b/kiro-cli/README.md @@ -0,0 +1,37 @@ +# Kiro CLI Integration + +This directory contains configuration for integrating AnviLLM with Kiro CLI. + +## Installation + +### MCP Server + +Install the AnviLLM MCP server to enable agent communication tools: + +```bash +./kiro-cli/install-mcp.sh +``` + +This configures the `anvilmcp` MCP server in `~/.kiro/settings/cli.json`, providing tools: +- `read_inbox` - Read messages from agent's inbox +- `send_message` - Send messages to other agents or user +- `list_sessions` - List all active sessions +- `set_state` - Set agent state (idle, running, etc.) + +### Agent Configuration + +The agent configuration is in `./kiro-cli/agent/anvillm-agent.json` and includes hooks that: +- Set agent state to `running` when prompts are submitted +- Set agent state to `idle` when stopped + +To use this agent configuration, copy it to your Kiro agents directory: + +```bash +cp ./kiro-cli/agent/anvillm-agent.json ~/.kiro/agents/ +``` + +## Requirements + +- `anvilmcp` binary must be in PATH (built from `cmd/anvilmcp`) +- `anvilsrv` daemon must be running +- `jq` for installation scripts diff --git a/kiro-cli/install-mcp.sh b/kiro-cli/install-mcp.sh new file mode 100755 index 0000000..ad64f62 --- /dev/null +++ b/kiro-cli/install-mcp.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +SETTINGS_FILE="$HOME/.kiro/settings/cli.json" +MCP_CONFIG='{ + "mcpServers": { + "anvilmcp": { + "command": "anvilmcp", + "args": [] + } + } +}' + +if ! command -v jq &> /dev/null; then + echo "Error: jq is required but not installed. Please install jq first." >&2 + exit 1 +fi + +mkdir -p "$HOME/.kiro/settings" + +if [ -f "$SETTINGS_FILE" ]; then + # Merge with existing settings + jq -s '.[0] * .[1]' "$SETTINGS_FILE" <(echo "$MCP_CONFIG") > "$SETTINGS_FILE.tmp" + mv "$SETTINGS_FILE.tmp" "$SETTINGS_FILE" +else + # Create new settings file + echo "$MCP_CONFIG" | jq '.' > "$SETTINGS_FILE" +fi + +echo "AnviLLM MCP server configured in $SETTINGS_FILE" diff --git a/kiro-cli/mcp/anvilmcp.json b/kiro-cli/mcp/anvilmcp.json new file mode 100644 index 0000000..397c253 --- /dev/null +++ b/kiro-cli/mcp/anvilmcp.json @@ -0,0 +1,8 @@ +{ + "mcpServers": { + "anvilmcp": { + "command": "anvilmcp", + "args": [] + } + } +}