Skip to main content
Glama

proxy_stop

Stop the MITM proxy while retaining traffic history and CA certificate.

Instructions

Stop the MITM proxy. Traffic history and CA certificate are retained.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'proxy_stop' tool handler. Defined via server.tool() with an empty input schema. Calls proxyManager.stop() to stop the MITM proxy, returning a success message.
    server.tool(
      "proxy_stop",
      "Stop the MITM proxy. Traffic history and CA certificate are retained.",
      {},
      async () => {
        try {
          await proxyManager.stop();
          return {
            content: [{
              type: "text",
              text: JSON.stringify({ status: "success", message: "Proxy stopped. Traffic and cert retained." }),
            }],
          };
        } catch (e) {
          return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: String(e) }) }] };
        }
      },
    );
  • The input schema for 'proxy_stop' — an empty object (no parameters required).
    {},
  • Registration function registerLifecycleTools() is called from src/index.ts:62, which registers the 'proxy_stop' tool among other lifecycle tools (proxy_start, proxy_status, proxy_get_ca_cert).
    export function registerLifecycleTools(server: McpServer): void {
      server.tool(
        "proxy_start",
        "Start the HTTPS MITM proxy. Auto-generates a CA certificate. Returns port, URL, cert fingerprint, and setup instructions for the target device.",
        {
          port: z.number().optional().describe("Port to listen on (0 = random available port)"),
          persistence_enabled: z.boolean().optional().default(false)
            .describe("Enable persistent on-disk session capture (default: false)"),
          session_name: z.string().optional().describe("Optional name for the session when persistence is enabled"),
          capture_profile: z.enum(["preview", "full"]).optional().default("preview")
            .describe("Capture profile for persisted sessions: preview (body previews) or full (full bodies)"),
          storage_dir: z.string().optional().describe("Custom session storage directory"),
          max_disk_mb: z.number().optional().default(1024)
            .describe("Per-session disk cap in MB (writes are dropped once exceeded)"),
        },
        async ({ port, persistence_enabled, session_name, capture_profile, storage_dir, max_disk_mb }) => {
          try {
            const result = await proxyManager.start(port, {
              persistenceEnabled: persistence_enabled ?? false,
              sessionName: session_name,
              captureProfile: capture_profile,
              storageDir: storage_dir,
              maxDiskMb: max_disk_mb,
            });
            const localIP = getLocalIP();
            return {
              content: [{
                type: "text",
                text: JSON.stringify({
                  status: "success",
                  port: result.port,
                  url: result.url,
                  certFingerprint: result.cert.fingerprint,
                  persistence: proxyManager.getSessionStatus(),
                  setup: {
                    proxyHost: localIP,
                    proxyPort: result.port,
                    instructions: [
                      `1. Set device Wi-Fi proxy to ${localIP}:${result.port}`,
                      "2. Install the CA certificate on the device (use proxy_get_ca_cert)",
                      `3. Or use env vars: HTTP_PROXY=http://${localIP}:${result.port} HTTPS_PROXY=http://${localIP}:${result.port}`,
                    ],
                  },
                }),
              }],
            };
          } catch (e) {
            return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: String(e) }) }] };
          }
        },
      );
    
      server.tool(
  • The ProxyManager.stop() method that proxy_stop invokes. Stops the transparent proxy if running, deactivates interceptors, cleans up temp certs, stops the mockttp server, clears pending requests and TLS caches, and shuts down the TLS spoof container if active.
    async stop(): Promise<void> {
      if (!this._running) {
        throw new Error("Proxy is not running.");
      }
      // Stop transparent proxy first if running
      if (this._transparentRunning) {
        await this.stopTransparent().catch(() => {});
      }
      // Deactivate all interceptors before stopping the proxy
      await interceptorManager.deactivateAll().catch(() => {});
      await cleanupTempCerts().catch(() => {});
      if (this.server) {
        await this.server.stop();
        this.server = null;
      }
      await this.sessionStore.stopSession().catch(() => {});
      this._running = false;
      this.pendingRequests.clear();
      this.pendingRawBodies.clear();
      this.tlsMetadataCache.clear();
      this.disableServerTls();
      if (this._ja3SpoofConfig) {
        await shutdownSpoofContainer();
      }
    }
Behavior3/5

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

No annotations provided, so description carries full burden. It discloses that traffic history and CA certificate are retained, which is useful. However, it does not mention other effects like connection termination or proxy state change.

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?

Two concise sentences with no wasted words. Action verb first, then retention detail.

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 covers what happens and what is preserved. Could optionally mention return value or side effects but not essential.

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 input schema is empty (0 parameters), so baseline is 4. Description adds no parameter details but none are needed.

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 clearly states the action ('Stop the MITM proxy') and adds a retention note. It differentiates from proxy_start but does not explicitly distinguish from proxy_stop_transparent or proxy_deactivate_all.

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?

No guidance on when to use this tool versus alternatives like proxy_stop_transparent or proxy_deactivate_all. The description is purely functional.

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/yfe404/proxy-mcp'

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