Network Utilities

Ip In Range

Validates whether an IP address falls within a specified CIDR range using precise network calculations. Access via MCP in Cursor or Windsurf for AI-driven network analysis, or call GET /v1/network/ip-in-range directly. Returns boolean true/false with subnet details. Essential for firewall rules, access control, and network segmentation tasks.

API Endpoint

GET /v1/network/ip-in-range

Code Examples

curl "https://tinyfn.io/v1/network/ip-in-range" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/network/ip-in-range', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/network/ip-in-range',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's network tools:

{
  "mcpServers": {
    "tinyfn-network": {
      "url": "https://tinyfn.io/mcp/network",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I check if 192.168.1.50 is in the 192.168.1.0/24 subnet?

Pass the IP and CIDR as parameters to get a boolean result. The tool performs bitwise subnet calculations to determine membership accurately.

Can I use this tool with IPv6 addresses and ranges?

Yes, it supports both IPv4 and IPv6 CIDR notation. IPv6 example: checking if 2001:db8::1 falls within 2001:db8::/32.

What happens if I provide an invalid CIDR range format?

The tool validates CIDR syntax and returns an error for malformed ranges like missing subnet masks or invalid IP formats.

How can MCP agents use this for automated network security checks?

AI agents in Cursor or Cline can validate IP addresses against whitelist ranges, check firewall rule coverage, or audit network access patterns.

Does this handle edge cases like network and broadcast addresses?

Yes, it correctly identifies all addresses within the CIDR range, including network (.0) and broadcast (.255) addresses for standard subnets.

Try Ip In Range Now

Get your free API key and start using Ip In Range in seconds.

Get Free API Key