Tidymodels MCP Server

by JavOrraca
Verified

local-only server

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

Integrations

  • Monitors tidymodels repositories on GitHub, providing access to package information and allowing users to search for issues across the tidymodels ecosystem

  • Runs as a Node.js application to serve tidymodels information and tools to compatible AI agents

Tidymodels MCP 服务器

模型上下文协议 (MCP) 服务器,提供与 R 中的tidymodels生态系统协同工作的工具和资源。

概述

虽然此 MCP 服务器可扩展用于与工具无关的代理 AI 工作流,但其当前形式可以与Cline.botClaude Desktop配对,作为本地 MCP 服务器。此 MCP 旨在监控 tidymodels 生态系统,特别是tidymodels 组织下的GitHub 代码库,提供有关 tidymodels 软件包、功能和常见工作流的全面信息。

目前,当与 Cline 搭配使用时,我获得了更好的 MCP 性能:

  • 列出 tidymodels 生态系统中的所有包
  • 提供有关特定包的详细信息
  • 在 tidymodels 包中搜索 R 函数
  • 生成常见 tidymodels 任务的模板代码
  • 在 tidymodels 存储库中搜索问题

安装

先决条件

设置

  1. 克隆此存储库:
    git clone https://github.com/yourusername/tidymodels-mcp.git cd tidymodels-mcp
  2. 安装依赖项:
    npm install
  3. 构建服务器:
    npm run build

配置

GitHub 令牌(可选)

服务器可以使用 GitHub 令牌来避免访问 GitHub API 时的速率限制。提供令牌的方法如下:

  1. 使用public_repo范围创建个人访问令牌
  2. 将其添加到您的配置中,如下所示。

在 Visual Studio Code、Positron 和 OSS Code IDE 中添加 Cline

安装 Cline 的 VS Code 扩展后,请导航至其 MCP 服务器市场,在那里您可以配置本地 MCP 服务器设置。然后,将 JSON 添加到 Cline 的cline_mcp_settings.json文件中(如果您想自动批准此 MCP 服务器库中的核心工具,请保留autoApprove列表中显示的名称):

{ "mcpServers": { "tidymodels": { "command": "node", "args": ["/path/to/tidymodels-mcp/js/index.js"], "env": { "GITHUB_TOKEN": "your-github-token" }, "disabled": false, "autoApprove": [ "list_tidymodels_packages", "get_package_details", "search_r_functions", "generate_tidymodels_code", "search_issues" ] } } }

添加到 Claude 桌面

要将此 MCP 服务器与Claude Desktop一起使用,请将其添加到您的claude_desktop_config.json中:

{ "mcpServers": { "tidymodels": { "command": "node", "args": ["/path/to/tidymodels-mcp/js/index.js"], "env": { "GITHUB_TOKEN": "your-github-token" }, "disabled": false, "autoApprove": [] } } }

配置文件通常位于:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

可用工具

该服务器提供以下工具:

列出_tidymodels_packages

列出 tidymodels 生态系统中的所有包。

Arguments: - refresh (optional): Force a refresh of the repository cache

获取包详细信息

获取有关特定 tidymodels 包的详细信息。

Arguments: - package (required): Package name

search_r_函数

在 tidymodels 包中搜索 R 函数。

Arguments: - query (required): Function name or keyword to search for - package (optional): Limit search to a specific package

生成整洁模型代码

为常见的 tidymodels 任务生成 R 代码。

Arguments: - task (required): Description of the task - template (optional): Type of template (recipe, model, tune, evaluation)

搜索问题

在 tidymodels 存储库中搜索问题。

Arguments: - query (required): Search query - repo (optional): Limit search to a specific repository - state (optional): Issue state (open, closed, all)

可用资源

该服务器还提供对以下内容的访问:

  • tidymodels GitHub 组织中的所有存储库
  • 关于 tidymodels 包的文档
  • 常见任务的模板代码

使用示例

以下是如何将此 MCP 服务器与 Cline 一起使用的一些示例:

列出 Tidymodels 包

I'd like to know what packages are available in the tidymodels ecosystem.

获取包详细信息

Can you tell me about the parsnip package in tidymodels?

搜索函数

I need to find R functions related to cross-validation in tidymodels.

生成代码模板

Generate code for a tidymodels workflow that predicts housing prices using random forests.

搜索问题

Show me open issues related to recipe preprocessing in tidymodels.

发展

项目结构

  • js/ :包含 JavaScript/Node.js 服务器实现
  • src/ :包含 TypeScript 源(如果使用 TypeScript)
  • build/ :构建文件的输出目录

从源代码构建

如果您对 TypeScript 文件进行了更改,则可以使用以下命令重建服务器:

npm run build

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

致谢

ID: qjpxm0o0c7