Socket MCP Server
A powerful Model Context Protocol (MCP) Server designed for AI-assisted development. It enables your AI assistant to communicate via TCP/IP sockets directly.
Key Features
- Easy Integration: Connect to any TCP/IP device or service
- Ready to Use: Simple
pipinstallation with zero complex setup - Multi-Connection: Manage multiple socket connections simultaneously
- Packet Protocol: Custom start/end delimiter packet parsing
- Background Listener: Auto-receive and buffer packets with drop_oldest overflow policy
- Data Transmission: Send/receive text or binary (hex) data
- Dual Execution Modes: Supports STDIO (default) and HTTP modes
Installation
Ensure you have Python 3.10 or higher installed.
pip install da2-mcp-socket
Quick Start
# STDIO mode (for Cursor/Claude Desktop)
da2-mcp-socket
# HTTP mode (for Antigravity)
da2-mcp-socket --http --port 8000
Client Configuration
Cursor / Claude Desktop
{
"mcpServers": {
"socket": {
"command": "da2-mcp-socket",
"args": [],
"env": { "LOG_LEVEL": "INFO" }
}
}
}
Antigravity
{
"mcpServers": {
"socket": {
"serverUrl": "http://localhost:8000/mcp"
}
}
}
Available Tools (15)
Connection Management
| Tool | Description |
|---|---|
| connect | Connect to a TCP server (host:port) |
| disconnect | Close a specific connection |
| get_connection_status | Get status of active connection(s) |
Data Transmission
| Tool | Description |
|---|---|
| send_data | Send text or hex data through a connection |
| receive_data | Receive data from a connection (with timeout) |
| receive_line | Receive a line (until newline character) |
| receive_until | Receive until a specific terminator |
Protocol Management
| Tool | Description |
|---|---|
| set_protocol | Configure receive mode (raw/line/packet) with custom delimiters |
| receive_packet | Receive complete packet based on configured protocol |
| get_protocol | Get current protocol settings for a connection |
Background Listener
| Tool | Description |
|---|---|
| start_listening | Start background listener thread |
| stop_listening | Stop background listener |
| get_packets | Get all buffered packets (clears buffer) |
| get_buffer_status | Query buffer status (count/overflow) |
Server Info
| Tool | Description |
|---|---|
| get_server_info | Get server version and default settings |
Usage Examples
RFID Reader Connection (AL-510)
# 1. Connect to device
connect("192.168.248.70", 1001)
# 2. Set packet protocol: <0x0A>[data]<0x0D0A>
set_protocol("conn_id", mode="packet",
start_delimiter_hex="0A",
end_delimiter_hex="0D0A")
# 3. Send command (Inventory EPC+TID)
send_data("conn_id", "0A4055322C52322C302C360D", as_hex=True)
# 4. Receive packet
receive_packet("conn_id", timeout=5.0)
# → @2000/01/01 01:31:11.981-Antenna1-U3000E300...,RE28069952...
# 5. Disconnect
disconnect("conn_id")
Background Continuous Listening
# 1. Connect and set protocol
connect("192.168.248.70", 1001, max_buffer_packets=100)
set_protocol("conn_id", mode="packet", start_delimiter_hex="0A", end_delimiter_hex="0D0A")
# 2. Start background listener
start_listening("conn_id")
# 3. Get accumulated packets anytime
get_packets("conn_id")
# → { packets: [{data_hex, data_text, timestamp}, ...], count: 5 }
# 4. Query buffer status
get_buffer_status("conn_id")
# → { buffer: { count: 5, max: 100, overflow_count: 0 } }
# 5. Stop listening
stop_listening("conn_id")
HTTP Request
connect("example.com", 80)
send_data("conn_id", "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n")
receive_data("conn_id", size=4096, timeout=5.0)
disconnect("conn_id")
Default Settings
| Parameter | Default Value |
|---|---|
| Connection Timeout | 10.0 seconds |
| Read Timeout | 5.0 seconds |
| Buffer Size | 4096 bytes |
| Max Buffer Packets | 100 |
| Overflow Policy | drop_oldest |
License
MIT License
Copyright (c) 2026 Danny, DA2 Studio (https://da2.35g.tw)
Metadata
Release files for da2-mcp-socket 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| da2_mcp_socket-0.2.0.tar.gz | 17.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| da2_mcp_socket-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.1 kB
Release files / da2_mcp_socket-0.2.0.tar.gz
| Download URL | da2_mcp_socket-0.2.0.tar.gz |
|---|---|
| Size | 17.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a9c4d744d1a913f9b7c4017c567b9ffd24d32b5e34a28c755d979b1c464f184
|
|
BLAKE2b-256 checksum How to use checksums |
912a3bc4afc13bf021335248db3449e23d059919fabb1ba25f13957cffac1429
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / da2_mcp_socket-0.2.0-py3-none-any.whl
| Download URL | da2_mcp_socket-0.2.0-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
45eac2bb4f9de3e52e140a7b536d09bf9b1f81c1bd52bca64fda41c014fafe5d
|
|
BLAKE2b-256 checksum How to use checksums |
32bdbcd501a98dee2368c118cd316b391366850a12574c5aa8e758deeeb8062f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for da2-mcp-socket 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.