@ackuity/inline-proxy 0.7.1 → 0.7.4
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 +50 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -213,6 +213,56 @@ Then run:
|
|
|
213
213
|
docker compose up
|
|
214
214
|
```
|
|
215
215
|
|
|
216
|
+
## Using Server Mode with OAuth / Authenticated MCP Servers
|
|
217
|
+
|
|
218
|
+
If your MCP server requires authentication (e.g. OAuth, API keys, or session tokens), **server mode** is the recommended approach. The proxy runs as a standalone HTTP service, so authentication is handled entirely between your agent and the MCP server — the proxy transparently forwards headers and credentials while still intercepting tool calls for evaluation.
|
|
219
|
+
|
|
220
|
+
### Why server mode for authenticated setups
|
|
221
|
+
|
|
222
|
+
In stdio mode, the proxy spawns the MCP server as a child process, which makes it difficult to pass authentication context. In server mode, the proxy sits between your agent and an already-authenticated MCP server over HTTP, so:
|
|
223
|
+
|
|
224
|
+
- Your agent authenticates with the MCP server as usual (OAuth flows, bearer tokens, etc.)
|
|
225
|
+
- The proxy intercepts only `tools/call` requests for security evaluation
|
|
226
|
+
- All other traffic (including auth handshakes) passes through unchanged
|
|
227
|
+
|
|
228
|
+
### Example: OAuth-protected MCP server
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# 1. Start your MCP server (handles its own OAuth)
|
|
232
|
+
your-mcp-server --port 5000
|
|
233
|
+
|
|
234
|
+
# 2. Start the Ackuity proxy in front of it
|
|
235
|
+
npx @ackuity/inline-proxy --mode server --target http://localhost:5000/mcp --port 7500
|
|
236
|
+
|
|
237
|
+
# 3. Point your agent to the proxy instead of the MCP server
|
|
238
|
+
# Agent connects to http://localhost:7500/mcp
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Your agent's existing authentication flow (OAuth redirects, token refresh, etc.) works as before — just change the MCP endpoint URL to point to the proxy.
|
|
242
|
+
|
|
243
|
+
### Token expiry
|
|
244
|
+
|
|
245
|
+
If the MCP server returns a `401 Unauthorized` or `403 Forbidden`, the token has expired. Your agent is responsible for refreshing the token with the OAuth provider and retrying the request — the proxy passes these status codes through unchanged.
|
|
246
|
+
|
|
247
|
+
### Example: Agent passing a bearer token
|
|
248
|
+
|
|
249
|
+
```typescript
|
|
250
|
+
// Your agent sends requests to the proxy, which forwards to the MCP server
|
|
251
|
+
const response = await fetch("http://localhost:7500/mcp", {
|
|
252
|
+
method: "POST",
|
|
253
|
+
headers: {
|
|
254
|
+
"Content-Type": "application/json",
|
|
255
|
+
"Authorization": "Bearer <your-oauth-token>", // Passed through to MCP server
|
|
256
|
+
},
|
|
257
|
+
body: JSON.stringify({
|
|
258
|
+
jsonrpc: "2.0",
|
|
259
|
+
method: "tools/call",
|
|
260
|
+
params: { name: "delete_record", arguments: { id: 123 } },
|
|
261
|
+
}),
|
|
262
|
+
});
|
|
263
|
+
// The proxy evaluates the tool call with Ackuity before forwarding
|
|
264
|
+
```
|
|
265
|
+
|
|
216
266
|
## Fail-Closed Behavior
|
|
217
267
|
|
|
218
268
|
If the Inline Decision Engine is unreachable or returns an error (e.g. invalid token), the proxy **blocks the tool call** rather than forwarding it. This prevents destructive operations from slipping through during outages.
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ackuity/inline-proxy",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"
|
|
8
|
+
"inline-proxy": "dist/main.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc && npx biome check src/",
|