Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
NetGet
LLM-Controlled Network Protocol Server & Client
NetGet is a Rust CLI application exposing 283 network protocols, with server and client roles controlled by an LLM (via Ollama). Instead of hardcoding protocol logic, NetGet provides the network stack while the LLM constructs raw protocol datagrams or high-level responses based on natural language instructions.
# Start a MySQL server that reads schema from files
# Start an SSH server with custom authentication
# Connect as HTTP client to test an API
Why NetGet?
Traditional Approach: Hardcode protocol behavior
match command
NetGet's Approach: Instruct the LLM in natural language
> act
The LLM handles the protocol details — status lines, headers, authentication exchanges — without any code changes.
Key Features
🌐 283 Network Protocols
Both server and client modes for:
Core Transport
- TCP, UDP, HTTP, HTTP/2, HTTP/3, TLS, DataLink
Application Protocols
- SSH, FTP, DNS, DHCP, SMTP, IMAP, MySQL, PostgreSQL, Redis
- MQTT, Kafka, gRPC, WebSocket, WebDAV, NFS, SMB
- WireGuard, Tor; IPSec and OpenVPN are honeypots, not working VPNs
Maturity varies a lot. Most protocols are
Experimental— LLM-authored and not human-reviewed. Runnetget --mcpand calllist_protocolsfor each protocol's current state, or read itsmetadata(). A few specifics worth knowing: FTP has no data connection, soLIST/RETR/STORcannot complete against a real client; OpenVPN is a control-plane honeypot — a realopenvpnbinary completes the TLS control channel and the key method 2 exchange, butPUSH_REQUESTis never answered, no data-channel keys are derived and there is no TUN device, so it observes clients and never carries traffic.
IoT & Hardware
- Bluetooth Low Energy (15+ GATT services: keyboard, mouse, heart rate, etc.)
- USB/IP (keyboard, mouse, serial, mass storage, FIDO2, smart card)
Routing & Infrastructure
- BGP, OSPF, IS-IS, RIP, mDNS, SNMP, NTP, Syslog
Specialized
- OAuth2, SAML, OpenID Connect, MCP, JSON-RPC, XML-RPC
- BitTorrent (tracker, DHT, peer), OpenAPI, Kubernetes, etcd
See the /docs command in the TUI for full protocol details and metadata.
🤖 LLM-Driven Intelligence
- Tool Calling: LLM can read files and search the web before responding
- Scripting Mode: Use Python/JavaScript for deterministic protocol logic (0 LLM calls)
- Scheduled Tasks: Time-based automation at global, server, or connection scope
- Memory: LLM maintains conversation history across requests
🖥️ Rich Terminal Interface
Rolling Terminal UI with sticky footer:
- Three-column layout: Active servers | Active clients | Status & stats
- Natural scrolling: Output flows into your terminal's scrollback buffer
- Multi-line input: Shift+Enter for complex commands
- Command history: Up/down arrows with persistent storage
- Log levels: Ctrl+L to toggle ERROR/WARN/INFO/DEBUG/TRACE
- Web search: Ctrl+W to enable LLM web search capability
Quick Start
Prerequisites
-
Install Ollama (LLM runtime)
| -
Install Rust (latest stable)
|
Installation
Option 1: npm (prebuilt binary, no Rust needed)
# Run directly (downloads the binary for your platform on first use)
# Or install globally
Prebuilt binaries cover macOS (arm64/x64), Linux (x64/arm64 glibc, x64 musl), and Windows x64. They need no system library: on Linux and Windows they leave out the few protocols that link one (packet capture, Bluetooth LE, the NFC client, USB devices, the SMB client); macOS ships those libraries, so its binaries include them. Tarballs are also on GitHub Releases.
Option 2: cargo (every protocol)
The crate is netget-tool (crates.io's netget is an unrelated project); the command it installs is netget. Every protocol is compiled in — there are no per-protocol features. The default build links five system libraries and builds llama.cpp (which needs cmake and libclang), so install those first:
# macOS (libpcap, PC/SC and CoreBluetooth ship with the OS)
# Debian / Ubuntu
# Fedora
# Arch
Without those libraries, leave out the protocols that need them (and the embedded llama.cpp):
Option 3: Build from source
Run Your First Server
# Start Ollama
# Start NetGet
# In the NetGet prompt, type:
> listen
Now visit http://localhost:8080 in your browser!
Architecture
NetGet uses an event-driven architecture where all network events flow through a central event handler that coordinates with the LLM:
┌─────────────────────────────────────────────────────────┐
│ Rolling Terminal UI │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────────┐ │
│ │ Active │ │ Active │ │ Connection Info & │ │
│ │ Servers │ │ Clients │ │ Stats │ │
│ └──────────┘ └──────────┘ └──────────────────────┘ │
│ ┌──────────────────────────────────────────────────┐ │
│ │ Status / Activity Log (Scrolling) │ │
│ └──────────────────────────────────────────────────┘ │
│ ┌──────────────────────────────────────────────────┐ │
│ │ Input: > your commands here (Shift+Enter) │ │
│ └──────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
│
┌──────────────────┴──────────────────┐
▼ ▼
┌──────────────────┐ ┌──────────────────────┐
│ Network Layer │ │ LLM Integration │
│ • TCP/UDP │◄─────────────►│ • Ollama Client │
│ • TLS │ │ • Tool Calling │
│ • Raw Sockets │ │ • Scripting │
│ • USB/IP │ │ • Web Search │
│ • Bluetooth │ │ │
└──────────────────┘ └──────────────────────┘
Key Modules
cli/- Terminal UI (rolling output, sticky footer, input handling)server/<protocol>/- Protocol server implementationsclient/<protocol>/- Protocol client implementationsprotocol/- Protocol registry and metadatallm/- Ollama integration and prompt engineeringllm/actions/- LLM action system (user-triggered and network-triggered)events/- Event coordination between network, LLM, and UIstate/- Application state management
Design Principles
- Decentralized Protocol Registry: Each protocol implements traits independently (no central switch statements except in startup)
- Dual Logging: All logs go to both tracing macros (→
netget.log) and status channel (→ TUI) - State Machine: Per-connection state (Idle → Processing → Accumulating) prevents concurrent LLM calls
- Every Protocol In Every Build: No per-protocol Cargo features; only the platform (browser, Windows) and five system-library features decide what is compiled
- No Protocol Storage: Protocols don't store data—LLM returns everything via actions/scripts/static responses
Usage Examples
Server Examples
HTTP Server with Dynamic Content
> listen
> For
> For
MySQL Server with Schema File
# Create schema file first
> act
> Answer
SSH Server with Custom Behavior
> SSH
> Allow
> When
> When
DNS Server with Dynamic Responses
> DNS
> For
> For
> For
Client Examples
HTTP Client Testing API
> connect
> Send
> Show
Redis Client Session
> connect
> Send:
> Send:
> Send:
TCP Client for Protocol Testing
> connect
> This
Advanced Features
Tool Calling (File Reading)
> act
> For
> For
The LLM will automatically call read_file() when handling requests.
Web Search Integration
# Enable web search
> act
> If
The LLM can search the web for protocol documentation, RFCs, or any other information.
Scripting Mode (Zero LLM Calls)
> listen
> Use
> For
> For
Scripting mode is deterministic and makes zero LLM calls after setup.
Scheduled Tasks
> listen
> Schedule
> Schedule
Tasks can be scoped to global (any server), server-specific, or connection-specific.
Managing Connections
> status # Show all active servers and clients
> close > close > close > model
Control NetGet from Another LLM (MCP)
NetGet can run as a Model Context Protocol server, exposing its protocol-server management as MCP tools. This lets an MCP client such as Claude Desktop or Claude Code start and drive network protocol servers directly.
STDIO transport (Claude Desktop / Claude Code)
Quickest path — npm prebuilt binary:
Or build from source (mcp-stdio is a default feature):
# Run as an MCP server over stdin/stdout
Claude Desktop config (claude_desktop_config.json):
(For a source build, set "command" to the binary path instead. First npx run downloads the package, so the initial MCP startup takes longer.)
HTTP transport (remote / web clients)
# mcp-http is a default feature
# Serve MCP over HTTP/SSE (bind address from --listen-addr, default 127.0.0.1)
# Any non-loopback bind requires a bearer token
NETGET_MCP_TOKEN=
With a token set — NETGET_MCP_TOKEN, or --mcp-token <TOKEN> — every request must carry
Authorization: Bearer <TOKEN>. Binding --listen-addr to anything but a loopback address
is refused without one; without a token the endpoint admits loopback Host/Origin only.
Prefer the environment variable: a --mcp-token argument is visible to every local user in
the process table.
Exposed tools
list_protocols, start_server, stop_server, list_servers, server_status,
get_status, set_model, get_protocol_docs, update_server_instruction, stop_all,
and for debugging: list_access_logs (recent requests) / get_access_log (full
request + response for one entry).
The protocol servers you start through MCP are driven by NetGet's own configured LLM
(local Ollama, or an OpenAI-compatible endpoint via --openai-url/--api-key). The
MCP client controls NetGet through the tools above; it does not supply the model.
Testing
NetGet has comprehensive test coverage with both unit tests and end-to-end tests.
Unit Tests (No Ollama Required)
Tests protocol parsing, registry, metadata, and core utilities.
E2E Tests (Ollama Required)
# Start Ollama first
# Run one protocol's E2E tests (every protocol is compiled in; select by module path)
# Run all of a protocol's tests (server + client)
E2E Test Philosophy:
- Black-box testing: Tests use real clients (curl, mysql CLI, ssh clients, etc.)
- LLM budget: Each test suite limited to < 10 LLM calls via aggressive caching
- Prompt-driven: Tests validate that LLM interprets prompts correctly
- Localhost only: All tests run on 127.0.0.1/::1 for privacy
Test Organization
- Unit tests:
tests/base_stack_test.rs(registry parsing, etc.) - Protocol E2E:
tests/server/<protocol>/e2e_test.rs,tests/client/<protocol>/e2e_test.rs - Documentation: Each protocol has TWO
CLAUDE.mdfiles:src/server/<protocol>/CLAUDE.md- Implementation detailstests/server/<protocol>/CLAUDE.md- Test strategy
Building
System Dependencies
Every protocol is compiled into every build; there are no per-protocol Cargo features. Five
features link a system library (all on by default, Unix only), and embedded-llm builds
llama.cpp:
| Feature | Library | Protocols |
|---|---|---|
libpcap |
libpcap (ships with macOS) | arp, datalink, isis, lldp, cdp, stp, eapol |
bluetooth |
D-Bus/BlueZ on Linux; CoreBluetooth on macOS | bluetooth-ble* |
pcsc |
pcsclite (ships with macOS) | the NFC client |
libusb |
libusb | the usb-* virtual devices |
libsmbclient |
libsmbclient (Homebrew samba) |
the SMB client |
embedded-llm |
cmake and a C++ compiler | in-process llama.cpp |
The install commands for each platform are under Installation above.
Build Strategies
# Everything (needs the libraries above)
# Everything that needs no system library
Claude Code for Web has none of the five libraries:
Build Performance Notes
- sccache: NetGet uses sccache for caching compiled artifacts
- No per-protocol features: every build compiles every protocol; narrow test runs with
filters (
--test server -- server::tcp::), not features - Isolated builds:
./cargo-isolated.shuses session-specific target directory to avoid conflicts - Parallel builds: Multiple instances can build concurrently;
./cargo-isolated.shserialises access to the sharedtarget/
Cargo Isolated Scripts
Output is automatically logged to ./tmp/netget-<command>-{PPID}.log.
Configuration
LLM Model Selection
Change at runtime (recommended):
> model
> model
> model
Default model: qwen3-coder:30b (configured in src/state/app_state.rs)
Ollama URL
Default: http://localhost:11434
To change, edit src/llm/client.rs:
Log Levels
- Runtime: Press
Ctrl+Lto cycle through ERROR → WARN → INFO → DEBUG → TRACE - Startup:
netget --debugenables debug logging tonetget.log
History
Command history is persisted to ~/.netget_history across sessions.
Protocol Implementation
Adding a New Server Protocol
See CLAUDE.md for the full 12-step checklist. Quick overview:
- Add feature to
Cargo.toml - Implement server in
src/server/<protocol>/mod.rs - Implement actions in
src/server/<protocol>/actions.rs - Register in
protocol/registry.rs(feature-gated) - Add match arm in
cli/server_startup.rs(feature-gated) - Write E2E test in
tests/server/<protocol>/e2e_test.rs - Document in
src/server/<protocol>/CLAUDE.mdandtests/server/<protocol>/CLAUDE.md
Adding a New Client Protocol
Similar to server, but:
- Implement in
src/client/<protocol>/mod.rsandactions.rs - Register in
protocol/client_registry.rs - Add match arm in
cli/client_startup.rs - See
CLIENT_PROTOCOL_FEASIBILITY.mdfor protocol evaluation criteria
Advanced Topics
Multi-Instance Collaboration
- Use
./cargo-isolated.shfor per-session build isolation - Use
--llm-max-concurrent(with--llm-queue-timeoutand--llm-max-queued) to bound LLM concurrency - Use git worktrees for concurrent development branches
- Never use
pkill cargo—use./cargo-isolated-kill.shinstead
Efficient Iteration
Build/test logging is automatic. Analyze all errors before rebuilding:
# Build and pipe last 50 lines
|
# Analyze ALL errors from saved log
|
# Fix ALL issues at once, then rebuild once
|
This saves 10-20 minutes per development cycle vs fixing one error at a time.
Protocol-Specific Documentation
Each protocol has detailed documentation:
- Implementation:
src/server/<protocol>/CLAUDE.mdorsrc/client/<protocol>/CLAUDE.md- Library choices, architecture, LLM integration, limitations
- Testing:
tests/server/<protocol>/CLAUDE.mdortests/client/<protocol>/CLAUDE.md- Test strategy, LLM call budget, runtime, known issues
Always read both before modifying a protocol.
Troubleshooting
Ollama Connection Failed
Error: Failed to connect to Ollama
Fix: Ensure Ollama is running: ollama serve
Model Not Found
Error: Model not found
Fix: Pull the model: ollama pull qwen3-coder:30b
Port Already in Use
Error: Address already in use
Fix: Choose a different port or kill the process using that port.
Build Fails with Missing Libraries
error: failed to run custom build command for `dbus`
Fix: Install the system libraries (see Installation), or build without them:
--no-default-features --features mcp-stdio,mcp-http,sqlite leaves out only the protocols
that link one.
Performance Considerations
- LLM latency: Each network event may trigger an LLM call (can be slow)
- Scripting mode: For deterministic protocols, use Python/JavaScript scripting (zero LLM calls)
- Caching: Connection state machine prevents concurrent LLM calls on same connection
- LLM concurrency:
--llm-max-concurrentbounds in-flight model calls; requests above it queue rather than being dropped
Use case: NetGet is ideal for protocol testing, security research, learning, and development. Not recommended for production high-throughput servers.
Contributing
NetGet is an experimental project exploring LLM-controlled networking. Contributions welcome!
Ideas for enhancement:
- New protocol implementations
- Better prompt engineering for existing protocols
- Scripting mode templates for common protocols
- Performance optimizations (caching, connection pooling)
- Additional tool calling capabilities
- Protocol fuzzing and security testing features
Files Created
NetGet creates the following files:
netget.log- Application logs (only with--debugflag)~/.netget_history- Command history (always created)./tmp/netget-*.log- Build/test logs fromcargo-isolated.sh
License
MIT