Optuna

v1.0.0Data Science & MLstable

A Model Context Protocol server that enables automated optimization and analysis using Optuna, allowing LLMs to perform hyperparameter optimization and interactively analyze optimization results via chat interfaces.

hyperparameter-optimizationllmmcpmcp-serveroptimization
Share:
76
Stars
0
Downloads
0
Weekly
0/5

What is Optuna?

Optuna is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol server that enables automated optimization and analysis using optuna, allowing llms to perform hyperparameter optimization and interactively analyze optimization results via cha...

A Model Context Protocol server that enables automated optimization and analysis using Optuna, allowing LLMs to perform hyperparameter optimization and interactively analyze optimization results via chat interfaces.

This server falls under the Data Science & ML category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Model Context Protocol server that enables automated optim

Use Cases

Hyperparameter optimization
Automated model tuning
Interactive optimization analysis
optuna

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx optuna-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Optuna

The Optuna MCP Server exposes Optuna's hyperparameter optimization framework as a set of conversational MCP tools, allowing LLMs to create optimization studies, suggest parameter values, record trial results, visualize optimization history, and launch the Optuna dashboard — all through a chat interface. It supports both single-objective and multi-objective optimization, integrates with SQLite and other Optuna storage backends for persistence, and works with Python 3.12 and 3.13. Data scientists use it to run and interactively steer hyperparameter searches without writing boilerplate Optuna code.

Prerequisites

  • Python 3.12 or 3.13 installed
  • uv package manager installed (https://github.com/astral-sh/uv) — the recommended install method uses uvx
  • An MCP-compatible client such as Claude Desktop or VS Code with MCP support
  • Optional: Docker if you prefer the containerized installation
1

Install and run with uvx

The simplest way to run the Optuna MCP server is via uvx, which downloads and executes the package without a permanent install.

uvx optuna-mcp
2

Register with Claude Desktop

Edit claude_desktop_config.json to add the Optuna MCP server. Optionally point storage to a local SQLite file so optimization results persist between sessions.

# Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
# or %APPDATA%\Claude\claude_desktop_config.json (Windows)
3

Restart Claude Desktop

Quit and reopen Claude Desktop to load the new server configuration. The Optuna tools will appear in the available tools list.

# Verify by asking: "What Optuna tools are available?"
4

Create your first optimization study

Ask your AI assistant to create a study, define the parameter search space, and start the optimization loop.

# In your Claude session:
"Create an Optuna study called sphere-test to minimize a 2D sphere function"
5

Visualize results and launch the dashboard

Once trials have been recorded, ask for a visualization or launch the interactive Optuna dashboard on port 58080.

# Ask your assistant:
"Plot the optimization history for the sphere-test study"
"Launch the Optuna dashboard"

Optuna Examples

Client configuration

Claude Desktop configuration with SQLite storage for persistent optimization results:

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

Prompts to try

Use these prompts to run hyperparameter optimization studies through your AI assistant:

- "Create an Optuna study to minimize a 2D sphere function, run 50 trials, and report the best parameters"
- "Optimize learning rate (1e-5 to 1e-1) and batch size (16, 32, 64, 128) for my model — use TPE sampler"
- "Show me a parallel coordinate plot of the last study's trials"
- "Get the best trial from study 'my-experiment' and list its parameters"
- "Launch the Optuna dashboard so I can explore results interactively"

Troubleshooting Optuna

uvx optuna-mcp fails with 'Python 3.12 or 3.13 required'

Install Python 3.12 or 3.13 using pyenv or your system package manager. With uv, you can pin the version: uv run --python 3.12 optuna-mcp.

Optimization results disappear between Claude sessions

Add the --storage argument pointing to a SQLite file in your config: --storage sqlite:///optuna.db. This persists all study and trial data across sessions.

Dashboard fails to launch or shows a blank page

The dashboard starts on port 58080 by default. Ensure the port is not in use (lsof -i :58080) and that optuna-dashboard is installed in the same environment as optuna-mcp.

Frequently Asked Questions about Optuna

What is Optuna?

Optuna is a Model Context Protocol (MCP) server that model context protocol server that enables automated optimization and analysis using optuna, allowing llms to perform hyperparameter optimization and interactively analyze optimization results via chat interfaces. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Optuna?

Follow the installation instructions on the Optuna GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Optuna?

Optuna works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Optuna free to use?

Yes, Optuna is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Data Science & ML MCP Servers

Explore all data science & ml servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "optuna-mcp-server": { "command": "npx", "args": ["-y", "optuna-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Optuna?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides