Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.1.0

### New Features

- **`interceptor_browser_list_cookies` `full` option**: Pass `full: true` to return full cookie values inline (capped at 20000 chars) under a `value` field, instead of the default truncated `value_preview`. Overrides `value_max_chars`. Avoids round-tripping through `interceptor_browser_get_cookie` per entry when full bodies are needed.

## 2.0.0

### Breaking Changes
Expand Down
7 changes: 5 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "proxy-mcp",
"version": "2.0.0",
"version": "2.1.0",
"description": "MCP server for HTTP/HTTPS MITM proxy via mockttp",
"type": "module",
"engines": {
Expand Down
14 changes: 10 additions & 4 deletions src/tools/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,11 @@ export function registerDevToolsTools(server: McpServer): void {
limit: z.number().optional().default(DEFAULT_LIST_LIMIT).describe("Max cookies to return (default: 50, max: 500)"),
value_max_chars: z.number().optional().default(DEFAULT_VALUE_MAX_CHARS)
.describe("Max characters for cookie value previews (default: 256)"),
full: z.boolean().optional().default(false)
.describe(`Return full cookie values instead of previews (capped at ${HARD_VALUE_CAP_CHARS} chars). Overrides value_max_chars.`),
sort: z.enum(["name", "domain", "expires"]).optional().default("name").describe("Sort order (default: name)"),
},
async ({ target_id, url_filter, domain_filter, name_filter, offset, limit, value_max_chars, sort }) => {
async ({ target_id, url_filter, domain_filter, name_filter, offset, limit, value_max_chars, full, sort }) => {
try {
const entry = getEntry(target_id);
const cookies = await entry.context.cookies();
Expand Down Expand Up @@ -279,11 +281,13 @@ export function registerDevToolsTools(server: McpServer): void {
const l = normalizeLimit(limit);
const page = sorted.slice(o, o + l);

const valueCap = Math.max(0, Math.min(HARD_VALUE_CAP_CHARS, Math.trunc(value_max_chars ?? DEFAULT_VALUE_MAX_CHARS)));
const valueCap = full
? HARD_VALUE_CAP_CHARS
: Math.max(0, Math.min(HARD_VALUE_CAP_CHARS, Math.trunc(value_max_chars ?? DEFAULT_VALUE_MAX_CHARS)));

const summaries = page.map((c) => {
const capped = capValue(c.value, valueCap);
return {
const base = {
cookie_id: cookieStableId(c),
name: c.name,
domain: c.domain,
Expand All @@ -292,10 +296,12 @@ export function registerDevToolsTools(server: McpServer): void {
httpOnly: c.httpOnly,
secure: c.secure,
sameSite: c.sameSite ?? null,
value_preview: capped.value,
value_length: capped.valueLength,
value_truncated: capped.truncated,
};
return full
? { ...base, value: capped.value }
: { ...base, value_preview: capped.value };
});

return {
Expand Down
Loading