Skip to content

Commit 900b43f

Browse files
style: fix prettier formatting issues
Applied prettier formatting to: - .github/workflows/docker.yml - CLAUDE.md - docker-compose.yml - README.Docker.md
1 parent 4d0a291 commit 900b43f

4 files changed

Lines changed: 29 additions & 23 deletions

File tree

.github/workflows/docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
permissions:
2222
contents: read
2323
packages: write
24-
24+
2525
steps:
2626
- name: Checkout repository
2727
uses: actions/checkout@v4
@@ -59,4 +59,4 @@ jobs:
5959
tags: ${{ steps.meta.outputs.tags }}
6060
labels: ${{ steps.meta.outputs.labels }}
6161
cache-from: type=gha
62-
cache-to: type=gha,mode=max
62+
cache-to: type=gha,mode=max

CLAUDE.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55
## Commands
66

77
### Build & Development
8+
89
```bash
910
pnpm build # Compile TypeScript to JavaScript (tsup)
1011
pnpm build:watch # Watch mode for development
@@ -13,6 +14,7 @@ pnpm lint-fix # Auto-fix formatting with prettier
1314
```
1415

1516
### Running the Proxy
17+
1618
```bash
1719
# After building, run the proxy
1820
node dist/proxy.js <remote-server-url> [port] [options]
@@ -22,6 +24,7 @@ node dist/client.js <remote-server-url> [options]
2224
```
2325

2426
### Docker
27+
2528
```bash
2629
# Build Docker image
2730
docker build -t mcp-remote:latest .
@@ -39,26 +42,31 @@ docker run -it -v mcp-auth:/home/mcp/.mcp-auth mcp-remote:latest https://remote.
3942
## Architecture Overview
4043

4144
This project acts as a bidirectional proxy between:
45+
4246
- **Local stdio transport** (used by Claude Desktop, Cursor, Windsurf)
4347
- **Remote HTTP/SSE transport** with OAuth 2.0 authentication
4448

4549
### Key Components
4650

4751
1. **proxy.ts**: Main entry point that handles stdio ↔ remote communication
52+
4853
- Reads from stdin, writes to stdout
4954
- Implements transport strategy pattern (http-first, sse-first, http-only, sse-only)
5055
- Manages OAuth authentication flow when needed
5156

5257
2. **client.ts**: Standalone test client for debugging remote connections
58+
5359
- Useful for testing OAuth flows outside of MCP clients
5460
- Run with `npx -p mcp-remote@latest mcp-remote-client <url>`
5561

5662
3. **lib/coordination.ts**: OAuth flow orchestration
63+
5764
- Spins up temporary Express server for OAuth callbacks
5865
- Handles authorization code exchange
5966
- Manages browser opening for auth
6067

6168
4. **lib/mcp-auth-config.ts**: Token persistence and management
69+
6270
- Stores OAuth tokens in `~/.mcp-auth/`
6371
- Automatic token refresh
6472
- Debug logging to `~/.mcp-auth/{server_hash}_debug.log` when --debug flag is used
@@ -69,6 +77,7 @@ This project acts as a bidirectional proxy between:
6977
- Message proxying between transports
7078

7179
### OAuth Flow
80+
7281
1. If server requires auth, proxy intercepts auth error
7382
2. Spins up local Express server on configurable port (default: 3334)
7483
3. Opens browser for user authorization
@@ -78,6 +87,7 @@ This project acts as a bidirectional proxy between:
7887
7. Automatically refreshes tokens when expired
7988

8089
### Transport Strategies
90+
8191
- Default behavior: Try HTTP first, fall back to SSE
8292
- Configurable via `--transport` flag
8393
- Handles connection failures and retries gracefully
@@ -90,4 +100,4 @@ This project acts as a bidirectional proxy between:
90100
- ES modules output only
91101
- Prettier formatting with 140 char lines, single quotes, no semicolons
92102
- OAuth tokens stored in `~/.mcp-auth/` (or `$MCP_REMOTE_CONFIG_DIR`)
93-
- Debug logs available with `--debug` flag for troubleshooting auth issues
103+
- Debug logs available with `--debug` flag for troubleshooting auth issues

README.Docker.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,19 @@ docker-compose run mcp-remote node dist/client.js https://remote.mcp.server/sse
5050
For OAuth flows, you'll need to handle the callback URL. Options:
5151

5252
1. **Host Network Mode** (Linux only):
53+
5354
```bash
5455
docker run -it --network host mcp-remote:latest https://remote.mcp.server/sse
5556
```
5657

5758
2. **Port Forwarding**:
59+
5860
```bash
5961
docker run -it -p 3334:3334 mcp-remote:latest https://remote.mcp.server/sse
6062
```
6163

6264
3. **Custom Callback Host**:
65+
6366
```bash
6467
docker run -it \
6568
-p 3334:3334 \
@@ -92,15 +95,7 @@ To use the Docker container with Claude Desktop, Cursor, or Windsurf:
9295
"mcpServers": {
9396
"remote-example": {
9497
"command": "docker",
95-
"args": [
96-
"run",
97-
"-i",
98-
"--rm",
99-
"-v",
100-
"mcp-auth:/home/mcp/.mcp-auth",
101-
"mcp-remote:latest",
102-
"https://remote.mcp.server/sse"
103-
]
98+
"args": ["run", "-i", "--rm", "-v", "mcp-auth:/home/mcp/.mcp-auth", "mcp-remote:latest", "https://remote.mcp.server/sse"]
10499
}
105100
}
106101
}
@@ -116,6 +111,7 @@ To use the Docker container with Claude Desktop, Cursor, or Windsurf:
116111
### OAuth Callback Issues
117112

118113
If the OAuth callback fails:
114+
119115
1. Ensure the port is properly exposed
120116
2. Check that the callback URL matches what the OAuth provider expects
121117
3. Consider using host network mode on Linux
@@ -126,4 +122,4 @@ The container runs as a non-root user (uid: 1001). Ensure mounted volumes have a
126122

127123
### Debug Logs
128124

129-
Enable debug logging with the `--debug` flag. Logs will be stored in the mounted volume at `/home/mcp/.mcp-auth/{server_hash}_debug.log`.
125+
Enable debug logging with the `--debug` flag. Logs will be stored in the mounted volume at `/home/mcp/.mcp-auth/{server_hash}_debug.log`.

docker-compose.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,37 @@ services:
55
build: .
66
image: mcp-remote:latest
77
container_name: mcp-remote
8-
8+
99
# Mount auth directory for token persistence
1010
volumes:
1111
- mcp-auth:/home/mcp/.mcp-auth
12-
12+
1313
# Environment variables
1414
environment:
1515
# Set debug mode (optional)
1616
# - DEBUG=true
17-
17+
1818
# Custom headers (optional)
1919
# - AUTH_TOKEN=your-token-here
20-
20+
2121
# For OAuth callback, you might need to expose the port
2222
# Uncomment if running OAuth flow inside container
2323
# ports:
2424
# - "3334:3334"
25-
25+
2626
# Override command with your remote server URL
2727
# Example: docker-compose run mcp-remote https://remote.mcp.server/sse
28-
command: ["--help"]
29-
28+
command: ['--help']
29+
3030
# Run as non-root user
3131
user: mcp
32-
32+
3333
# Restart policy
3434
restart: unless-stopped
35-
35+
3636
# Network mode - use host for OAuth callback to work
3737
# network_mode: host
3838

3939
volumes:
4040
mcp-auth:
41-
driver: local
41+
driver: local

0 commit comments

Comments
 (0)