Skip to main content
Glama

browser_get_cookies

Retrieve all browser cookies to manage authentication states, track user sessions, and maintain login persistence during automated web interactions.

Instructions

Get all cookies

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Inline handler for the browser_get_cookies MCP tool. No input parameters. Fetches the current browser driver, instantiates CookieService, retrieves all cookie names, and returns a formatted text response.
    server.tool('browser_get_cookies', 'Get all cookies', {}, async () => { const driver = stateManager.getDriver(); const cookieService = new CookieService(driver); const cookies = await cookieService.getCookies(); return { content: [{ type: 'text', text: `Cookies: ${cookies.join(', ')}` }], }; });
  • Core helper method in CookieService that uses Selenium WebDriver to get all current cookies and returns an array of their names. Called by the tool handler.
    async getCookies(): Promise<string[]> { const cookies = await this.driver.manage().getCookies(); return cookies.map(cookie => cookie.name); }
  • Registration of cookie tools module (including browser_get_cookies) as part of all tools registration in tools index.
    registerCookieTools(server, stateManager);
  • src/server.ts:55-55 (registration)
    Top-level registration of all tools (including browser_get_cookies via chain) in the main MCP server class.
    registerAllTools(this.server, this.stateManager);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pshivapr/selenium-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server