Banditdb MCP server
{
"mcpServers": {
"banditdb": {
"command": "uvx",
"args": [
"banditdb-python"
],
"env": {
"BANDITDB_URL": "https://...",
"BANDITDB_API_KEY": "<banditdb_api_key>"
}
}
}
}{
"mcpServers": {
"banditdb": {
"command": "uvx",
"args": [
"banditdb-python"
],
"env": {
"BANDITDB_URL": "https://...",
"BANDITDB_API_KEY": "<banditdb_api_key>"
}
}
}
}{
"mcpServers": {
"banditdb": {
"command": "uvx",
"args": [
"banditdb-python"
],
"env": {
"BANDITDB_URL": "https://...",
"BANDITDB_API_KEY": "<banditdb_api_key>"
}
}
}
}{
"servers": {
"banditdb": {
"command": "uvx",
"args": [
"banditdb-python"
],
"env": {
"BANDITDB_URL": "${input:banditdb_url}",
"BANDITDB_API_KEY": "${input:banditdb_api_key}"
}
}
},
"inputs": [
{
"id": "banditdb_url",
"type": "promptString",
"description": "Banditdb url",
"password": true
},
{
"id": "banditdb_api_key",
"type": "promptString",
"description": "Banditdb api key",
"password": true
}
]
}{
"mcpServers": {
"banditdb": {
"command": "uvx",
"args": [
"banditdb-python"
],
"env": {
"BANDITDB_URL": "https://...",
"BANDITDB_API_KEY": "<banditdb_api_key>"
}
}
}
}file .mcp.json (in your project root)file claude_desktop_config.jsonfile ~/.cursor/mcp.jsonfile .vscode/mcp.jsonfile ~/.codeium/windsurf/mcp_config.jsoninstall uvx banditdb-pythonversion 0.2.1
What it does
BanditDB is an MCP server that exposes a contextual bandit database for persistent decision memory in agents. It allows you to create campaigns, get predictions on which action to take given a context, and record rewards to learn which actions work best in which situations. Built for LLM agents and personalization systems that need to remember and improve their decisions over time.
- Store learned preferences for which checkout offer (discount vs. free shipping) works best for different user segments, so your LLM agent can make better upsell decisions.
- Run A/B tests where the system learns which variant performs better and automatically shifts traffic toward the winner using reinforcement learning.
- Give an LLM agent swarm shared memory of which tools or strategies succeeded in past contexts, so the entire team learns from each other's successes and failures.
Tools this server exposes
| Tool | Does |
|---|---|
| create_campaign | Create a new decision campaign with specified arms, feature dimensions, and algorithm (linucb or thompson_sampling). |
| list_campaigns | List all active campaigns with their algorithm and configuration. |
| campaign_diagnostics | Inspect the learning state of a campaign including per-arm theta norms, prediction counts, reward rates, and entropy health. |
| predict | Get the best arm to select for a given context and campaign, returning an arm ID and interaction ID. |
| batch_predict | Get predictions for up to 100 campaign and context pairs in a single request. |
| reward | Record the outcome of a prediction to teach the campaign which arm worked best in that context. |
| campaign_report | Get a business-level convergence report showing whether one arm has a statistically significant lead. |
| archive_campaign | Pause a campaign while preserving all learned weights. |
| delete_campaign | Permanently delete a campaign. |
Before you enable it
An MCP server runs with whatever access you give it. Start with a development account rather than production, and check which tools the server exposes before you let an agent call them unattended.