Skip to main content
Glama
JackXuyi

Current operating environment

getVpnInfo

Retrieve VPN connection details for the current device to verify network configuration and security status.

Instructions

获取当前设备的 VPN 信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execution handler for the 'getVpnInfo' tool. It fetches all network interfaces using os.networkInterfaces(), identifies potential VPN interfaces by checking for names starting with 'tun' or 'ppp', extracts relevant details (address, netmask, family, internal), and returns them as a JSON-formatted text content block.
    case "getVpnInfo": { const networkInterfaces = os.networkInterfaces(); const vpnInterfaces: Record<string, any> = {}; for (const [interfaceName, interfaces = []] of Object.entries(networkInterfaces)) { // 检测常见的 VPN 接口名称(如 tun0, ppp0, etc) if (interfaceName.startsWith('tun') || interfaceName.startsWith('ppp')) { vpnInterfaces[interfaceName] = interfaces.map((info) => ({ address: info.address, netmask: info.netmask, family: info.family, internal: info.internal })); } } return { content: [{ type: "text", text: JSON.stringify(vpnInterfaces, null, 2) }] };
  • src/index.ts:137-144 (registration)
    Registration of the 'getVpnInfo' tool in the list returned by the ListToolsRequestSchema handler, including its name, description, and input schema.
    name: "getVpnInfo", description: "获取当前设备的 VPN 信息", inputSchema: { type: "object", properties: {}, required: [] } },
  • Input schema for the 'getVpnInfo' tool, defining an empty object (no required parameters).
    inputSchema: { type: "object", properties: {}, required: [] }
  • src/index.ts:790-790 (registration)
    Registration of the CallToolRequestSchema handler function, which routes tool calls to their respective switch case implementations, including 'getVpnInfo'.
    server.setRequestHandler(CallToolRequestSchema, handleCallToolRequest);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/JackXuyi/env-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server