/chrome-devtools-mcp:cookie-debuggingfrom chrome-devtools-mcp
Inspects, debugs, and tests cookies, session state, authentication issues, and cookie consent compliance using Chrome DevTools. Useful for diagnosing 401/403 errors, auth redirects, session expiration, Cookie/Set-Cookie header issues, cookie banner conformance, and third-party/SameSite/Partitioned cookie warnings.
Ships in chrome-devtools-mcp. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Page Targeting: Page-scoped tools (list_network_requests, get_network_request, list_console_messages, evaluate_script, navigate_page, take_snapshot, click, lighthouse_audit, close_page, etc.) require a pageId parameter. Retrieve available page IDs using list_pages or from new_page.
Cookies marked HttpOnly cannot be accessed or modified by client-side JavaScript (cookieStore or document.cookie). However, the browser automatically attaches active HttpOnly cookies to outgoing HTTP request headers (Cookie).
HttpOnly values: Look at the Cookie request header of any outgoing HTTP request via get_network_request.Set-Cookie response header of login/auth responses.HttpOnly cookies: Use evaluate_script with the modern cookieStore API (async () => await cookieStore.getAll()).Choose the right session environment to avoid state contamination (e.g., residual analytics or auth tokens):
| Strategy | When to Use | Setup / Teardown |
|---|---|---|
| Live Tab (Active Page) | Diagnosing an active user session, live 401/403 error, or current state. | Operates on the user's existing page; get its pageId from list_pages. |
Clean-Slate (isolatedContext) | Testing cookie consent banners, first-time visits, or zero-cookie guarantees. | Call new_page with a unique isolatedContext (e.g. "consent-audit-1"). When finished, call close_page. |
| Action | Client JavaScript (cookieStore / document.cookie) | DevTools Network & Context Tools |
|---|---|---|
| Read Non-HttpOnly | ✅ async () => await cookieStore.getAll() | ✅ get_network_request (Request Cookie) |
| Read HttpOnly | ❌ Blocked by browser security | ✅ get_network_request (Request Cookie) |
Inspect Attributes (Domain, Path, SameSite, Expires) | ✅ async () => await cookieStore.getAll() | ✅ get_network_request (Response Set-Cookie) |
| Modify / Delete Non-HttpOnly | ✅ async () => await cookieStore.set(...) | N/A |
| Modify / Delete HttpOnly | ❌ Silent failure in JavaScript | ✅ Use new_page(isolatedContext: ...) for clean state |
[!WARNING] Attempting to clear an
HttpOnlycookie via JavaScript (cookieStore.deleteordocument.cookie = "...; max-age=0") will silently fail. To test in an unauthenticated or fresh state, always spawn a new isolated context usingnew_pagewithisolatedContext.
When an authenticated page request fails, returns 401/403, or redirects to login:
list_network_requests with includePreservedRequests: true.Cookie Header: Call get_network_request with the reqid.
Cookie header was attached and whether required tokens (e.g. SESSION_ID, auth_token) were sent.navigate_page with type: "reload", ORevaluate_script with () => fetch(window.location.href)get_network_request on the new request to inspect the active Cookie header.Set-Cookie directives:
Path=/api when the request is to /.Domain=api.example.com preventing cookies on sub.example.com.Secure cookies are never sent over unencrypted http://.SameSite=Strict cookies are omitted on cross-site navigations.Expires or Max-Age elapsed.To verify that no non-essential or tracking cookies are set before consent or when declining:
{"url": "<PAGE_URL>", "isolatedContext": "consent-test-1"}
evaluate_script with async () => await cookieStore.getAll().list_network_requests to ensure no third-party tracking beacons fired before consent.list_console_messages with types: ["issue"] to check for tracking warnings.take_snapshot to locate the "Decline" or "Reject All" button uid.click.evaluate_script with async () => await cookieStore.getAll() after clicking to assert that only strictly necessary or consent-state cookies exist.take_snapshot $\rightarrow$ click).cookieStore.getAll() to verify previously accepted non-essential cookies were cleared or expired.list_network_requests on subsequent actions to ensure tracking beacons are no longer fired.close_page when the audit is complete to prevent leftover cookies from affecting subsequent tasks.list_console_messages with:
{
"pageId": 1,
"types": ["issue"],
"includePreservedMessages": true
}
CookieIssue entries, such as:
SameSiteNoneInsecure: SameSite=None without Secure.ThirdPartyCookiePhaseout: Third-party cookie blocked or restricted.SchemefulSameSite: Cross-scheme cookie issues.PartitionedCookies: Invalid CHIPS partitioning attributes.lighthouse_audit with mode: "navigation" (omit outputDirPath to use the default temporary files, or specify a directory within the workspace).report.json path without loading the full report into context:
node -e "const r=require('<path/to/report.json>'); const a=r.audits['third-party-cookies']; console.log(JSON.stringify({score: a?.score, displayValue: a?.displayValue, items: a?.details?.items}))"
For client-accessible, non-HttpOnly cookies (e.g., UI preferences, non-sensitive feature flags):
async () => await cookieStore.getAll();
() => document.cookie.cookieStore:
async () =>
await cookieStore.set({
name: 'theme',
value: 'dark',
expires: Date.now() + 86400000,
sameSite: 'lax',
});
async () => await cookieStore.delete('theme');
cookieStore is undefined: cookieStore requires a Secure Context (https://, localhost, or 127.0.0.1). On non-secure HTTP origins, use () => document.cookie or test over HTTPS.evaluate_script returns empty / unresolved Promise: cookieStore methods are asynchronous. Always wrap calls with async () => await cookieStore.getAll().HttpOnly. Trigger a network request and call get_network_request to view it in the Cookie request header.HttpOnly or requires matching Path and Domain parameters. Use a fresh isolatedContext with new_page for a clean slate.http:// while cookie specifies Secure.Domain restricts subdomains.list_console_messages(types: ["issue"]) for browser rejection reasons.new_page with a unique isolatedContext when running compliance tests, and call close_page when done.What SKILL.md sets; muted values are Claude Code's defaults
7 skills in this plugin
/a11y-debuggingUses Chrome DevTools MCP for accessibility (a11y) debugging and auditing based on web.dev guidelines. Use when testing semantic HTML, ARIA labels, focus states, keyboard navigation, tap targets, and color contrast./chrome-devtoolsUses Chrome DevTools via MCP for efficient debugging, troubleshooting and browser automation. Use when debugging web pages, automating browser interactions, analyzing performance, or inspecting network requests. This skill does not apply to `--slim` mode (MCP configuration)./chrome-devtools-cliUse this skill to write shell scripts or run shell commands to automate tasks in the browser or otherwise use Chrome DevTools via CLI./debug-optimize-lcpGuides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions "largest contentful paint", "page load speed", "CWV", or wants to improve how fast their hero image or main content renders./memory-leak-debuggingDiagnoses and resolves memory leaks in JavaScript/Node.js applications. Use when a user reports high memory usage, OOM errors, or wants to capture, compare, or inspect heap snapshots with Chrome DevTools MCP memory tools./troubleshootingUses Chrome DevTools MCP and documentation to troubleshoot connection and target issues. Trigger this skill when list_pages, new_page, or navigate_page fail, or when the server initialization fails.npx claudepluginhub hope7happiness/chrome-devtools-mcp-low-memory --plugin chrome-devtools-mcp5 plugins in 4 repositories ship this exact skill · first indexed Oct 15, 2026
Other plugins' skills for the same job