Skip to content

Commit 660c0b7

Browse files
committed
Update documentation and example for password authentication
- Remove .env.example file as it's no longer needed - Update README to reflect password authentication option - Simplify docker-compose example to use PASSWORD env var - Change logout to return text response instead of redirect
1 parent c667cdb commit 660c0b7

4 files changed

Lines changed: 26 additions & 18 deletions

File tree

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,29 @@ docker run --rm -p 8081:8081 --net=host \
1111
-e EXTERNAL_URL=http://localhost:8081 \
1212
-e PROXY_URL=http://localhost:8080 \
1313
-e GLOBAL_SECRET=$(openssl rand -hex 32) \
14-
-e GOOGLE_CLIENT_ID=... \
15-
-e GOOGLE_CLIENT_SECRET=... \
16-
-e GOOGLE_ALLOWED_USERS=... \
14+
-e PASSWORD=changeme \
15+
-v ./data:/data \
1716
ghcr.io/sigbit/mcp-auth-proxy:latest
1817
```
1918

19+
.mcp.json
20+
```json
21+
{
22+
"mcpServers": {
23+
"mcp": {
24+
"type": "http",
25+
"url": "http://localhost:8081/mcp"
26+
}
27+
}
28+
}
29+
```
30+
31+
2032
## Overview
2133

2234
MCP Auth Proxy is a secure OAuth 2.1 authentication proxy for Model Context Protocol (MCP) servers. MCP servers are expected to support not only standard OAuth 2.1 flows but also Dynamic Client support (e.g., dynamic client registration) and authentication-related .well-known metadata. On top of that, different MCP clients handle tokens differently, which makes implementation tricky.
2335

24-
MCP Auth Proxy sits in front of your MCP services and enforces sign-in with OAuth providers (such as Google or GitHub) before users can access protected MCP resources.
36+
MCP Auth Proxy sits in front of your MCP services and enforces sign-in with OAuth providers (such as Google or GitHub) or password before users can access protected MCP resources.
2537

2638
## Note
2739

@@ -38,16 +50,16 @@ For a simpler approach to publish local MCP servers over OAuth, consider [MCP Wa
3850
| `EXTERNAL_URL` | No | External URL for OAuth callbacks | `http://localhost:8081` |
3951
| `PROXY_URL` | No | Target MCP server URL | `http://localhost:8080` |
4052
| `GLOBAL_SECRET` | No | Global secret for session encryption | `supersecret` |
41-
| `GOOGLE_CLIENT_ID` | No* | Google OAuth client ID | - |
42-
| `GOOGLE_CLIENT_SECRET` | No* | Google OAuth client secret | - |
43-
| `GOOGLE_ALLOWED_USERS` | No* | Comma-separated list of allowed Google emails | - |
44-
| `GITHUB_CLIENT_ID` | No* | GitHub OAuth client ID | - |
45-
| `GITHUB_CLIENT_SECRET` | No* | GitHub OAuth client secret | - |
46-
| `GITHUB_ALLOWED_USERS` | No* | Comma-separated list of allowed GitHub usernames | - |
53+
| `GOOGLE_CLIENT_ID` | No | Google OAuth client ID | - |
54+
| `GOOGLE_CLIENT_SECRET` | No | Google OAuth client secret | - |
55+
| `GOOGLE_ALLOWED_USERS` | No | Comma-separated list of allowed Google emails | - |
56+
| `GITHUB_CLIENT_ID` | No | GitHub OAuth client ID | - |
57+
| `GITHUB_CLIENT_SECRET` | No | GitHub OAuth client secret | - |
58+
| `GITHUB_ALLOWED_USERS` | No | Comma-separated list of allowed GitHub usernames | - |
59+
| `PASSWORD` | No | Password for authentication | - |
60+
| `PASSWORD_HASH` | No | Hash of the password for authentication | - |
4761
| `MODE` | No | Set to `debug` for development mode | `production` |
4862

49-
*At least one OAuth provider must be configured (Google or GitHub)
50-
5163
### OAuth Provider Setup
5264

5365
#### Google OAuth Setup

example/.env.example

Lines changed: 0 additions & 3 deletions
This file was deleted.

example/docker-compose.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ services:
44
context: ..
55
dockerfile: Dockerfile
66
restart: unless-stopped
7-
env_file:
8-
- .env
97
ports:
108
- 8081:8081
119
environment:
1210
# If you are accessing from outside (such as Claude Web),
1311
# be sure to specify a domain name that can be accessed from outside for EXTERNAL_URL.
1412
- EXTERNAL_URL=http://localhost:8081
1513
- PROXY_URL=http://playwright:8931
14+
- PASSWORD=changeme
1615
volumes:
1716
- ./data:/data
1817
playwright:

pkg/auth/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func (a *AuthRouter) handleLogout(c *gin.Context) {
203203
session := sessions.Default(c)
204204
session.Clear()
205205
session.Save()
206-
c.Redirect(http.StatusFound, LoginEndpoint)
206+
c.String(http.StatusOK, "Logged out")
207207
}
208208

209209
func (a *AuthRouter) RequireAuth() gin.HandlerFunc {

0 commit comments

Comments
 (0)