-
Notifications
You must be signed in to change notification settings - Fork 507
Description
Problem Statement
The current getNetworkLogs MCP tool is experiencing significant limitations when handling large datasets, resulting in token limit exceeded errors and poor user experience for data analysis workflows.
Current Issues Identified
1. Token Limit Exceeded
The getNetworkLogs tool frequently returns responses exceeding the 25,000 token limit, with observed cases reaching 43,088 tokens. 1 This causes the tool to fail entirely when network activity is high.
2. Lack of Pagination Support
The current MCP tool implementation lacks pagination parameters such as offset and limit. 1 The tool simply fetches all available data from the /network-success endpoint without any mechanism to retrieve data in manageable chunks.
3. No File Export Functionality
There is currently no built-in capability to export network logs to files for offline analysis. Users cannot save large datasets for later examination or share them with team members for collaborative debugging.
4. Missing Filtering Capabilities
The tool lacks filtering parameters to narrow down results by:
- Time range (start/end timestamps)
- HTTP status codes
- Request methods
- URL patterns
- Response size thresholds
Current System Architecture Context
The network logs flow through a three-tier architecture:
- Chrome Extension captures network requests 2
- Browser Tools Server stores and serves the data via
/network-successendpoint 3 - MCP Server exposes the
getNetworkLogstool to AI clients
The server already implements basic truncation logic 4 , but this is insufficient for large datasets.
Proposed Solutions
1. Implement Pagination Parameters
Add support for pagination parameters in the getNetworkLogs tool:
limit: Maximum number of entries to return (default: 50)offset: Number of entries to skip (default: 0)page: Page number for easier navigation
2. Add Filtering Parameters
Implement filtering capabilities:
timeRange: Object withstartandendtimestampsstatusCodes: Array of HTTP status codes to includemethods: Array of HTTP methods to filter byurlPattern: Regex pattern for URL matching
3. File Export Functionality
Add a new MCP tool exportNetworkLogs that:
- Accepts the same filtering parameters as
getNetworkLogs - Exports data to JSON/CSV format
- Returns file path or download link
- Supports large datasets without token limitations
4. Enhanced Response Format
Modify the response structure to include:
- Total count of available logs
- Current page information
- Pagination metadata (hasNext, hasPrevious)
- Export options availability
Implementation Priority
- High Priority: Pagination support to immediately resolve token limit issues
- Medium Priority: Basic filtering (time range, status codes)
- Medium Priority: File export functionality
- Low Priority: Advanced filtering options
Expected Benefits
- Eliminates token limit exceeded errors
- Enables efficient analysis of large network datasets
- Improves debugging workflow for complex applications
- Provides better data management capabilities for development teams
- Maintains backward compatibility with existing implementations
This enhancement will significantly improve the usability of the BrowserTools MCP system for analyzing network activity in production applications.
Wiki pages you might want to explore: