Optuna▌
by optuna
Optimize hyper parameters effortlessly with Optuna, the best AutoML software for automated analysis, visualization, and
Provides automated hyperparameter optimization and analysis using Optuna framework with support for multiple samplers, multi-objective optimization, parameter importance analysis, and interactive visualizations including optimization history and Pareto fronts.
Both formats append explainx.ai attribution and the canonical URL for this MCP server listing.
best for
- / ML engineers tuning model hyperparameters
- / Data scientists optimizing experiment parameters
- / Researchers analyzing optimization results
- / Teams automating parameter search workflows
capabilities
- / Run hyperparameter optimization studies
- / Generate optimization history plots
- / Analyze parameter importance
- / Create Pareto front visualizations
- / Support multiple sampling algorithms
- / Perform multi-objective optimization
what it does
Automates hyperparameter tuning and optimization using the Optuna framework. Lets AI assistants optimize model parameters and analyze results through interactive visualizations.
about
Optuna is an official MCP server published by optuna that provides AI assistants with tools and capabilities via the Model Context Protocol. Optimize hyper parameters effortlessly with Optuna, the best AutoML software for automated analysis, visualization, and It is categorized under ai ml, analytics data.
how to install
You can install Optuna in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
license
MIT
Optuna is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
readme
Optuna MCP Server
A Model Context Protocol (MCP) server that automates optimization and analysis using Optuna.
<img width="840" alt="image" src="https://raw.githubusercontent.com/optuna/optuna-mcp/main/examples/sphere2d/images/sphere2d-6.png" />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",
"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. Since MCP clients know the list of tools and the details of each tool, users do not need to remember those details.
Study
- create_study - Create a new Optuna study with the given study_name and directions.
If the study already exists, it will be simply loaded.
study_name: name of the study (string, required).directions: The directions of optimization (list of literal strings minimize/maximize, optional).
- set_sampler - Set the sampler for the study.
name: the name of the sampler (string, required).
- get_all_study_names - Get all study names from the storage.
- set_metric_names - Set metric_names. Metric_names are labels used to distinguish what each objective value is.
metric_names: The list of metric names for each objective (list of strings, required).
- get_metric_names - Get metric_names.
- No parameters required.
- get_directions - Get the directions of the study.
- No parameters required.
- get_trials - Get all trials in a CSV format.
- No parameters required.
- best_trial - Get the best trial.
- No parameters required.
- best_trials - Return trials located at the Pareto front in the study.
- No parameters required.
Trial
- ask - Suggest new parameters using Optuna.
search_space: the search space for Optuna (dictionary, required).
- tell - Report the result of a trial.
trial_number: the trial number (integer, required).values: the result of the trial (float or list of floats, required).
- set_trial_user_attr - Set user attributes for a trial.
trial_number: the trial number (integer, required).key: the key of the user attribute (string, required).value: the value of the user attribute (any type, required).
- get_trial_user_attrs - Get user attributes in a trial.
trial_number: the trial number (integer, required).
Visualization
- plot_optimization_history - Return the optimization history plot as an image.
target: index to specify which value to display (integer, optional).target_name: target’s name to display on the axis label (string, optional).
- plot_hypervolume_history - Return the hypervolume history plot as an image.
reference_point: a list of reference points to calculate the hypervolume (list of floats, required).
- plot_pareto_front - Return the Pareto front plot as an image for multi-objective optimization.
target_names: objective name list used as the axis titles (list of strings, optional).include_dominated_trials: a flag to include all dominated trial's objective values (boolean, optional).targets: a list of indices to specify the objective values to display. (list of integers, optional).
- plot_contour - Return the contour plot as an image.
params: parameter list to visualize (list of strings, optional).target: an index to specify the value to display (integer, required).target_name: target’s name to display on the color bar (string, required).
- plot_parallel_coordinate - Return the parallel coordinate plot as an image.
params: parameter list to visualize (list of strings, optional).target: an index to specify the value to display (integer, required).target_name: target’s name to display on the axis label and the legend (string, required).
- plot_slice - Return the slice plot as an image.
params: parameter list to visualize (list of strings, optional).target: an index to specify the value to display (integer, required).target_name: target’s name to display on the axis label (string, required).
- plot_param_importances - Return the parameter importances plot as an image.
params: parameter list to visualize (list of strings, optional).target: an index to specify the value to display (integer/null, optional).target_name: target’s name to display on the legend (string, required).
- plot_edf - Return the EDF plot as an image.
target: an index to specify the value to display (integer, required).target_name: target’s name to display on the axis label (string, required).
- plot_timeline - Return the timeline plot as an image.
- No parameters required.
- plot_rank - Return the rank plot as an image.
params: parameter list to visualize (list of strings, optional).target: an index to specify the value to display (integer, required).target_name: target’s name to display on the color bar (string, required).
Web Dashboard
- launch_optuna_dashboard - Launch the Optuna dashboard.
port: server port (integer, optional, default: 58080).
Examples
- Optimizing the 2D-Sphere function
- Starting the Optuna dashboard and analyzing optimization results
- Optimizing the FFmpeg encoding parameters
- Optimizing the Cookie Recipe
- Optimizing the Matplotlib Configuration
Optimizing the 2D-Sphere Function
Here we present a simple example of optimizing the 2D-Sphere function, along with example prompts and the summary of the LLM responses.
| User prompt | Output in Claude |
|---|---|
| (Launch Claude Desktop) | <img alt="1" src="https://raw.githubusercontent.com/optuna/optuna-mcp/main/examples/sphere2d/images/sphere2d-1.png" /> |
| Please create an Optuna study named "Optimize-2D-Sphere" for minimization. | <img alt="2" src="https://raw.githubusercontent.com/optuna/optuna-mcp/main/examples/sphere2d/images/sphere2d-2.png" /> |
| Please suggest two float parameters x, y in [-1, 1]. | <img alt="3" src="https://raw.githubusercontent.com/optuna/optuna-mcp/main/examples/sphere2d/images/sphere2d-3.png" /> |
| Please report the objective value x**2 + y**2. To calculate the value, please use the JavaScript interpreter and do not round the values. | <img alt="4" src="https://raw.githubusercontent.com/optuna/optuna-mcp/main/examples/sphere2d/images/sphere2d-4.png" /> |
| Please suggest another parameter set and evaluate it. | <img alt="5" src="https://raw.githubusercontent.com/optuna/optuna-mcp/main/examples/sphere2d/images/sphere2d-5.png" /> |
| Please plot the optimization history so far. | <img alt="6" src="https://raw.githubusercontent.com/optuna/optuna-mcp/main/examples/sphere2d/images/sphere2d-6.png" /> |
Starting the Optuna Dashboard and Analyzing Optimization Results
You can also start the Optuna dashboard via the MCP server to analyze the optimization results interactively.
| User prompt | Output in Claude |
|---|---|
| Please launch the Optuna dashboard. | <img alt="7" src="https://raw.githubusercontent.com/optuna/optuna-mcp/main/examples/optuna-dashboard/images/optuna-dashboard-1.png" /> |
By default, the Optuna dashboard will be launched on port 58080. You c
FAQ
- What is the Optuna MCP server?
- Optuna is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
- How do MCP servers relate to agent skills?
- Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
- How are reviews shown for Optuna?
- This profile displays 57 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.6 out of 5—verify behavior in your own environment before production use.
Use Cases▌
Extended AI Capabilities
Add new capabilities to Claude beyond text generation
Example
Access external data sources, execute code, interact with tools and services
Transform Claude from chatbot to action-taking agent
Context Enhancement
Provide Claude with access to relevant context and data
Example
Load project documentation, access knowledge bases, query databases
Get more accurate, context-aware responses
Workflow Automation
Automate multi-step workflows combining AI and external tools
Example
Research → Summarize → Create document → Send notification
Complete complex tasks end-to-end without manual steps
Implementation Guide▌
Prerequisites
- ›Claude Desktop 0.7.0+ or Cursor IDE with MCP support
- ›Basic understanding of MCP architecture and capabilities
- ›Access credentials for integrated services (if required)
- ›Willingness to experiment and iterate on configuration
Time Estimate
15-60 minutes depending on server complexity
Installation Steps
- 1.Install MCP server: npm install -g [package-name] or via GitHub
- 2.Add server configuration to ~/.claude/mcp.json
- 3.Provide required credentials and configuration
- 4.Restart Claude Desktop to load new server
- 5.Test basic functionality with simple prompts
- 6.Explore capabilities and experiment with use cases
- 7.Document successful patterns for reuse
Troubleshooting
- ⚠MCP server not loading: Check config syntax, verify installation
- ⚠Connection errors: Check network, firewall, credentials
- ⚠Feature not working: Read server docs, check required parameters
- ⚠Performance issues: Monitor resource usage, check for network latency
- ⚠Conflicts with other servers: Check port assignments, namespace collisions
Best Practices▌
✓ Do
- +Read server documentation thoroughly before setup
- +Start with simple use cases to validate functionality
- +Test in non-production environment first
- +Monitor resource usage and performance
- +Keep servers updated for bug fixes and new features
- +Document configuration for team members
- +Use environment variables for sensitive configuration
✗ Don't
- −Don't grant overly permissive access to MCP servers
- −Don't skip reading security considerations in docs
- −Don't expose sensitive data without proper controls
- −Don't run untrusted MCP servers without code review
- −Don't ignore error messages—investigate root cause
💡 Pro Tips
- ★Combine multiple MCP servers for powerful workflows
- ★Create custom MCP servers for your specific needs
- ★Share successful configurations with team
- ★Use MCP inspector for debugging
- ★Join MCP community for tips and troubleshooting
Technical Details▌
Architecture
Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.
Protocols
- Model Context Protocol (MCP)
- JSON-RPC 2.0
- stdio or HTTP transport
Compatibility
- Claude Desktop
- Cursor IDE
- Custom MCP clients
When to Use This▌
✓ Use When
Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.
✗ Avoid When
Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.
Integration▌
- →Tool composition: Chain multiple MCP tools in workflows
- →Context augmentation: Provide AI with relevant external data
- →Action delegation: Let AI execute tasks on external systems
- →Bidirectional sync: Keep AI context and external systems in sync
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
List & Promote Your MCP Server
Share your MCP server with the developer community
Ratings
4.6★★★★★57 reviews- ★★★★★Mateo Bhatia· Dec 16, 2024
Optuna is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
- ★★★★★Meera Verma· Dec 12, 2024
Strong directory entry: Optuna surfaces stars and publisher context so we could sanity-check maintenance before adopting.
- ★★★★★Amina Verma· Dec 8, 2024
Strong directory entry: Optuna surfaces stars and publisher context so we could sanity-check maintenance before adopting.
- ★★★★★Sofia Malhotra· Dec 4, 2024
Optuna has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Naina Sethi· Nov 27, 2024
I recommend Optuna for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
- ★★★★★Amelia Diallo· Nov 23, 2024
According to our notes, Optuna benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
- ★★★★★Olivia Mensah· Nov 7, 2024
Optuna reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
- ★★★★★Meera Menon· Nov 3, 2024
I recommend Optuna for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
- ★★★★★Ira Brown· Oct 26, 2024
I recommend Optuna for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
- ★★★★★Kiara Flores· Oct 22, 2024
Optuna reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
showing 1-10 of 57