feat(mcp): add LUNE_ACCESS_TOKEN env var fallback

Amolith created

Enables MCP server to run in containerized environments (e.g., Home
Assistant addons) where system keyrings aren't available.

Keyring errors are now silently ignored, falling back to the
LUNE_ACCESS_TOKEN environment variable.

Assisted-by: Claude Opus 4.5 via Crush <crush@charm.land>

Change summary

cmd/mcp/mcp.go | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Detailed changes

cmd/mcp/mcp.go 🔗

@@ -8,6 +8,7 @@ package mcp
 import (
 	"errors"
 	"fmt"
+	"os"
 
 	"git.secluded.site/lune/internal/client"
 	"git.secluded.site/lune/internal/config"
@@ -87,9 +88,10 @@ func runMCP(cmd *cobra.Command, _ []string) error {
 		return err
 	}
 
-	token, err := client.GetToken()
-	if err != nil {
-		return fmt.Errorf("getting access token: %w", err)
+	// Try keyring first, fall back to env var if keyring fails or is empty
+	token, _ := client.GetToken() // ignore keyring errors (e.g., no dbus in containers)
+	if token == "" {
+		token = os.Getenv("LUNE_ACCESS_TOKEN")
 	}
 
 	if token == "" {