MCP Network Tools

MCP Network Tools

A secure MCP server for network diagnostics, providing tools like ping, traceroute, whois, nslookup, dig, nmap, curl, and netstat through natural language interfaces.

Category
Visit Server

README

🌐 MCP Network Tools

Serveur MCP (Model Context Protocol) pour outils de diagnostic réseau

Un serveur MCP complet qui expose des outils de diagnostic réseau sécurisés via Claude Desktop, Claude Code et toute application compatible MCP.

✹ FonctionnalitĂ©s

🔧 Outils rĂ©seau disponibles

Outil Description ParamĂštres
ping Test de connectivité et latence host, count, timeout
traceroute Traçage de route réseau host, max_hops
whois Informations sur domaines/IP target
nslookup Résolution DNS domain, record_type
dig RequĂȘtes DNS avancĂ©es domain, record_type
nmap Scan de ports sécurisé host, ports, scan_type
curl RequĂȘtes HTTP/HTTPS url, method, headers
netstat Connexions réseau actives protocol, state

🚀 Modes de transport

  • stdio : Mode par dĂ©faut, compatible Claude Desktop/Code
  • http : Serveur HTTP pour intĂ©grations personnalisĂ©es

🔒 SĂ©curitĂ©

  • Validation stricte des paramĂštres d'entrĂ©e
  • Protection contre les injections de commandes
  • Limitation des privilĂšges et timeouts
  • Filtrage des domaines et IP sensibles

📋 PrĂ©requis

SystĂšme

  • Python 3.8+
  • Outils rĂ©seau systĂšme (ping, traceroute, nmap, etc.)

Installation des outils systĂšme

# Vérification automatique
./check_system.sh

# macOS (Homebrew)
brew install nmap whois bind traceroute

# Ubuntu/Debian
sudo apt-get install traceroute nmap whois dnsutils net-tools

# CentOS/RHEL/Fedora
sudo dnf install traceroute nmap whois bind-utils net-tools

🚀 Installation rapide

1. Clone du projet

git clone https://github.com/kerbart/mcp-network-tool.git
cd mcp-network-tool

2. Lancement automatique

# Setup complet + démarrage (stdio mode)
./run.sh

# Mode HTTP
./run.sh --transport http --port 8000

Le script run.sh se charge automatiquement de :

  • ✅ VĂ©rifier Python 3.8+
  • ✅ CrĂ©er l'environnement virtuel
  • ✅ Installer les dĂ©pendances
  • ✅ Lancer le serveur

📖 Installation manuelle

1. Environnement virtuel

python3 -m venv venv
source venv/bin/activate  # Linux/macOS
# ou venv\Scripts\activate  # Windows

2. Installation des dépendances

# Via requirements.txt
pip install -r requirements.txt

# Ou via pyproject.toml
pip install -e .

3. Vérification systÚme

./check_system.sh

4. Lancement du serveur

# Mode stdio (défaut)
python start.py

# Mode HTTP
python start.py --transport http --port 8000

🔧 Configuration avec Claude

Claude Desktop

Ajoutez Ă  votre claude_desktop_config.json :

{
  "mcpServers": {
    "network-tools": {
      "command": "python",
      "args": ["/chemin/vers/mcp-network-tools/start.py"],
      "env": {}
    }
  }
}

Claude Code

# Ajout du serveur MCP
claude mcp add network-tools /chemin/vers/mcp-network-tools/start.py

# Vérification
claude mcp list

Mode HTTP (optionnel)

{
  "mcpServers": {
    "network-tools-http": {
      "transport": {
        "type": "http",
        "url": "http://localhost:8000"
      }
    }
  }
}

💡 Utilisation

Exemples avec Claude

đŸ§‘â€đŸ’» "Peux-tu vĂ©rifier la connectivitĂ© vers google.com ?"

đŸ€– Je vais utiliser ping pour tester la connectivitĂ©...
[utilise l'outil ping avec host="google.com"]

đŸ§‘â€đŸ’» "Scanne les ports ouverts sur mon serveur 192.168.1.100"

đŸ€– Je vais scanner les ports courants...
[utilise l'outil nmap avec host="192.168.1.100"]

đŸ§‘â€đŸ’» "Trace la route vers cloudflare.com"

đŸ€– Je vais tracer la route rĂ©seau...
[utilise l'outil traceroute avec host="cloudflare.com"]

API HTTP (mode HTTP)

# Liste des outils
curl http://localhost:8000/tools

# Exécution d'un ping
curl -X POST http://localhost:8000/tools/ping \
  -H "Content-Type: application/json" \
  -d '{"arguments": {"host": "google.com", "count": 3}}'

# Health check
curl http://localhost:8000/health

📁 Structure du projet

mcp-network-tools/
├── src/                    # Code source principal
│   ├── tools/             # ImplĂ©mentations des outils
│   │   ├── ping.py
│   │   ├── traceroute.py
│   │   ├── nmap.py
│   │   └── ...
│   └── utils/             # Utilitaires
│       ├── security.py    # Validation sĂ©curisĂ©e
│       └── parsers.py     # Parseurs de sortie
├── start.py               # Point d'entrĂ©e principal
├── run.sh                 # Script de lancement automatique
├── check_system.sh        # VĂ©rification des prĂ©requis
├── requirements.txt       # DĂ©pendances Python
├── pyproject.toml         # Configuration du projet
└── README.md              # Cette documentation

🔧 DĂ©veloppement

Tests locaux

# Vérification des outils systÚme
./check_system.sh

# Test du serveur stdio
python start.py

# Test du serveur HTTP
python start.py --transport http
curl http://localhost:8000/

Ajout d'un nouvel outil

  1. Créer src/tools/mon_outil.py
  2. Implémenter la classe héritant de BaseTool
  3. Ajouter l'outil dans start.py
  4. Mettre Ă  jour la documentation

Variables d'environnement

# Logging
export MCP_LOG_LEVEL=DEBUG

# HTTP mode
export MCP_HOST=0.0.0.0
export MCP_PORT=8000

đŸ›Ąïž SĂ©curitĂ©

Mesures implémentées

  • ✅ Validation d'entrĂ©e : Tous les paramĂštres sont validĂ©s
  • ✅ Échappement de commandes : Protection contre l'injection
  • ✅ Limitation de privilĂšges : Pas de commandes sudo
  • ✅ Timeouts : PrĂ©vention des blocages
  • ✅ Filtrage rĂ©seau : Blocage des adresses sensibles

Recommandations

  • ExĂ©cutez avec un utilisateur non-privilĂ©giĂ©
  • Utilisez un firewall pour limiter l'accĂšs rĂ©seau
  • Surveillez les logs pour dĂ©tecter les abus
  • Mettez Ă  jour rĂ©guliĂšrement les dĂ©pendances

🐛 DĂ©pannage

ProblĂšmes courants

Erreur "command not found"

# Vérifiez les outils systÚme
./check_system.sh

# Installez les outils manquants
brew install nmap  # macOS
sudo apt install nmap  # Ubuntu

Erreur "Permission denied" pour nmap

# Les scans SYN nécessitent sudo
sudo nmap -sS target.com

# Utilisez les scans connect (sans sudo)
nmap -sT target.com

Erreur de dépendances Python

# Réinstallation complÚte
rm -rf venv/
./run.sh

Logs de débogage

# Mode verbose
python start.py --transport stdio --verbose

# Logs HTTP
python start.py --transport http --log-level debug

📚 Ressources

đŸ€ Contribution

  1. Fork le projet
  2. Créez une branche (git checkout -b feature/nouvelle-fonctionnalite)
  3. Committez vos changements (git commit -m 'Ajout nouvelle fonctionnalité')
  4. Poussez la branche (git push origin feature/nouvelle-fonctionnalite)
  5. Ouvrez une Pull Request

📄 Licence

Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.

đŸ‘„ Auteurs

  • Network Tools Team - DĂ©veloppement initial

⚠ Avertissement: Ces outils peuvent ĂȘtre utilisĂ©s Ă  des fins de diagnostic rĂ©seau lĂ©gitime uniquement. L'utilisation malveillante est interdite et peut ĂȘtre illĂ©gale dans votre juridiction.


🌟 Star ce repo si il vous a Ă©tĂ© utile !

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured