Telnet MCP Server
A secure telnet client for LLM applications, designed for defensive security analysis of network devices.
Telnet MCP Server
A Model Context Protocol (MCP) server that provides secure telnet client capabilities for Claude Code and other LLM applications. Designed for defensive security analysis of network devices.
Features
- Secure Telnet Client: Connect to router devices with command filtering
- MCP Protocol Support: Full JSON-RPC 2.0 compliance for Claude Code integration
- Security Features: Command filtering, audit logging, session management
- Router Management: Support for multiple concurrent router connections
- Comprehensive Logging: Detailed audit trail for compliance and security
Quick Start
Prerequisites
- Go 1.21 or later
- Claude Code or compatible MCP client
- Network access to target router devices
Installation
- Clone and build:
git clone <repository>
cd telnet-mcp-server
go mod tidy
go build -o telnet-mcp-server
- Configure Claude Code:
# Copy example configuration
cp claude_config_example.json ~/.config/claude-code/config.json
- Run with Claude Code:
claude-code
Configuration
Claude Code Integration
Add to your Claude Code configuration:
{
"mcpServers": {
"telnet-proxy": {
"transport": "stdio",
"command": "./telnet-mcp-server",
"env": {
"ROUTER_IPS": "10.98.1.131,10.98.1.171",
"LOG_LEVEL": "info"
}
}
}
}
Environment Variables
ROUTER_IPS: Comma-separated list of allowed router IP addressesLOG_LEVEL: Logging level (debug, info, warn, error)AUDIT_LOG_PATH: Path to audit log file (default: /tmp/telnet-mcp-audit.log)
Available Tools
telnet_connect
Connect to a router device.
Parameters:
host(required): Router IP addressport(optional): Telnet port (default: 23)timeout(optional): Connection timeout in seconds (default: 30)
telnet_execute_command
Execute a command on connected router.
Parameters:
host(required): Router IP addresscommand(required): Command to executetimeout(optional): Command timeout in seconds (default: 10)
telnet_disconnect
Disconnect from router device.
Parameters:
host(required): Router IP addressport(optional): Telnet port (default: 23)
Security Features
Command Filtering
The server uses a blacklist security model that allows most commands while blocking only dangerous operations:
Security Approach:
- ✅ Default Allow: All commands are permitted by default
- ❌ Minimal Blacklist: Only dangerous commands are blocked
- 🔍 Full Audit: All commands are logged regardless of status
Allowed Commands (Examples):
- File operations:
cat,head,tail,more,less,grep,find - System info:
ls,ps,top,df,free,uptime,whoami - Network tools:
ping,traceroute,nslookup,dig,netstat - Router commands:
show version,show config,show interfaces, etc. - Text processing:
awk,sed,sort,uniq,wc,cut
Blocked Commands:
- Configuration:
configure,config,write memory,wr - Destructive:
delete,del,erase,format,factory-reset - System control:
reload,reboot,restart,shutdown,halt,reset - Firmware:
boot(with space),upgrade,update
Audit Logging
All activities are logged to the audit file with timestamps:
- Connection events
- Command executions
- Security violations
- Error conditions
Usage Examples
Basic Router Analysis
# In Claude Code
Connect to router 10.98.1.131 and analyze its configuration for security vulnerabilities.
Network Discovery
# In Claude Code
Map the network topology by connecting to both routers and examining their routing tables.
Security Audit
# In Claude Code
Perform a comprehensive security audit of router 10.98.1.171, checking for default passwords, insecure protocols, and misconfigurations.
Development
Building
go build -o telnet-mcp-server
Testing
go test ./...
Running in Development
go run main.go
Security Considerations
- This tool is designed for defensive security analysis only
- All communications are logged for audit purposes
- Command filtering prevents destructive operations
- Use only on trusted internal networks
- Review audit logs regularly for security monitoring
Troubleshooting
Connection Issues
- Verify network connectivity to target devices
- Check firewall rules and port accessibility
- Ensure telnet service is running on target devices
- Review timeout settings in configuration
Command Execution Problems
- Check command syntax for your router type
- Verify command is in allowed list
- Review audit logs for blocked commands
- Ensure proper session state
Claude Code Integration
- Verify MCP server configuration path
- Check environment variables
- Review Claude Code logs for MCP errors
- Ensure server binary has execute permissions
License
MIT License - See LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Support
For issues and questions:
- Check the troubleshooting section
- Review audit logs
- Open an issue on GitHub
संबंधित सर्वर
Gemini Email Subject Generator MCP
Generates engaging email subjects and detailed thinking processes using Google's Gemini AI model.
DingDing Bot
Send various types of messages, including text, markdown, images, and files, to a DingDing group robot.
WeChat Official Account MCP Server (Go)
A high-performance Go server for managing WeChat Official Accounts, supporting drafts, publishing, and material management.
RocketMQ
A server for interacting with Apache RocketMQ, a distributed messaging and streaming platform, requiring environment variables for configuration.
MCP Notify
Monitor the Model Context Protocol (MCP) Registry for new, updated, and removed servers. Get real-time notifications via Discord, Slack, Email, Telegram, Microsoft Teams, Webhooks, or RSS feeds. Includes CLI, Go SDK, REST API, and MCP server for AI assistants.
AgentMail
A server for interacting with the AgentMail API for email communication. Requires an API key.
Instantly
Manage email campaigns and leads using the Instantly.ai v2 API.
Telegram Bot Gateway
A simple gateway to interact with Telegram bots using MCP and a REST API, enabling integration with LLMs.
Slack MCP Server
An MCP server for interacting with Slack workspaces using user tokens, without requiring bots or special permissions.
SimpleChatJS
A lightweight AI chat application with MCP support, built with pure JavaScript and Node.js.