@agentmailbox/mcp-auth 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/index.js +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,13 +62,13 @@ Replace:
|
|
|
62
62
|
## How It Works
|
|
63
63
|
|
|
64
64
|
1. Fetches an OAuth2 access token using the Client Credentials flow
|
|
65
|
-
2. Passes the token to
|
|
65
|
+
2. Passes the token to `mcp-remote` via environment variable
|
|
66
66
|
3. Forwards all MCP communication to the AgentMailbox server
|
|
67
67
|
|
|
68
68
|
## Requirements
|
|
69
69
|
|
|
70
70
|
- Node.js 18 or later
|
|
71
|
-
-
|
|
71
|
+
- `mcp-remote` (installed automatically via npx)
|
|
72
72
|
|
|
73
73
|
## License
|
|
74
74
|
|
package/index.js
CHANGED
|
@@ -121,15 +121,17 @@ async function main() {
|
|
|
121
121
|
try {
|
|
122
122
|
const token = await getAccessToken();
|
|
123
123
|
|
|
124
|
-
// Build minimal environment with only necessary variables
|
|
124
|
+
// Build minimal environment with only necessary variables
|
|
125
125
|
const childEnv = buildChildEnv(process.env);
|
|
126
|
-
childEnv.AUTH_TOKEN = token;
|
|
127
126
|
|
|
128
|
-
// Launch mcp-remote with
|
|
127
|
+
// Launch mcp-remote with Authorization header via --header flag
|
|
128
|
+
// Note: Token appears briefly in process args, but this is acceptable for MCP client usage
|
|
129
129
|
const child = spawn('npx', [
|
|
130
130
|
'-y',
|
|
131
131
|
'mcp-remote',
|
|
132
132
|
mcpUrl,
|
|
133
|
+
'--header',
|
|
134
|
+
`Authorization:Bearer ${token}`,
|
|
133
135
|
], {
|
|
134
136
|
stdio: 'inherit',
|
|
135
137
|
env: childEnv,
|