Skip to main content
Glama

Bluetooth MCP Server

bluetooth_mcp_server.cpython-311.pyc3.64 kB
� G�ge � �"�ddlmZmZddlZddlmZmZmZmZddl Z ddl m Z e ��ddl m Z ed��Ze jdd��Zee jd d ����Ze jd d �����d kZe���edefd edeededeeeffd���Ze�d��dedeeeffd���Zedkre���dSdS)�)�FastMCP�ContextN)�List�Dict�Any�Optional)� load_dotenv)� BluetoothToolzBluetooth MCP Server�BLUETOOTH_API_URLzhttp://localhost:8000�BLUETOOTH_SCAN_DURATIONz5.0�BLUETOOTH_INCLUDE_CLASSIC�true�duration� filter_name�include_classic�returnc�� |||d�}tjt�d�|���}|���|���S#tj$r,}dt |����t |��d�cYd}~Sd}~wwxYw)u* Effectue un scan des appareils Bluetooth à proximité. Args: duration: Durée du scan en secondes filter_name: Nom de l'appareil à filtrer include_classic: Inclure les appareils Bluetooth classiques Returns: Résultats du scan Bluetooth )rrrz/mcp/v1/tools/bluetooth-scan)�jsonzBluetooth scan failed: ��error�detailsN)�requests�postr �raise_for_statusr�RequestException�str)rrr� scan_params�response�es �3F:\DEV\bluetooth-mcp-server\bluetooth_mcp_server.py�bluetooth_scanr!s���" �!�&�.� � � ��=�$5�!S�!S�!S�Ze�f�f�f���!�!�#�#�#��}�}����� � $� � � �7�s�1�v�v�7�7��1�v�v� � � � � � � � ����� ���s�A A�B �!B�>B �B zbluetooth://{device_id}� device_idc� � tjt�d|����}|���|���S#tj$r,}dt |����t |��d�cYd}~Sd}~wwxYw)u� Récupère les informations détaillées d'un appareil Bluetooth spécifique. Args: device_id: Identifiant de l'appareil Bluetooth Returns: Informations détaillées de l'appareil z/mcp/v1/devices/z Could not retrieve device info: rN)r�getr rrrr)r"rrs r �get_bluetooth_device_infor%<s���  ��<�#4� Q� Q�i� Q� Q�R�R���!�!�#�#�#��}�}����� � $� � � �@��A���@�@��1�v�v� � � � � � � � ����� ���s�AA�B�!A>�8B�>B�__main__)�mcp.server.fastmcprrr�typingrrrr�os�dotenvr �mcp_sdk.bluetooth_toolr �mcp�getenvr �floatr �lowerr �toolr�boolr!�resourcer%�__name__�run��r �<module>r7s���/�/�/�/�/�/�/�/�����,�,�,�,�,�,�,�,�,�,�,�,� � � � ������� � � � � �1�0�0�0�0�0��g�$�%�%���B�I�1�3J�K�K���%� �� �*C�U� K� K�L�L��%�B�I�&A�6�J�J�P�P�R�R�V\�\�������-�!%�5�" �" ��" ��#��" ��" � �#�s�(�^� " �" �" � ��" �J���'�(�(� �� ��c�3�h�� � � �)�(� �, �z����G�G�I�I�I�I�I��r6

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/Hypijump31/bluetooth-mcp-server'

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