- Home
- MCP servers
- TcpSocket
TcpSocket
- python
8
GitHub Stars
python
Language
4 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"spaceykasey-tcpsocketmcp": {
"command": "TcpSocketMCP",
"args": []
}
}
}You gain direct, low-level access to raw TCP sockets through this MCP server, letting you interact with network services and devices without HTTP wrappers. It supports multiple concurrent connections, buffering, and automatic responses based on trigger patterns, making it ideal for protocol debugging, legacy integrations, and automated testing of TCP-based systems.
How to use
You connect to a TCP service, send data, and read back responses using a sequence of simple operations. Start a connection, transmit the data you need, and then read from the connection buffer when data arrives. You can also set automatic responses that trigger when incoming data matches a pattern. When you are done, close the connection to free up resources.
How to install
Prerequisites: you need Python and a modern Python package manager. You can also use an offering that installs a runtime convenience tool for you.
Step 1: Clone the project repository and move into its directory.
Step 2: Install in editable mode using the recommended runtime helper.
Step 3: Run the server directly to start listening for TCP connections.
Configuration and startup details
You can configure the MCP server for Claude Desktop in two ways. The first approach uses an installed package directly, while the second runs from source.
Option 1: Using the installed package (recommended)
{
"mcpServers": {
"tcp-socket": {
"command": "TcpSocketMCP",
"env": {}
}
}
}
Usage from source
{
"mcpServers": {
"tcp-socket": {
"command": "python",
"args": ["/path/to/tcp-socket-mcp/run.py"],
"env": {}
}
}
}
Available tools
tcp_connect
Opens a TCP connection to a host:port and returns a connection_id for subsequent operations.
tcp_send
Sends data over an established connection with optional encoding (utf-8, hex, base64) and an optional terminator.
tcp_read_buffer
Reads data from the connection’s receive buffer; supports partial reads via index/count and different formats (utf-8, hex, base64).
tcp_disconnect
Closes the connection and frees resources; automatically removes any associated triggers.
tcp_set_trigger
Registers automatic responses for pattern matches, including regex patterns with capture groups; triggers fire when data matches.
tcp_connect_and_send
Connects and sends in one atomic operation for time-sensitive handshakes.
tcp_list_connections
Lists all active connections with statistics.
tcp_connection_info
Provides detailed information about a specific connection.
tcp_buffer_info
Reports statistics about the receive buffer without consuming data.
tcp_clear_buffer
Clears the receive buffer for a connection.
tcp_remove_trigger
Removes a previously registered trigger.