# Optuna MCP Server

> Optimize and analyze with Optuna through conversation.

- **URL**: https://followmcp.com/en/servers/optuna-mcp
- **Category**: Dev Tools
- **Origin**: Official
- **Stars**: 95
- **FMRS Score**: 55/100 (Grade C)
- **Source**: https://github.com/optuna/optuna-mcp
- **Transports**: stdio (local process)
- **Runtimes**: Python 3.12+, Docker
- **Auth**: No credential needed

## Overview
Optuna MCP Server is an MCP server for interacting with Optuna APIs. It can create and manage studies, suggest and report trials, produce optimization visualizations, and launch the Optuna Dashboard. The README shows a configuration example for Claude Desktop.

## Best for
- Users who want to create, run, and analyze Optuna studies through an MCP client.
- Users who need trial visualizations or the Optuna Dashboard.

## Not for
- Users who do not use Optuna or need optimization and trial analysis.
- Users who need a hosted service, authentication, or client configuration not documented in the README.

## Required permissions
- Needs access to the configured Optuna storage to create or read studies and trials; for persistent storage, the specified path must be available.
- Launching the dashboard requires access to the configured port; the README default is 58080.

## Risks
- The tools can create studies, suggest parameters, and submit trial results; callers should verify study names, search spaces, and result values.
- The dashboard starts on a configured port; the README example accesses it at localhost:58080.
- The README does not describe authentication or remote access controls, so avoid exposing the dashboard to untrusted networks.

## Client config (JSON)
```json
{"mcpServers":{"Optuna":{"command":"/path/to/uvx","args":["optuna-mcp"]}}}
```

## Tools (24)
- `create_study`: Create a study with a name and optimization directions, or load it if it already exists.
- `set_sampler`: Set the sampler for a study.
- `get_all_study_names`: Get all study names from storage.
- `set_metric_names`: Set labels for each objective value.
- `get_metric_names`: Get the metric names.
- `get_directions`: Get the study's optimization directions.
- `get_trials`: Get all trials in CSV format.
- `best_trial`: Get the best trial.
- `best_trials`: Return trials on the study's Pareto front.
- `ask`: Suggest new parameters with Optuna using a search space.
- `tell`: Report the result of a trial.
- `set_trial_user_attr`: Set user attributes for a trial.
- `get_trial_user_attrs`: Get a trial's user attributes.
- `plot_optimization_history`: Return an optimization history plot.
- `plot_hypervolume_history`: Return a hypervolume history plot.
- `plot_pareto_front`: Return a Pareto front plot for multi-objective optimization.
- `plot_contour`: Return a contour plot.
- `plot_parallel_coordinate`: Return a parallel coordinate plot.
- `plot_slice`: Return a slice plot.
- `plot_param_importances`: Return a parameter importances plot.
- `plot_edf`: Return an EDF plot.
- `plot_timeline`: Return a timeline plot.
- `plot_rank`: Return a rank plot.
- `launch_optuna_dashboard`: Launch the Optuna Dashboard; the default port is 58080.
