feat: Add Tailscale authentication middleware#90
Merged
Conversation
Port TailscaleAuthMiddleware from claude-event-bus for consistent security across MCP servers in multi-machine setups. Changes: - Add TailscaleAuthMiddleware class to server.py - Update create_app() to wrap app with auth middleware - Add pytest_configure hook to disable auth in tests - Add middleware tests (with/without header, non-HTTP passthrough) Configuration: - Auth enabled by default (requires tailscale serve proxy) - Set SESSION_ANALYTICS_AUTH_DISABLED=1 to disable for local dev Next steps: - Run `tailscale serve --bg 8081` on server - Update client MCP configs to use HTTPS URL Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code ReviewSummaryThis PR adds Tailscale authentication middleware to protect the MCP server when exposed over the network. Requests must include the Issues FoundCriticalNone ImportantNone SuggestionsNone VerdictAPPROVE - Clean implementation that follows the established pattern from claude-event-bus. The middleware correctly handles HTTP vs non-HTTP scopes, tests cover the key paths (authenticated, unauthenticated, passthrough), and the Automated review by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port
TailscaleAuthMiddlewarefrom claude-event-bus for consistent security across MCP servers in multi-machine setups.Changes
TailscaleAuthMiddlewareclass toserver.pycreate_app()to wrap app with auth middlewarepytest_configurehook to disable auth in testsConfiguration
tailscale serveproxy)SESSION_ANALYTICS_AUTH_DISABLED=1to disable for local dev/testingTest plan
make checkpasses (384 tests)tailscale serve --bg 8081on serverNext steps (after merge)
tailscale serve --bg 8081on speck-vmhttps://speck-vm.tailac7b3c.ts.net:8081/mcpCloses #89
🤖 Generated with Claude Code