We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jasper-zsh/espidf-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
#!/usr/bin/env python3
"""
测试串口设备工具的独立脚本
"""
import sys
import os
from pathlib import Path
# 将项目根目录添加到Python路径中
sys.path.insert(0, str(Path(__file__).parent))
# 导入服务器模块
import server
def test_list_serial_ports():
"""测试列出串口设备的功能"""
print("Testing list_serial_ports function...")
# 调用函数
try:
# 由于list_serial_ports是一个工具装饰器函数,我们需要直接调用其内部实现
import serial.tools.list_ports
ports = []
for port in serial.tools.list_ports.comports():
# 只列出包含有效description的串口设备(非n/a)
if port.description and port.description.lower() != 'n/a':
ports.append({
'device': port.device,
'description': port.description,
'hwid': port.hwid
})
print(f"Found {len(ports)} serial ports:")
for port in ports:
print(f" - Device: {port['device']}")
print(f" Description: {port['description']}")
print(f" Hardware ID: {port['hwid']}")
print()
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
test_list_serial_ports()