Skip to main content
Glama
c3budiman

MCP Ping Server

by c3budiman
README.md
# MCP Ping Server

A Model Context Protocol (MCP) server that provides a `ping` tool to check connectivity and measure latency to websites and hosts.

## Features

- **Ping Tool**: Ping any hostname or IP address to check connectivity
- **Stdio Transport**: Uses standard input/output for MCP communication
- **Cross-platform**: Works on macOS, Linux, and Windows

## Installation

### Using npx (Recommended)

No installation needed! Use directly with npx:

```json
{
  "mcpServers": {
    "ping": {
      "command": "npx",
      "args": ["@c3budiman/ping"]
    }
  }
}
```

### Local Installation

```bash
npm install
npm run build
```

### Publishing to npm

```bash
npm run build
npm publish
```

## Usage

### As an MCP Server

The server communicates via stdio and can be configured in your MCP client settings:

**Using npx (no installation required):**
```json
{
  "mcpServers": {
    "ping": {
      "command": "npx",
      "args": ["@c3budiman/ping"]
    }
  }
}
```

**Using globally installed package (binary):**
```bash
npm install -g @c3budiman/ping
```

Then configure:
```json
{
  "mcpServers": {
    "ping": {
      "command": "mcp-ping"
    }
  }
}
```

**Using local installation:**
```json
{
  "mcpServers": {
    "ping": {
      "command": "node",
      "args": ["/path/to/mcp-ping/dist/index.js"]
    }
  }
}
```

### Development

Run in development mode:

```bash
npm run dev
```

## Tools

### ping

Pings a hostname or IP address to check connectivity and measure latency.

**Parameters:**
- `host` (string, required): The hostname or IP address to ping (e.g., "google.com", "8.8.8.8")

**Example:**
```json
{
  "name": "ping",
  "arguments": {
    "host": "google.com"
  }
}
```

## License

MIT