Skip to main content
Glama
WhiteNightShadow

camoufox-reverse-mcp

close_browser

Closes the Camoufox browser instance to free up system resources after reverse engineering tasks.

Instructions

Close the Camoufox browser and release all resources.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for close_browser. Decorated with @mcp.tool(), it delegates to browser_manager.close().
    @mcp.tool()
    async def close_browser() -> dict:
        """Close the Camoufox browser and release all resources."""
        try:
            return await browser_manager.close()
        except Exception as e:
            return {"error": str(e)}
  • The BrowserManager.close() method that releases all browser resources, closes the AsyncCamoufox context, clears all stored state (contexts, pages, scripts, traces, network data, route handlers).
    async def close(self) -> dict:
        """Close the browser and clean up all resources."""
        if self._cm is not None:
            try:
                await self._cm.__aexit__(None, None, None)
            except Exception:
                pass
        self.browser = None
        self.contexts.clear()
        self.pages.clear()
        self.active_page_name = None
        self._cm = None
        self._console_logs.clear()
        self._network_requests.clear()
        self._request_id_counter = 0
        self._capturing = False
        self._capture_body = False
        self._init_scripts.clear()
        self._persistent_scripts.clear()
        self._persistent_traces.clear()
        self._nav_responses.clear()
        self._route_handlers.clear()
        return {"status": "closed"}
  • The server module where mcp is instantiated, browser_manager is created, and the navigation module (containing close_browser) is imported. The @mcp.tool() decorator on close_browser registers it.
    from mcp.server.fastmcp import FastMCP
    from .browser import BrowserManager
    
    mcp = FastMCP(
        "camoufox-reverse-mcp",
        instructions="Anti-detection browser MCP server for JavaScript reverse engineering. "
        "Uses Camoufox (C++ engine-level fingerprint spoofing) to bypass bot detection "
        "while performing JS analysis, debugging, hooking, network interception, "
        "and JSVMP bytecode analysis."
    )
    
    browser_manager = BrowserManager()
    
    # v1.0.0: pure JS reverse-engineering toolkit (session/assertions removed)
    from .tools import navigation      # noqa: E402, F401  — browser control + page interaction
    from .tools import script_analysis  # noqa: E402, F401  — scripts() + search_code()
    from .tools import debugging        # noqa: E402, F401  — evaluate_js
    from .tools import hooking          # noqa: E402, F401  — hook_function + inject_hook_preset + remove_hooks
    from .tools import network          # noqa: E402, F401  — network_capture + list/get requests
    from .tools import storage          # noqa: E402, F401  — cookies() + get_storage + export/import state
    from .tools import jsvmp            # noqa: E402, F401  — hook_jsvmp_interpreter + compare_env
    from .tools import instrumentation  # noqa: E402, F401  — instrumentation(action=...)
    from .tools import environment      # noqa: E402, F401  — check_environment
    from .tools import verification     # noqa: E402, F401  — verify_signer_offline
    from .tools import trace            # noqa: E402, F401  — trace_property_access + list/query
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 mentions 'release all resources,' hinting at cleanup, but does not disclose irreversible side effects such as loss of browser state or inability to reuse the browser session.

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

Conciseness5/5

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

A single sentence that is concise and to the point. Every word adds value without redundancy.

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

Completeness4/5

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

For a parameterless tool with no output schema, the description adequately explains the core action. However, it could briefly mention the irreversible nature or that the browser must be open.

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

Parameters4/5

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

The tool has zero parameters, so no parameter description is needed. Schema coverage is 100% (vacuously). Baseline 4 applies as schema does all the work.

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

Purpose5/5

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

The description clearly states a specific action: 'Close the Camoufox browser and release all resources.' It uses a verb-resource structure that distinguishes it from sibling tools like 'launch_browser' or 'navigate'.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., browser must be open), consequences (e.g., loses unsaved state), or contrast with other tools like 'reset_browser_state'.

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

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/WhiteNightShadow/camoufox-reverse-mcp'

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