Local Utilities MCP Server

by arjshiv
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Supports Linux systems for port checking functionality, allowing users to identify processes running on specific ports.

  • Supports macOS systems for port checking functionality, allowing users to identify processes running on specific ports.

  • Provides access to Node.js version information, allowing clients to retrieve details about the Node.js environment running on the local system.

本地实用程序 MCP 服务器

一个模型上下文协议 (MCP) 服务器,提供对各种本地系统实用程序的访问。此服务器可与 Cursor 和其他兼容 MCP 的客户端配合使用,以快速访问系统信息。

特征

该服务器提供以下实用程序:

  • 时间和日期:以各种格式获取当前本地时间和日期,包括星期几
  • 主机名:获取系统的主机名
  • Public IP :获取机器的公网IP地址
  • 目录列表:列出指定目录的内容
  • Node.js 版本:获取当前运行的 Node.js 版本
  • 端口检查器:检查特定端口上正在运行的进程
  • 思考工具:在开发过程中记录、检索和分析想法

安装

全局安装

pnpm add -g localutils-mcp-server

与 npx 一起使用

您也可以直接使用 npx 运行服务器,而无需全局安装它:

npx localutils-mcp-server

用法

启动服务器

如果全局安装:

localutils-mcp

使用 npx:

npx localutils-mcp-server

与游标一起使用

通过在 Cursor 的设置中将该服务器配置为 MCP 服务器,即可与 Cursor 一起使用。

  1. 打开光标设置
  2. 导航至 MCP 部分
  3. 添加一个新的 MCP 服务器,配置如下:
    { "name": "localutils", "command": "npx", "args": ["localutils-mcp-server"] }

使用 MCP 检查器

您可以使用 MCP 检查器测试服务器:

pnpm run inspector

这将在http://localhost:5173启动 MCP 检查器。

可用工具

get_time_and_date

以各种格式返回当前本地时间和日期,包括:

  • 当地时间
  • 当地日期
  • 星期几
  • ISO 8601 格式
  • Unix时间戳

get_hostname

返回运行 MCP 服务器的机器的主机名。

get_public_ip

返回运行 MCP 服务器的机器的公共 IP 地址。

list_directory

列出指定目录的内容。

参数:

  • path (字符串,必需):要列出的目录路径

get_node_version

返回 MCP 服务器运行环境的 Node.js 版本信息。

check_port

检查特定端口上正在运行的进程。

参数:

  • port (数字或字符串,必需):要检查的端口号(1-65535)。字符串值将自动转换为数字。

示例响应(macOS/Linux):

{ "processes": [ { "command": "node", "pid": "12345", "user": "username", "fd": "12u", "type": "IPv4", "device": "0x1234567890", "size": "0t0", "node": "TCP", "name": "*:3000 (LISTEN)" } ], "message": "Found 1 process(es) using port 3000" }

think

用时间戳记录新想法。

参数:

  • thought (字符串,必需):要记录的思想内容

响应示例:

{ "success": true, "data": { "message": "Thought recorded successfully" } }

get_thoughts

检索所有记录的想法。

响应示例:

{ "success": true, "data": { "thoughts": [ { "timestamp": "2025-03-24T15:00:00.000Z", "content": "Need to update the documentation" } ] } }

clear_thoughts

清除所有记录的想法。

响应示例:

{ "success": true, "data": { "message": "All thoughts cleared" } }

get_thought_stats

返回有关记录的想法的统计数据。

响应示例:

{ "success": true, "data": { "totalThoughts": 1, "averageLength": 28, "oldestThought": "2025-03-24T15:00:00.000Z", "newestThought": "2025-03-24T15:00:00.000Z" } }

发展

建筑

pnpm run build

以开发模式运行

pnpm run dev

测试

pnpm test

Git 工作流

此仓库包含一个预提交钩子,可在每次提交之前自动构建服务器。这确保了构建文件在仓库中始终保持最新。

构建文件夹包含在 git 存储库中,以便更轻松地使用带有 npx 的包,而无需先构建它。

克隆存储库后设置预提交钩子:

pnpm install

这将安装依赖项并通过 Husky 设置预提交钩子。

执照

麻省理工学院

-
security - not tested
A
license - permissive license
-
quality - not tested

通过与 Cursor 和其他 MCP 客户端兼容的 MCP 服务器接口,快速访问本地系统实用程序,包括时间/日期、主机名、公共 IP、目录列表、Node.js 版本和端口使用情况。

  1. Features
    1. Installation
      1. Global Installation
      2. Using with npx
    2. Usage
      1. Starting the Server
      2. Using with Cursor
      3. Using the MCP Inspector
    3. Available Tools
      1. get_time_and_date
      2. get_hostname
      3. get_public_ip
      4. list_directory
      5. get_node_version
      6. check_port
      7. think
      8. get_thoughts
      9. clear_thoughts
      10. get_thought_stats
    4. Development
      1. Building
      2. Running in Development Mode
      3. Testing
      4. Git Workflow
    5. License
      ID: 64aimgvrdn