Skip to content

Redis-backed storage in the embedded authorization server#35

Merged
tgrunnagle merged 12 commits intomainfrom
auth-server-redis_2026-02-02
Feb 5, 2026
Merged

Redis-backed storage in the embedded authorization server#35
tgrunnagle merged 12 commits intomainfrom
auth-server-redis_2026-02-02

Conversation

@tgrunnagle
Copy link
Contributor

@tgrunnagle tgrunnagle commented Feb 2, 2026

Summary

Add RFC for Redis-backed storage in the embedded authorization server to enable horizontal scaling and high-availability deployments.

Addresses a portion of https://github.com/stacklok/stacklok-epics/issues/197

Why

The current in-memory storage prevents running multiple ToolHive replicas since they cannot share authentication state. Production Kubernetes deployments need HA support.

What

This RFC proposes a RedisStorage implementation that:

  • Implements the existing Storage interface with Redis as the backend
  • Supports standalone, Sentinel, and Cluster deployment modes
  • Uses key partitioning for multi-tenancy
  • Remains fully backward compatible (memory storage stays the default)

@tgrunnagle tgrunnagle marked this pull request as ready for review February 2, 2026 23:49
Copy link
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments inline, but I feel like I'm too much of a redis n00b to be able to review the deployment options properly

@JAORMX
Copy link
Contributor

JAORMX commented Feb 3, 2026

I'm thinking that having a model of one MCP server per Valkey/Redis deployment is ideal for us. This way, you don't need to deal with multi-tenancy, nor scaling the valkey deployment globally. Instead, the valkey deployment can scale as the MCP server traffic increases. I'd also suggest doing something very opinionated to begin with, e.g. having one way of authenticating and one way to operate. This way, the deployment is heavily targeted towards the use case(s) instead of needing to provide a lot of flexibility. We can provide flexible alternatives as we see fit. wdyt?

@JAORMX
Copy link
Contributor

JAORMX commented Feb 3, 2026

e.g. my recommendation would be to go sentinel mode, and have one primary and two replicas for seamless(-ish) rollovers.

@tgrunnagle tgrunnagle requested review from JAORMX and jhrozek February 3, 2026 18:54
jhrozek
jhrozek previously approved these changes Feb 4, 2026
@tgrunnagle tgrunnagle merged commit a27a196 into main Feb 5, 2026
1 check passed
@tgrunnagle tgrunnagle deleted the auth-server-redis_2026-02-02 branch February 5, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants