OO

optuna/optuna-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

94 stars 27 forks 质量 72 趋势 8MIT

optuna/optuna-mcp 是从 https://github.com/optuna/optuna-mcp. 导入的 MCP 服务器候选

概览

optuna/optuna-mcp 是从 https://github.com/optuna/optuna-mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

一款模型上下文协议(MCP)服务器,利用Optuna实现自动化优化和分析。

使用场景

例如,Optuna MCP 服务器可用于以下使用场景。

  • 大型语言模型的自动超参数优化
  • 通过聊天界面对Optuna优化结果进行交互式分析
  • 优化其他MCP工具的输入和输出

详情请参见示例部分。

安装

Optuna MCP 服务器可以通过 uv 或 Docker 安装。 本节将解释如何安装Optuna MCP服务器,并以Claude Desktop为示例MCP客户端。

紫外线的使用

在开始安装流程之前,先从Astral安装uv。

然后,将Optuna MCP服务器配置添加到MCP客户端。 要将其纳入 Claude 桌面版,请进入 Claude >设置>开发者>编辑配置 > claude_desktop_config.json 并补充以下内容:

此外,你可以指定 Optuna 存储,并使用--storage参数来持久保存结果。

添加此信息后,请重启Claude桌面应用。 想了解更多关于 Claude Desktop 的信息,请访问快速入门页面。

Docker 的使用

你也可以用 Docker 运行 Optuna MCP 服务器。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Optuna MCP Server

A Model Context Protocol (MCP) server that automates optimization and analysis using Optuna.

Use Cases

The Optuna MCP Server can be used in the following use cases, for example.

  • Automated hyperparameter optimization by LLMs
  • Interactive analysis of Optuna’s optimization results via chat interface
  • Optimize input and output of other MCP tools

For details, see the Examples section.

Installation

The Optuna MCP server can be installed using uv or Docker. This section explains how to install the Optuna MCP server, using Claude Desktop as an example MCP client.

Usage with uv

Before starting the installation process, install uv from Astral.

Then, add the Optuna MCP server configuration to the MCP client. To include it in Claude Desktop, go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json and add the following:

{
  "mcpServers": {
    "Optuna": {
      "command": "/path/to/uvx",
      "args": [
        "optuna-mcp"
      ]
    }
  }
}

Additionally, you can specify the Optuna storage with the --storage argument to persist the results.

{
  "mcpServers": {
    "Optuna": {
      "command": "/path/to/uvx",
      "args": [
        "optuna-mcp",
        "--storage",
        "sqlite:///optuna.db"
      ]
    }
  }
}

After adding this, please restart Claude Desktop application. For more information about Claude Desktop, check out the quickstart page.

Usage with Docker

You can also run the Optuna MCP server using Docker. Make sure you have Docker installed and running on your machine.

{
  "mcpServers": {
    "Optuna": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--net=host",
        "-v",
        "/PATH/TO/LOCAL/DIRECTORY/WHICH/INCLUDES/DB/FILE:/app/workspace",
        "ghcr.io/optuna/optuna-mcp:latest",
        "--storage",
        "sqlite:////app/workspace/optuna.db"
      ]
    }
  }
}

Tools provided by Optuna MCP

The Optuna MCP provides the following tools. Specifically, it offers primitive functions of Optuna such as Study, Trial, Visualization, and Dashboard.

在 GitHub 查看完整 README

安装

docker run -i --rm --net=host -v /PATH/TO/LOCAL/DIRECTORY/WHICH/INCLUDES/DB/FILE:/app/workspace ghcr.io/optuna/optuna-mcp:latest --storage sqlite:////app/workspace/optuna.db
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "Optuna": { "command": "/path/to/uvx", "args": [ "optuna-mcp" ] } } }