npx pc-mcp
npm install -g pc-mcp
然后可以这样使用:
pc-mcp
# 克隆仓库
git clone <repository-url>
cd pc-mcp
# 安装依赖
npm install
# 或
pnpm install
# 构建项目
npm run build
# 本地运行
node build/index.js
获取天气警报
get_alerts
参数:
state: 两字母州代码(例如:CA, NY)获取天气预报
get_forecast
参数:
latitude: 位置纬度(-90到90)longitude: 位置经度(-180到180)系统关机/重启
shutdown_system
参数:
delay: 关机前延迟(秒)force: 是否强制关机(无确认)restart: 是否重启(true)或关机(false)浏览器搜索
open_browser_search
参数:
keywords: 要搜索的关键词url: (可选)要打开的URLbrowser: (可选)要使用的浏览器(default, chrome, firefox, safari, edge)autoFindUrl: (可选)是否从搜索词智能推断URL捕获截图
capture_screenshot
参数:
savePath: (可选)保存截图的路径本工具使用美国国家气象服务(NWS) API获取天气数据,仅支持美国地区的天气信息查询。
应用程序会在当前工作目录下自动创建mcp-server-for-pc.log文件,记录所有操作和错误信息,便于故障排除。
要将此包发布到npm:
# 登录npm
npm login
# 构建项目(这会在npm publish时自动运行)
npm run build
# 发布包
npm publish
发布后,用户可以直接运行:
npx pc-mcp
ISC许可证
<a name="english"></a>
A Model Context Protocol (MCP) server for accessing weather data and system functions from PC.
npx pc-mcp
npm install -g pc-mcp
Then you can use it as:
pc-mcp
# Clone the repository
git clone <repository-url>
cd pc-mcp
# Install dependencies
npm install
# or
pnpm install
# Build the project
npm run build
# Run locally
node build/index.js
Get Weather Alerts
get_alerts
Parameters:
state: Two-letter state code (e.g., CA, NY)Get Weather Forecast
get_forecast
Parameters:
latitude: Latitude of the location (-90 to 90)longitude: Longitude of the location (-180 to 180)System Shutdown/Restart
shutdown_system
Parameters:
delay: Delay before shutdown (seconds)force: Whether to force shutdown (no confirmation)restart: Whether to restart (true) or shutdown (false)Browser Search
open_browser_search
Parameters:
searchTerm: Keywords to search forurl: (Optional) URL to openbrowser: (Optional) Browser to use (default, chrome, firefox, safari, edge)autoFindUrl: (Optional) Whether to intelligently infer URL from search termCapture Screenshot
capture_screenshot
Parameters:
savePath: (Optional) Path to save the screenshotThis tool uses the US National Weather Service (NWS) API for weather data, supporting weather information queries only for US regions.
The application automatically creates a mcp-server-for-pc.log file in the current working directory, recording all operations and error information for troubleshooting.
To publish this package to npm:
# Login to npm
npm login
# Build the project (this will run automatically with npm publish)
npm run build
# Publish the package
npm publish
After publishing, users can run it directly using:
npx pc-mcp
ISC License