Skip to main content
Glama
gzgs-xgxt-mcp
by yjp-jdp

从本地浏览器抓取登录态

xg_login_browser

Automatically retrieves the Xsfwpt-Token from an already logged-in page in a local browser running with remote debugging enabled, eliminating manual cookie copying.

Instructions

从一个已开启远程调试端口的本地浏览器里,自动抓取已登录页面上的 Xsfwpt-Token。 前提:浏览器以 --remote-debugging-port=9222 启动,并且已经登录学工系统。 这是最省事的方式——不用手动复制 Cookie。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "xg_login_browser"
  }
}

Input Schema

NameRequiredDescriptionDefault
endpointNoCDP 地址,默认 http://127.0.0.1:9222

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It usefully discloses the environmental prerequisites and that it reads existing session state rather than prompting for credentials, but it says nothing about failure behavior when the port is closed or the page is not logged in, about what exactly is returned (bare token string vs. structured data), or about any token lifetime concerns.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, front-loaded with the action, then the prerequisite, then the rationale. The closing '这是最省事的方式' line earns its place as a selection cue rather than filler, though it borders on persuasion over specification.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter tool there is no output schema, so the description should indicate what an agent receives back (presumably an Xsfwpt-Token value and possibly where it was found). Prerequisites are covered well, but the return contract and error modes are left unspecified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There is a single optional endpoint parameter with 100% schema description coverage, so the schema already explains the CDP address and its default. The description's mention of port 9222 is consistent with that default but adds no new meaning — baseline 3 applies when the schema does the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource — 自动抓取 Xsfwpt-Token from a local browser's logged-in page — so an agent knows exactly what is produced. It implicitly contrasts with manual token copying, though it never names sibling tools such as xg_login_token or xg_login_account, so differentiation is inferred rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a clear precondition (browser launched with --remote-debugging-port=9222 and already logged into 学工系统) plus a selection hint that this is the low-effort route versus manual cookie copying. It stops short of naming when NOT to use it, e.g. what to fall back to if no debug port is open or the user must log in with credentials.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.