eai-oauth-proxy
Local client for apps behind oauth2-proxy. The credential is the _oauth2_proxy session cookie. The default browser signs you in; this process reads that cookie and sends it as Cookie.
Install
uv tool install eai-oauth-proxy
Login
eai-oauth-proxy login https://testymctestface.staging.extensile.store/
Writes ~/.config/eai-oauth-proxy/staging.extensile.store.cookie (mode 0600). An existing browser session for that site is saved immediately. Re-running replaces the file.
mcp-proxy and OAuthProxyHTTP open the browser themselves when the cookie is missing or rejected, then retry once.
OAuthProxyCookieManager
Opens the default browser and stores the cookie.
from eai_oauth_proxy import OAuthProxyCookieManager
manager = OAuthProxyCookieManager()
path = manager.login("https://testymctestface.staging.extensile.store/")
value = manager.cookie_for("https://testymctestface.staging.extensile.store/api/v1/users/me")
login returns the file path. cookie_for reads the stored value for that host. path_for returns the file path when one exists.
OAuthProxyHTTP
Calls an oauth2-proxy API with the stored cookie. Paths are app paths.
from eai_oauth_proxy import OAuthProxyHTTP
with OAuthProxyHTTP("https://testymctestface.staging.extensile.store") as api:
response = api.get("/api/v1/users/me")
response.raise_for_status()
print(response.json())
request, get, post, put, patch, and delete return an httpx.Response. Pass a manager to share one cookie directory.
CookieTransport / AsyncCookieTransport
For a caller that needs its own Authorization header alongside the session cookie (an API token that isn't the user's oauth2-proxy identity), build the httpx.Client/httpx.AsyncClient directly with eai_oauth_proxy.transport.CookieTransport / eai_oauth_proxy.async_transport.AsyncCookieTransport and pass preserve_headers:
from eai_oauth_proxy import OAuthProxyCookieManager
from eai_oauth_proxy.transport import CookieTransport
manager = OAuthProxyCookieManager()
client = httpx.Client(
transport=CookieTransport(
config_dir=manager.config_dir,
login=manager.login,
preserve_headers=frozenset({"authorization"}),
),
headers={"Authorization": "Bearer <token>"},
)
Without preserve_headers, Authorization, Proxy-Authorization, and any caller-supplied Cookie are stripped before the request is sent (only the stored session cookie is attached), matching OAuthProxyHTTP's behavior. AsyncCookieTransport is the same protocol for httpx.AsyncClient; it runs the blocking browser-login step in a worker thread so it doesn't stall the event loop.
OAuthProxyMCPBridge
Forwards MCP stdio to a Streamable HTTP server. stdout is MCP traffic; logs go to stderr.
from eai_oauth_proxy import OAuthProxyMCPBridge
OAuthProxyMCPBridge("https://testymctestface.staging.extensile.store/mcp").run()
The CLI does the same thing:
eai-oauth-proxy mcp-proxy https://testymctestface.staging.extensile.store/mcp
MCP client
{
"mcpServers": {
"testy-mctestface": {
"command": "eai-oauth-proxy",
"args": ["mcp-proxy", "https://testymctestface.staging.extensile.store/mcp"]
}
}
}
Release files for eai-oauth-proxy 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| eai_oauth_proxy-0.3.0.tar.gz | 19.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| eai_oauth_proxy-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.3 kB
Release files / eai_oauth_proxy-0.3.0.tar.gz
| Download URL | eai_oauth_proxy-0.3.0.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d858dbba023fa668a765682d92e0ba827f6a94d95bc7a1fa2df734c3c20f9ba6
|
|
BLAKE2b-256 checksum How to use checksums |
0586d9ec29ac91aee285dd328a04f5b332daca14ddb34f204657a74720c8356c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / eai_oauth_proxy-0.3.0-py3-none-any.whl
| Download URL | eai_oauth_proxy-0.3.0-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87377a308867e71133430d2d9a38ee9a8ea630558afb10360a498435ec228afe
|
|
BLAKE2b-256 checksum How to use checksums |
ed6a58b29c7374a04372c1447035c3207ef4bc4f847337f8b2c6bcd9ac2ce1d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log