Optuna
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.
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
Maintainer
Works with
Installation
Manual Installation
npx optuna-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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-mcpRegister 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)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?"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"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.
Optuna Alternatives — Similar Data Science & ML Servers
Looking for alternatives to Optuna? Here are other popular data science & ml servers you can use with Claude, Cursor, and VS Code.
Ultrarag
★ 5.6kA Low-Code MCP Framework for Building Complex and Innovative RAG Pipelines
RocketRide
★ 3.1k📇 🏠 - MCP server that exposes RocketRide AI pipelines as t
Aix Db
★ 2.1kAix-DB 基于 LangChain/LangGraph 框架,结合 MCP Skills 多智能体协作架构,实现自然语言到数据洞察的端到端转换。
NeMo Data Designer
★ 1.9k🎨 NeMo Data Designer: Generate high-quality synthetic data from scratch or from seed data.
PaperBanana
★ 1.7kOpen source implementation and extension of Google Research’s PaperBanana for automated academic figures, diagrams, and research visuals, expanded to new domains like slide generation.
MiniMax
★ 1.5kBridges MiniMax AI capabilities to the Model Context Protocol, enabling AI agents to perform image understanding, text-to-image generation, and speech synthesis. It provides a standardized interface for accessing MiniMax's core tools via JSON-RPC.
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.
Set Up Optuna in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.