Get the FREE Ultimate OpenClaw Setup Guide →

Subnet-Calculator

MCP server from melihteke/Subnet-Calculator-MCP-Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio melihteke-subnet-calculator-mcp-server python main.py

How to use

This MCP server provides a subnet calculator tool that runs as an MCP server using Server-Sent Events (SSE) transport. It accepts a CIDR notation input and returns subnet details including the network address, broadcast address, netmask, wildcard mask, usable host range, and the number of usable hosts. The server is powered by the FastMCP library, exposing the calculation functionality as an MCP tool that clients can connect to via SSE.

To use it, run the server and connect a compatible MCP client (such as Goose or Claude Desktop) configured to use the SSE endpoint. The server exposes its SSE endpoint (for example, at https://mcp-subnet-calculator.mteke.com/sse) so clients can subscribe to updates and request subnet calculations. When you provide a CIDR like 192.168.1.0/24, the server computes and returns details such as the network address (192.168.1.0), broadcast address (192.168.1.255), netmask (255.255.255.0), wildcard mask (0.0.0.255), usable host range (192.168.1.1 - 192.168.1.254), and the total number of usable hosts (254).

The tool is especially useful for quick network planning, validation of CIDR blocks, and ensuring correct subnetting in scripts or client configurations.

How to install

Prerequisites:

  • Python 3.7+
  • Internet access to install packages
  1. Clone the repository containing the Subnet Calculator MCP server or download the script files.
  2. Create and activate a Python virtual environment (optional but recommended):
    • python3 -m venv venv
    • source venv/bin/activate (Linux/macOS) or venv\Scripts\activate (Windows)
  3. Install required dependencies:
    • pip install fastmcp mcp[cli]
  4. Start the MCP server:
    • python main.py
  5. Ensure the server is reachable at its SSE endpoint (e.g., https://your-host/sse) and that clients can connect using the SSE transport.

Notes:

  • If you plan to run behind a reverse proxy or TLS termination, configure the appropriate SSL settings for SSE as needed.
  • You may run the server in a persistent process manager (e.g., systemd, pm2) for production use.

Additional notes

Tips and common issues:

  • Ensure you are using Python 3.7+ and have network access to install dependencies.
  • If you modify or relocate main.py, update the mcp_config accordingly to point to the correct script path.
  • The SSE endpoint is the primary transport for clients; verify firewall rules allow SSE connections.
  • No special environment variables are required by default; you can add env variables in the mcp_config if your deployment template supports it.
  • If using npm-based clients, remember this is a Python-based server; no npm package is required.

Related MCP Servers

Sponsor this space

Reach thousands of developers