MCP Integration Quickstart
Add Sematryx to Claude Desktop, Cline, or any MCP-compatible agent. Your agent gains expert optimization — call one tool, get an optimal answer with full explanation.
Prerequisites
Claude Desktop
Step 1: Find your config file
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonStep 2: Add Sematryx to the config
{
"mcpServers": {
"sematryx": {
"command": "npx",
"args": ["-y", "@sematryx/mcp-server"],
"env": {
"SEMATRYX_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}Replace YOUR_API_KEY_HERE with your key from /dashboard/keys.
Step 3: Restart Claude Desktop
Quit and reopen Claude Desktop. You should see Sematryx tools in the tool picker (hammer icon).
Step 4: Test it
Ask Claude:
“Use Sematryx to find the optimal learning rate and dropout for a neural net, where lr is between 0.00001 and 0.1, dropout between 0.0 and 0.5, minimizing validation loss.”
Cline (VS Code)
Step 1: Open Cline MCP settings
In VS Code: Ctrl+Shift+P (or Cmd+Shift+P on Mac) → Cline: Open MCP Settings
Step 2: Add Sematryx server
{
"sematryx": {
"command": "npx",
"args": ["-y", "@sematryx/mcp-server"],
"env": {
"SEMATRYX_API_KEY": "YOUR_API_KEY_HERE"
},
"disabled": false,
"alwaysAllow": []
}
}Step 3: Test it
Ask Cline in a new task:
“Use the sematryx_optimize tool to find the optimal allocation of a $100k budget across 3 channels: email ($5k–$40k), paid search ($20k–$60k), social ($10k–$50k). Maximize expected conversions.”
Other Agents / Custom Integration
Sematryx runs a standard MCP server at mcp.sematryx.com. Any MCP-compatible agent can connect using HTTP/SSE transport.
{
"mcpServers": {
"sematryx": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/client-sse"
],
"env": {
"SSE_URL": "https://mcp.sematryx.com/sse",
"AUTHORIZATION": "Bearer YOUR_API_KEY_HERE"
}
}
}
}Tool Response Format
sematryx_optimize
{
"success": true,
"optimal_value": -1.2345,
"optimal_params": [0.00312, 0.18],
"solver_used": "cma_es",
"evaluations": 847,
"dimensions": 2,
"explanation": "CMA-ES selected for smooth 2D landscape. Found minimum
at lr=0.00312, dropout=0.18. Lower lr prevents gradient explosion;
moderate dropout avoids overfitting. Solution stable across 5 restarts."
}Pay per solve — no subscription needed
The free tier includes 100 solves/month — enough to build and test. Beyond that, $0.01 per simple solve, $0.05 per complex solve (≥50 dims or ≥5K evals). Credits never expire.
See full pricing →API Key Security
Store your API key in environment variables or a secret manager — never hardcode it in your prompt. For Claude Desktop, the env block in the config file is safe because it's only read server-side by the npx process, not sent to Claude.