npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sylphlab/tools-net

v0.8.1

Published

Core logic for MCP network tools

Readme

@sylphlab/tools-net

NPM version

Core logic for network operations like HTTP requests and IP information retrieval.

This package provides the underlying logic and tool definitions for performing common network tasks. It's designed using @sylphlab/tools-core and serves as the foundation for MCP server packages like @sylphlab/tools-net-mcp and @sylphlab/tools-fetch-mcp.

Purpose

Network interaction is crucial for agents and applications needing external data or services. This package offers standardized tools for:

  • Fetching content from URLs via HTTP/HTTPS.
  • Retrieving information about the host system's network interfaces.
  • Discovering the host system's public IP address.
  • Downloading files from URLs.

By defining these tools with @sylphlab/tools-core, the logic becomes reusable and adaptable for various platforms.

Tools Provided

  • fetchTool: Performs HTTP/HTTPS requests (GET, POST, PUT, DELETE, etc.) to specified URLs, allowing configuration of method, headers, and body. Returns response status, headers, and body content.
  • getPublicIpTool: Retrieves the public IP address of the machine running the tool's handler.
  • getInterfacesTool: Lists the network interfaces available on the machine running the tool's handler, along with their IP addresses and other details.
  • downloadTool: Downloads a file from a given URL to a specified local path (within the allowed workspace).

Key Features

  • HTTP Requests: Flexible fetchTool for interacting with web APIs and resources.
  • Network Information: Tools to discover local and public IP configurations.
  • File Downloads: Utility for retrieving files from the web.
  • Standardized Definition: Uses the SylphTool structure from @sylphlab/tools-core.
  • Node.js Based: Leverages Node.js built-in modules (fetch, os) for core functionality.

Installation

This package is primarily intended for internal use within the mcp monorepo, serving as a dependency for MCP server packages that expose network capabilities.

# From the root of the monorepo
pnpm add @sylphlab/tools-net --filter <your-package-name>

Usage (Conceptual)

The tool definitions are typically consumed by adapters or MCP server implementations.

import { fetchTool, getPublicIpTool /* ... other tools */ } from '@sylphlab/tools-net';
import { adaptToolToMcp } from '@sylphlab/tools-adaptor-mcp'; // Example adapter

// Example: Using fetchTool definition directly
async function runFetch() {
  const input = { url: 'https://jsonplaceholder.typicode.com/todos/1', method: 'GET' };
  // Validate input against fetchTool.inputSchema...
  const output = await fetchTool.handler(input);
  // Validate output against fetchTool.outputSchema...
  if (output.status === 200) {
    console.log('Status:', output.status);
    console.log('Body:', output.body);
  } else {
    console.error('Fetch failed:', output.statusText);
  }
}

// Example: Adapting for MCP
const mcpNetTools = [
  fetchTool,
  getPublicIpTool,
  getInterfacesTool,
  downloadTool
].map(adaptToolToMcp);

// These adapted definitions would then be used to create an MCP server.

Dependencies

  • @sylphlab/tools-core: Provides defineTool and core types.
  • zod: For input/output schema definition and validation.

Developed by Sylph Lab.