🐍 ☁️ - Internet speed testing: download and upload speed, latency, jitter, and CDN server detection with…
MCP Internet Speed Test
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
An implementation of a Model Context Protocol (MCP) for internet speed testing. It allows AI models and agents to measure, analyze, and report network performance metrics through a standardized interface.
**📦 Available on PyPI:** https://pypi.org/project/mcp-internet-speed-test/
**🚀 Quick Start:**
What is MCP?
The Model Context Protocol (MCP) provides a standardized way for Large Language Models (LLMs) to interact with external tools and data sources. Think of it as the "USB-C for AI applications" - a common interface that allows AI systems to access real-world capabilities and information.
Features
- **Smart Incremental Testing**: Uses SpeedOf.Me methodology with 8-second threshold for optimal accuracy
- **Download Speed Testing**: Measures bandwidth using files from 128KB to 128MB from GitHub repository (Git LFS)
- **Upload Speed Testing**: Tests upload bandwidth using streaming data from 128KB to 128MB
- **Latency Testing**: Measures network latency using multiple samples, reports minimum value
- **Jitter Analysis**: Calculates network stability using multiple latency samples (default: 5)
- **Multi-CDN Support**: Detects and provides info for Fastly, Cloudflare, and AWS CloudFront
- **Geographic Location**: Maps POP codes to physical locations (50+ locations worldwide)
- **Cache Analysis**: Detects HIT/MISS status and cache headers
- **Server Metadata**: Extracts detailed CDN headers including x-served-by, via, x-cache
- **Comprehensive Testing**: Single function to run all tests with complete metrics
Installation
Prerequisites
- Python 3.12 or higher (required for async support)
- pip or uv package manager
Option 1: Install from PyPI with pip (Recommended)
Option 2: Install from PyPI with uv
Option 3: Using docker
Option 4: Development/Local Installation
If you want to contribute or modify the code:
Dependencies
The package automatically installs these dependencies:
- mcp[cli]>=1.25.0: MCP server framework with CLI integration
- httpx>=0.27.0: Async HTTP client for speed tests
Configuration
To use this MCP server with Claude Desktop or other MCP clients, add it to your MCP configuration file.
Claude Desktop Configuration
Edit your Claude Desktop MCP configuration file:
Option 1: Using pip installed package (Recommended)
Option 2: Using uvx
API Tools
The MCP Internet Speed Test provides the following tools:
Testing Functions
1. measure_download_speed: Measures download bandwidth (in Mbps) with server location info
2. measure_upload_speed: Measures upload bandwidth (in Mbps) with server location info
3. measure_latency: Measures network latency (in ms) using samples, reports minimum value
4. measure_jitter: Measures network jitter by analyzing latency variations with server info
5. get_server_info: Get detailed CDN server information for any URL without running speed tests
6. run_complete_test: Comprehensive test with all metrics and server metadata
CDN Server Detection
This speed test now provides detailed information about the CDN servers serving your tests:
What You Get
- **CDN Provider**: Identifies if you're connecting to Fastly, Cloudflare, or Amazon CloudFront
- **Geographic Location**: Shows the physical location of the server (e.g., "Mexico City, Mexico")
- **POP Code**: Three-letter code identifying the Point of Presence (e.g., "MEX", "QRO", "DFW")
- **Cache Status**: Whether content is served from cache (HIT) or fetched from origin (MISS)
- **Server Headers**: Full HTTP headers including x-served-by, via, and x-cache
Technical Implementation
Smart Testing Methodology
- **Incremental Approach**: Starts with small files (128KB) and progressively increases (powers of 2)
- **Time-Based Threshold**: Uses configurable sustain_time (1-8 seconds, default: 8). Stops when a sample exceeds the threshold
- **Accuracy Focus**: The speed from the last sample that took ≥ 8 seconds is used as the final measurement