Skip to main content
Glama
quequiere

perplexity-web-mcp

by quequiere

login

Authenticate with Perplexity.ai to enable web searches through browser automation. Opens a browser window for login if not already authenticated.

Instructions

Check if you are authenticated on Perplexity.ai. If not, opens a browser window so you can log in.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'login' tool is registered in src/index.ts. The execute handler uses `ensureAuthenticated` to manage the authentication flow.
    mcp.addTool({
      name: "login",
      description:
        "Check if you are authenticated on Perplexity.ai. If not, opens a browser window so you can log in.",
      parameters: z.object({}),
      execute: async () => {
        await ensureBrowser();
        const page = await getFirstPage();
        const authenticated = await checkSession(page);
        if (authenticated) {
          return "Already authenticated on Perplexity.ai.";
        }
        await ensureAuthenticated();
        return "Login successful. You are now authenticated on Perplexity.ai.";
      },
    });
  • The 'ensureAuthenticated' function orchestrates the login process, opening the browser and waiting for the session to become active.
    export async function ensureAuthenticated(): Promise<void> {
      await ensureBrowser();
      const page = await getFirstPage();
      await page.goto(PERPLEXITY_HOME, { waitUntil: "domcontentloaded" });
    
      const authenticated = await checkSession(page);
      if (authenticated) {
        log("Session active.");
        return;
      }
    
      log("No active session. Please log in to Perplexity in the browser window...");
      await waitForLogin(page);
      log("Login detected.");
    }
Install Server

Other Tools

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/quequiere/perplexity-web-mcp'

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