用于查询基线Web特性数据的服务器。它使用了@modelcontextprotocol/sdk构建,并使用了web-features包作为数据源。它是为Baseline工具2025黑客马拉松而创建的。
有两种方式可以使用基线MCP服务器:
使用下面的折叠面板来配置您的客户端。
<details> <summary>通过Gemini CLI和Gemini代码助手连接</summary>在您的~/.gemini/settings.json中,向mcpServers数组添加以下对象之一。
{
"name": "baseline-mcp",
"command": ["npx", "mcp-remote", "https://baseline-mcp.netlify.app/mcp"]
}
</details>
<details>
<summary>通过VS Code Copilot连接</summary>
在您的settings.json或.vscode/mcp.json中,添加以下配置。
"mcp": {
"servers": {
"baseline-mcp": {
"command": "npx",
"args": ["mcp-remote", "https://baseline-mcp.netlify.app/mcp"]
}
}
}
</details>
如果您想要修改或为此工具做出贡献,请按照以下说明进行本地设置。
git clone <repository-url>cd baseline-mcp安装依赖项:
npm install
构建服务器:
npm run build
运行服务器:
npm start
要查看服务器的功能,您可以使用inspect脚本。这对于查看服务器公开的所有工具和提示列表非常有用。
npm run inspect
一旦服务器运行起来,您就可以向其发送JSON-RPC请求。服务器公开了以下工具和提示:
create-study-guide: 创建一个关于Web特性的学习指南。find-features-in-file: 在给定文件或目录中查找基线特性。suggest-baseline-features: 根据目标描述建议基线特性。min-browser-support-report: 获取一组文件中的特性所需的最低浏览器支持并显示报告。list-features: 返回所有可用的基线Web特性的列表。discouraged-features: 返回所有不鼓励使用的Web特性的列表。get-feature-details: 获取特定Web特性的所有详细信息。get-feature-by-status: 获取具有特定基线状态的所有Web特性。get_features_by_caniuse_id: 根据caniuse.com特性ID获取Web-features特性。get_features_with_spec_url: 获取引用特定规范URL的所有Web特性。get_features_by_compat_feature: 根据@mdn/browser-compat-data特性键获取Web-features特性。get_baseline_high_since: 获取自给定日期以来达到“基线高”状态(广泛支持)的所有Web特性。get_baseline_low_since: 获取自给定日期以来达到“基线低”状态(新支持)的所有Web特性。get_baseline_low_last_30_days: 获取过去30天内达到“基线低”状态的所有Web特性。get_baseline_high_last_30_days: 获取过去30天内达到“基线高”状态的所有Web特性。get_baseline_status_changes_last_30_days: 列出过去30天内基线状态发生变化的所有Web特性,显示过渡情况。get_features_by_description_keyword: 在Web特性的描述中搜索关键词。get_features_by_name_keyword: 在Web特性的名称中搜索关键词。get_features_with_multiple_spec_urls: 返回具有多个规范URL的Web特性。get_features_with_no_spec_url: 返回没有规范URL的Web特性。get_features_with_alternatives: 返回所有有推荐替代方案的不鼓励使用的Web特性。get_feature_alternative: 获取不鼓励使用的Web特性的推荐替代方案。get_random_feature: 返回一个随机的Web特性。list_features_in_file: 分析提供的文件内容并列出其中使用的基线Web特性。suggest_baseline_feature: 根据关键词匹配查询建议一个基线Web特性。get_latest_browser_versions: 返回每个主要浏览器的最新版本。check_feature_support: 检查浏览器从哪个版本开始支持特定的Web特性。get_unsupported_features: 返回给定浏览器不支持的Web特性列表。get_recently_supported_features: 返回给定浏览器版本中新支持的Web特性列表。compare_browser_support: 比较两个或更多Web特性的浏览器支持情况。get_browser_release_dates: 返回给定浏览器的发布日期和版本列表。get_browser_release_date: 返回特定浏览器版本的发布日期。get_features_not_supported_by_any_browser: 返回任何主要浏览器都不支持的Web特性。generate_browser_support_matrix: 生成给定Web特性列表在主要浏览器中的简化浏览器支持矩阵。get_min_browser_support_for_file: 分析文件内容以确定支持所有检测到的Web特性所需的最低浏览器版本。get_feature_groups: 返回所有可用特性组的列表。get_features_by_group: 获取特定组中的所有Web特性。list_snapshots: 返回所有可用快照的列表。