Token导航 LogoToken导航TokenDH.com
Wifi MCP Server logo
AI代理stdio官方级别未说明来源级核验

Wifi MCP Server

MCP Server

一个提供WiFi网络监控和管理工具的模型上下文协议(MCP)服务器,可与Continue.dev、Claude Desktop或任何MCP兼容客户端集成,使AI助手能够实时访问WiFi信息。

工具数

4

提示词数

0

GitHub Stars

1

资源数

0
网络管理PythonClaude实时数据Claude DesktopClaudeVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

krish2718

提供方

krish2718

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

WiFi MCP服务器

提供WiFi网络监控和管理工具的模型上下文协议(MCP)服务器。该服务器可以与Continue.dev、Claude Desktop或任何兼容MCP的客户端集成,使AI助手能够实时访问WiFi信息。

特性

  • 📡 WiFi网络扫描:发现可用的无线网络
  • 📊 连接状态:获取当前WiFi连接详细信息
  • 📶 信号强度:监控信号质量和强度指标
  • 🔌 接口管理:列出并管理网络接口
  • 🔄 实时更新:实时监控网络状况

先决条件

  • Python 3.8或更高版本
  • 具有WiFi功能的Linux系统
  • 网络管理工具: iw, iwconfig, ip (通常预装)
  • 某些网络操作的Root/sudo访问权限

安装

快速设置

# Clone or navigate to the project directory
cd ~/wifi-mcp-server

# Install dependencies
pip install -r requirements.txt

# Optional: Install in development mode
pip install -e .

虚拟环境的替代设置

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

运行演示

1.独立测试

测试不集成MCP的WiFi工具:

# Run standalone tests
python3 standalone_test.py

# Or use the Makefile
make test-standalone

2.MCP服务器测试

测试MCP服务器的完整功能:

# Test all MCP tools
python3 test_wifi_server.py ./wifi_mcp_server.py

# Or use the Makefile
make test-mcp

3.运行MCP服务器

在stdio模式下启动服务器(用于与MCP客户端集成):

# Run the server directly
python3 wifi_mcp_server.py

# Or using the provided script
./run_server.sh

集成示例

VS代码MCP集成

要将WiFi MCP服务器与Visual Studio代码集成,请将以下内容添加到VS代码设置中(~/.config/Code/User/settings.json):

{
    "mcp": {
        "servers": {
            "wifi-mcp-server": {
                "type": "stdio",
                "command": "~/wifi-mcp-server/wifi_mcp_server.py",
                "args": []
            }
        }
    }
}

这使得基于MCP的WiFi工具可以直接在VS Code中使用。

可用工具

1. scan_wifi

扫描可用的WiFi网络

参数:

  • interface (可选):WiFi接口名称(例如“wlan0”)

示例用法:

# In Continue.dev chat:
"Scan for available WiFi networks"

2. get_wifi_status

获取当前WiFi连接状态

参数:

  • interface (可选):WiFi接口名称

示例用法:

# In Continue.dev chat:
"What's my current WiFi status?"

3. get_signal_strength

获取详细的信号强度和质量指标

参数:

  • interface (可选):WiFi接口名称

示例用法:

# In Continue.dev chat:
"Check my WiFi signal strength"

4. list_interfaces

列出所有可用的网络接口

示例用法:

# In Continue.dev chat:
"Show me all network interfaces"

演示场景

基础网络监控

  1. 检查当前状态:
   "What's my current WiFi status?"
  1. 扫描网络:
   "Scan and list available WiFi networks"
  1. 监控信号质量:
   "How strong is my WiFi signal?"

故障排除工作流

  1. 网络诊断:
   "Help me diagnose my WiFi connection issues"
  1. 比较网络:
   "Show me all available networks and their signal strengths"
  1. 接口信息:
   "List all my network interfaces and their status"

发展

项目结构

wifi-mcp-server/
├── wifi_mcp_server.py          # Main MCP server implementation
├── test_wifi_server.py         # MCP server test suite
├── standalone_test.py          # Standalone functionality tests
├── requirements.txt            # Python dependencies
├── setup.py                    # Package setup configuration
├── Makefile                    # Build and test commands
└── README.md                   # This file

运行测试

# Run all tests
make test

# Run specific test suites
make test-standalone  # Test WiFi functions directly
make test-mcp        # Test MCP server functionality

# Run with verbose output
python3 test_wifi_server.py ./wifi_mcp_server.py

开发设置

# Set up development environment
make dev-setup

# Install in development mode
make install

# Format code
make lint

故障排除

常见问题

  1. 权限错误:
   # Some WiFi operations require sudo
   sudo python3 wifi_mcp_server.py
  1. 缺少依赖关系:
   pip install mcp
  1. 未找到网络工具:
   # Install wireless tools (Ubuntu/Debian)
   sudo apt install wireless-tools iw net-tools

   # Install wireless tools (CentOS/RHEL)
   sudo yum install wireless-tools iw net-tools
  1. MCP服务器未启动:
   # Check if MCP library is installed
   python3 -c "import mcp; print('MCP installed successfully')"

   # Run server with debug output
   python3 wifi_mcp_server.py 2>&1 | tee debug.log

调试模式

通过设置环境变量启用调试日志记录:

export DEBUG=1
python3 wifi_mcp_server.py

检查集成

  1. 直接测试MCP服务器:
   echo '{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | python3 wifi_mcp_server.py
  1. 验证Continue.dev集成:

- 检查Continue.dev日志: ~/.continue/logs/continue.log - 查找MCP服务器加载消息 - 使用简单的WiFi查询进行测试

  1. 检查网络接口:
   # List wireless interfaces
   iw dev

   # Check interface status
   ip link show

许可证

此项目根据LICENSE文件中指定的条款获得许可。

示例输出

WiFi状态示例

{
    "interface": "wlan0",
    "connected_ssid": "ExampleSSID",
    "access_point": "00:11:22:33:44:55",
    "bit_rate": 300.0,
    "link_quality": {
        "current": 40,
        "max": 70
    },
    "signal_level": -60
}

网络扫描示例

{
    "interface": "wlan0",
    "networks": [
        {
            "bssid": "00:11:22:33:44:55",
            "frequency": 5180.0,
            "signal": -60,
            "ssid": "ExampleSSID"
        },
        {
            "bssid": "66:77:88:99:AA:BB",
            "frequency": 2412.0,
            "signal": -50,
            "ssid": "GuestNetwork"
        }
    ],
    "scan_time": 1234567.890123
}

______________________________________________________________________

快速入门演示

1.设置和安装

# Clone or navigate to the project directory
cd ~/wifi-mcp-server

# Option A: Quick setup (system Python)
pip install -r requirements.txt

# Option B: Development setup with virtual environment
make dev-setup
source venv/bin/activate  # Activate the virtual environment

2.测试WiFi功能

# Test standalone WiFi functions (no MCP required)
python3 standalone_test.py

# Expected output: Lists interfaces, shows WiFi status, etc.

3.测试MCP服务器

# Test the full MCP server with all tools
python3 test_wifi_server.py ./wifi_mcp_server.py

# Expected output: JSON responses for scan, status, signal strength

4.运行MCP服务器

# Start the server in stdio mode
python3 wifi_mcp_server.py

# The server will wait for JSON-RPC commands via stdin
# Press Ctrl+C to stop

5.与VS Code集成

将以下内容添加到您的VS代码设置中(~/.config/Code/User/settings.json):

{
    "mcp": {
        "servers": {
            "wifi-mcp-server": {
                "type": "stdio",
                "command": "~/wifi-mcp-server/wifi_mcp_server.py",
                "args": []
            }
        }
    }
}

6.在本地运行代理

# Start the MCP server in HTTP mode
nohup python3 wifi_mcp_server.py --mode http &
python3 ./wifi_agent.py --llm-url http://localhost:8000 -model llama3.1:8b --wifi-server-url http://localhost:8080
注: 为了使用英特尔GPU加速运行Olama,我使用了 mattcurf/ollama英特尔gpu Docker服务。这使得在英特尔硬件上能够进行高效的LLM推理。

6.演示命令

集成后,在VS Code聊天中尝试以下命令:

"What's my current WiFi status?"
"Scan for available WiFi networks"
"Check my WiFi signal strength"
"List all network interfaces"

目录标签

目录标签

网络管理PythonClaude实时数据WiFi监控本地部署MCP协议AI集成

支持客户端

Claude DesktopClaudeVS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP