mcp-auth-proxy

command
v0.8.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command mcp-auth-proxy fronts an OAuth-protected MCP server with an unauthenticated loopback endpoint, so a tool that cannot send a bearer token (the conformance runner) can grade the server behind it.

go run ./cmd/mcp-auth-proxy -server https://metronome-mcp.fly.dev/mcp -addr 127.0.0.1:18201

Tokens come from auth.OAuthTokenSource, which runs the MCP authorization flow on oneauth's client primitives: protected-resource and AS discovery, dynamic client registration (RegisterClient), and the authorization-code grant with PKCE (LoginWithBrowser). LoginWithBrowser hands the authorization URL to an OpenBrowser hook. With -headless (the default) that hook is oneauth's ApproveConsent, which plays the user clicking Approve on a demo consent page (metronome's); with -headless=false it opens a real browser, which a real login page needs.

A 401 from the server triggers a fresh registration and login before the request is retried once. That covers a server that restarted and forgot its clients, not only an expired token.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL