MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / connect

Method connect

examples/MCP Client/client.py:41–54  ·  view source on GitHub ↗

Connect to Serial Studio API server

(self)

Source from the content-addressed store, hash-verified

39 self._buffer = b""
40
41 def connect(self):
42 """Connect to Serial Studio API server"""
43 try:
44 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
45 self.sock.connect((self.host, self.port))
46 print(f"✓ Connected to Serial Studio at {self.host}:{self.port}")
47 except ConnectionRefusedError:
48 print(f"\n✗ Connection refused to {self.host}:{self.port}")
49 print("\nMake sure:")
50 print(" 1. Serial Studio is running")
51 print(" 2. API Server is enabled in Settings (⚙️)")
52 print(' Enable "Enable API Server (Port 7777)" switch')
53 print(" 3. No firewall is blocking port 7777\n")
54 raise
55
56 def send_request(self, method, params=None):
57 """Send MCP JSON-RPC 2.0 request"""

Callers 3

mainFunction · 0.95
connect_to_serial_studioFunction · 0.45
lte_mqtt.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected