Back to MCP directory
publicPublicdnsLocal runtime

mcp-ping

一个用于演示FastMCP使用的MCP服务器,提供主机ping功能

article

README

🚀 MCP Ping

MCP Ping 用于对主机进行ping操作并返回结果。该工具主要用于演示如何使用 FastMCP ,你可以在 这里 查看具体的演示代码。

🚀 快速开始

工具使用

使用以下命令运行 MCP Ping:

mcp-ping

测试

使用以下命令对工具进行测试:

npm run test

📚 详细文档

MCP 服务器配置文件

以下是 MCP 服务器的配置文件示例:

{
  "prompts": [],
  "resources": [],
  "tools": [
    {
      "annotations": {
        "openWorldHint": false,
        "readOnlyHint": true,
        "title": "Ping"
      },
      "description": "Pings a host and returns the result",
      "inputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "additionalProperties": false,
        "properties": {
          "host": {
            "description": "The hostname or URL to ping (e.g., 'google.com' or 'https://google.com')",
            "type": "string"
          }
        },
        "required": ["host"],
        "type": "object"
      },
      "name": "ping"
    }
  ]
}

ping 工具示例响应

以下是 ping 工具对 glama.ai 进行ping操作的示例响应:

Ping results for glama.ai:

PING glama.ai (37.16.29.120): 56 data bytes
64 bytes from 37.16.29.120: icmp_seq=0 ttl=55 time=11.273 ms
64 bytes from 37.16.29.120: icmp_seq=1 ttl=55 time=11.353 ms
64 bytes from 37.16.29.120: icmp_seq=2 ttl=55 time=11.455 ms
64 bytes from 37.16.29.120: icmp_seq=3 ttl=55 time=12.634 ms

--- glama.ai ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 11.273/11.679/12.634/0.555 ms

⚠️ 重要提示

此 MCP 服务器主要用于 演示 如何使用 FastMCP

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client