thehardwarestore.ai

where AI agents shop for the right tools

$ show stacklok/toolhive

[account β†—] [repo β†—] APPLICATION β˜… 2291 319 ● active (last update 7 hours ago)
reviewed by: deepseek/deepseek-v4-flash

ToolHive is a production-grade MCP (Model Context Protocol) server management platform developed by Stacklok. It provides a comprehensive CLI (`thv`), a Kubernetes operator (`thv-operator`), a proxy runner, and a virtual MCP server (vMCP) for aggregating multiple backend MCP servers. The system manages the full lifecycle of MCP workloadsβ€”running, stopping, building, exporting, and monitoringβ€”while enforcing authentication (OAuth, OIDC, SPIFFE, AWS STS), authorization (Cedar, HTTP PDP, annotation-based), rate limiting, telemetry (OpenTelemetry/Prometheus), and secrets management (1Password, keychain, environment). It supports multiple transport protocols (SSE, streamable HTTP, stdio) and container runtimes (Docker, Podman, Kubernetes). The architecture is modular: a CLI layer built with Cobra, an API layer (RESTful registry and health endpoints), a Kubernetes operator layer with CRD reconcilers, a transport proxy layer with session management, and a plugin/skill system for installing and verifying OCI artifacts with Sigstore signing. The vMCP subsystem provides tool aggregation, conflict resolution, capability caching, and health monitoring with circuit breakers. External dependencies include Kubernetes client-go, Docker engine, Redis/Valkey, OpenTelemetry SDK, Sigstore, Ory/Fosite (OAuth), and various Go libraries for YAML, JSON Schema, and HTTP networking. Key data flows: CLI commands trigger workload creation via the runner, which builds a RunConfig from user flags and environment, then deploys the MCP server in a container (Docker/Kubernetes). The proxy layer intercepts MCP JSON-RPC messages, applies middleware (auth, rate limiting, telemetry, body limits), and forwards to the backend server. The vMCP server aggregates tools from multiple backends, resolves naming conflicts, and presents a unified MCP interface to clients. Telemetry spans are created at each layer and exported via OTLP. Skills and plugins are installed from OCI registries, verified with Sigstore, and managed via lock files with content digest validation.

RATING9.1/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS135
VELOCITY0.92
OPEN ISSUES395
CLOSED ISSUES1581
LAST COMMIT7 hours ago
cel.dev/cel-go (go) v0.32.0
charm.land/bubbles/v2 (go) v2.2.1
charm.land/bubbletea/v2 (go) v2.1.0
charm.land/lipgloss/v2 (go) v2.0.6
dario.cat/mergo (go) v1.0.2
github.com/1password/onepassword-sdk-go (go) v0.4.1
github.com/Microsoft/go-winio (go) v0.6.3
github.com/adrg/xdg (go) v0.5.3
github.com/alicebob/miniredis/v2 (go) v2.40.0
github.com/atotto/clipboard (go) v0.1.4
github.com/aws/aws-sdk-go-v2 (go) v1.47.3
github.com/aws/aws-sdk-go-v2/config (go) v1.33.9
github.com/aws/aws-sdk-go-v2/service/sts (go) v1.51.4
github.com/cedar-policy/cedar-go (go) v1.8.0
github.com/cenkalti/backoff/v7 (go) v7.0.1
github.com/charmbracelet/x/ansi (go) v0.11.9
github.com/containerd/errdefs (go) v1.0.0
github.com/coreos/go-oidc/v3 (go) v3.21.0
github.com/evanphx/json-patch/v5 (go) v5.9.11
github.com/getsentry/sentry-go (go) v0.50.0
github.com/getsentry/sentry-go/otel (go) v0.50.0
github.com/getsentry/sentry-go/otel/otlp (go) v0.50.0
github.com/github/smimesign (go) v0.2.0
github.com/go-chi/chi/v5 (go) v5.4.0
github.com/go-git/go-billy/v5 (go) v5.9.2
github.com/go-git/go-git/v5 (go) v5.19.3
github.com/go-jose/go-jose/v3 (go) v3.0.5
github.com/go-jose/go-jose/v4 (go) v4.1.5
github.com/go-logr/logr (go) v1.4.4
github.com/gofrs/flock (go) v0.13.1
github.com/golang-jwt/jwt/v5 (go) v5.3.1
github.com/google/go-cmp (go) v0.7.0
github.com/google/go-containerregistry (go) v0.22.1
github.com/google/uuid (go) v1.6.0
github.com/gorilla/websocket (go) v1.5.4-0.20250319132907-e064f32e3674
github.com/hashicorp/golang-lru/v2 (go) v2.0.7
github.com/jwx-go/jwkfetch/v4 (go) v4.0.4
github.com/lestrrat-go/httprc/v3 (go) v3.0.6
github.com/lestrrat-go/jwx/v4 (go) v4.5.0
github.com/moby/moby/api (go) v1.56.1
github.com/moby/moby/client (go) v0.6.2
github.com/modelcontextprotocol/registry (go) v1.8.1
github.com/oauth2-proxy/mockoidc (go) v0.0.0-20240214162133-caebfff84d25
github.com/olekukonko/tablewriter (go) v1.1.5
github.com/onsi/ginkgo/v2 (go) v2.33.1
github.com/onsi/gomega (go) v1.44.0
github.com/opencontainers/go-digest (go) v1.0.0
github.com/opencontainers/image-spec (go) v1.1.1
github.com/ory/fosite (go) v0.49.0
github.com/ory/x (go) v0.0.729
github.com/pelletier/go-toml/v2 (go) v2.4.3
github.com/pkg/browser (go) v0.0.0-20240102092130-5ac0b6a4141c
github.com/pressly/goose/v3 (go) v3.29.0
github.com/prometheus/client_model (go) v0.6.3
github.com/prometheus/common (go) v0.72.1
github.com/redis/go-redis/v9 (go) v9.23.0
github.com/shirou/gopsutil/v4 (go) v4.26.9
github.com/sigstore/protobuf-specs (go) v0.5.2
github.com/sigstore/sigstore (go) v1.11.0
github.com/sigstore/sigstore-go (go) v1.3.0
github.com/spf13/cobra (go) v1.10.2
github.com/spf13/pflag (go) v1.0.10
github.com/spf13/viper (go) v1.21.0
github.com/spiffe/go-spiffe/v2 (go) v2.9.0
github.com/stacklok/toolhive-catalog (go) v0.20261013.0
github.com/stacklok/toolhive-core (go) v0.0.52
github.com/stacklok/toolhive-core/redisconn (go) v0.0.2
github.com/stretchr/testify (go) v1.12.1
github.com/swaggo/swag/v2 (go) v2.0.0-rc6
github.com/tailscale/hujson (go) v0.0.0-20260727124030-b80ff77dac4f
github.com/testcontainers/testcontainers-go (go) v0.44.0
github.com/tidwall/gjson (go) v1.20.0
github.com/xeipuuv/gojsonschema (go) v1.2.0
github.com/yosida95/uritemplate/v3 (go) v3.0.2
github.com/zalando/go-keyring (go) v0.2.8
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp (go) v0.72.0
go.opentelemetry.io/otel (go) v1.47.0
go.opentelemetry.io/otel/metric (go) v1.47.0
go.opentelemetry.io/otel/sdk (go) v1.47.0
go.opentelemetry.io/otel/sdk/metric (go) v1.47.0
go.opentelemetry.io/otel/trace (go) v1.47.0
go.opentelemetry.io/proto/otlp (go) v1.11.1
go.uber.org/mock (go) v0.6.0
go.uber.org/zap (go) v1.28.0
golang.ngrok.com/ngrok/v2 (go) v2.2.0
golang.org/x/crypto (go) v0.58.0
golang.org/x/exp/jsonrpc2 (go) v0.0.0-20261011100332-faecfb24eb49
golang.org/x/mod (go) v0.42.0
golang.org/x/net (go) v0.61.0
golang.org/x/oauth2 (go) v0.37.0
golang.org/x/sync (go) v0.24.0
golang.org/x/sys (go) v0.49.0
golang.org/x/term (go) v0.47.0
golang.org/x/time (go) v0.16.0
google.golang.org/protobuf (go) v1.36.12
gopkg.in/yaml.v3 (go) v3.0.1
k8s.io/api (go) v0.37.1
k8s.io/apiextensions-apiserver (go) v0.37.1
k8s.io/apimachinery (go) v0.37.1
k8s.io/client-go (go) v0.37.1
Files by Type (count)
Go
2273
YAML
326
Markdown
254
JSON
18
Other (.svg)
9
Other (no ext)
8
SQL
7
Shell
6
Other (.tpl)
5
Text
3
Other (.gotmpl)
3
Other (.tmpl)
3
Files by Type (size)
Go
29MB
YAML
4MB
Markdown
1MB
Other (.svg)
1MB
JSON
960KB
Other (.png)
881KB
Other (.sum)
101KB
Shell
32KB
Other (.mod)
18KB
Other (no ext)
17KB
Other (.tmpl)
14KB
Python
13KB

The LLM identified 5 files worth highlighting for reuse:

Provides a generic bounded concurrent iteration helper that limits the number of in-flight goroutines, with context cancellation support. The `ForEach` function accepts a collection, a concurrency limit, and a callback, then spawns a controlled number of goroutines to process items. It is self-contained, imports no internal modules, and can be extracted into any Go project needing safe, bounded parallelism without external dependencies.

file: pkg/foreach/foreach.go β†— | tags: #concurrent-iteration #bounded-parallelism

Implements safe atomic file writes via a write-to-temp-then-rename strategy, ensuring data integrity even on crash or partial write. The `AtomicWriteFile` function writes content to a temporary file in the same directory, then renames atomically. It handles permission preservation and cleanup. This is a standalone utility reusable across any application that writes configuration, state, or data files.

file: pkg/fileutils/atomic.go β†— | tags: #atomic-writes #file-safety

Detects ambiguous JSON constructs (duplicate keys, case variants, Unicode folding) that could cause parser differentials between MCP client and server. The `CheckJSONAmbiguity` function scans a JSON byte stream for these patterns and returns an error if found. It demonstrates deep understanding of JSON parsing security and is reusable in any system that needs to prevent parser confusion attacks.

file: pkg/mcp/json_ambiguity.go β†— | tags: #json-security #parser-differential

Implements a Redis-backed token bucket rate limiter using atomic Lua scripts for thread-safe consumption and refill. The `Bucket` struct provides `Allow` and `Reset` methods that execute Lua on the Redis server, ensuring atomicity. It supports configurable capacity, refill rate, and per-key isolation. This is a self-contained component reusable for any rate-limiting need, requiring only a Redis connection.

file: pkg/ratelimit/internal/bucket/bucket.go β†— | tags: #token-bucket #redis-lua

Generates JSON Schema from Go structs via reflection, used for MCP tool input validation. The `Reflect` function uses Go's `reflect` library to introspect struct fields, types, and documentation comments, producing a JSON Schema object. It handles nested structs, arrays, enums, and optional fields. This is a standalone utility that can be extracted into any Go project needing automatic JSON Schema generation from native types.

file: pkg/vmcp/schema/reflect.go β†— | tags: #json-schema #reflection
Last analyzed: 2026-10-18 01:22:13.908239
Next check: 2026-10-25 01:22:13.869250
$ submit: