You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3c2e34e
Browse filesBrowse the repository at this point in the historyBrowse files
-`ANON_MODE_RATE_LIMIT_REQUESTS`: Max requests per window (default: 10)
152
+
-`ANON_MODE_RATE_LIMIT_WINDOW_MS`: Window duration in milliseconds (default: 60000)
153
+
154
+
**Tool Behavior in Anonymous Mode**:
155
+
156
+
| Tool | Anonymous Mode | Authenticated Mode |
157
+
|------|---------------|-------------------|
158
+
|`dehydrate`| Works with `ENTITY_UNIQUE_COUNTER` tokens | Works with `VAULT_TOKEN` tokens |
159
+
|`rehydrate`| Returns error with setup instructions | Works normally |
160
+
|`dehydrate_file`| Returns error with setup instructions | Works normally |
161
+
162
+
**Token Format Difference**:
163
+
-**Anonymous mode**: Uses `TokenType.ENTITY_UNIQUE_COUNTER` - generates tokens like `[EMAIL_ADDRESS_1]`, `[SSN_2]`. Data is NOT persisted to vault.
164
+
-**Authenticated mode**: Uses `TokenType.VAULT_TOKEN` - generates tokens like `[EMAIL_ADDRESS_abc123xyz]` that are stored in the vault and can be rehydrated.
165
+
166
+
**Rate Limiting**:
167
+
Anonymous mode requests are rate-limited based on client IP address. When the limit is exceeded, a 429 response is returned with `X-RateLimit-*` headers indicating when the limit resets.
168
+
142
169
## Port Configuration
143
170
144
171
-**3000**: MCP server (configurable via `PORT` env var)
@@ -212,9 +239,12 @@ All tools return both text and structured content:
isError: true, // Optional: set to true when tool returns an error condition
215
243
};
216
244
```
217
245
246
+
The `isError` property is set to `true` when a tool returns an error condition (e.g., when `rehydrate` or `dehydrate_file` are called in anonymous mode, or when Skyflow API returns an error). This allows MCP clients to distinguish between successful responses and error responses.
247
+
218
248
## Dependencies
219
249
220
250
-`@modelcontextprotocol/sdk`: Official MCP TypeScript SDK (v1.19.1+)
@@ -228,8 +258,10 @@ return {
228
258
229
259
1.**Don't reuse transport or Skyflow instances** - Always create new ones per request
230
260
2.**File size limits** - Base64 encoding adds ~33% overhead; 5MB limit means ~3.75MB original files
231
-
3.**Credentials required** - All `/mcp` requests must include either valid `Authorization: Bearer <token>` header with a Skyflow bearer token OR `apiKey` query parameter with a Skyflow API key
232
-
4.**Query parameters required** - `vaultId` and `vaultUrl` must be provided (via query params or env vars)
261
+
3.**Credentials or anonymous mode required** - All `/mcp` requests must include valid credentials OR anonymous mode must be configured via `ANON_MODE_*` environment variables
262
+
4.**Query parameters required** - `vaultId` and `vaultUrl` must be provided (via query params or env vars) - unless using anonymous mode
233
263
5.**Vault configuration** - `clusterId` is automatically extracted from `vaultUrl`, don't set it separately
234
264
6.**Entity type validation** - Use exact strings from `ENTITY_MAP` keys, not the enum values
235
-
7.**AsyncLocalStorage context** - Tools must run within the request context to access Skyflow instance via `getCurrentSkyflow()`
265
+
7.**AsyncLocalStorage context** - Tools must run within the request context to access Skyflow instance via `getCurrentSkyflow()` and `isAnonymousMode()`
266
+
8.**Anonymous mode limitations** - Only the `dehydrate` tool works in anonymous mode; `rehydrate` and `dehydrate_file` return errors with setup instructions
267
+
9.**Keep schemas in sync** - When modifying tool inputs or return values, always update the corresponding `inputSchema` and `outputSchema` in the tool registration. The schemas must match the actual implementation.
Copy file name to clipboardExpand all lines: README.md
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,6 +155,54 @@ Create a `.env.local` file with optional fallback values:
155
155
156
156
**Note**: `SKYFLOW_API_KEY` and `REQUIRED_BEARER_TOKEN` are no longer used. The bearer token is now passed through from the client to Skyflow.
157
157
158
+
## Anonymous Mode (Try Before You Buy)
159
+
160
+
You can try the dehydrate tool without configuring Skyflow credentials. When no credentials are provided and anonymous mode is enabled on the server, limited functionality is available.
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"dehydrate","arguments":{"inputString":"My email is john@example.com and my SSN is 123-45-6789"}},"id":1}'
0 commit comments