Skip to main content
Glama

OraClaw

MIT License MCP Algorithms Latency npm API Status

MCP Optimization Tools for AI Agents -- 17 tools (11 free, no key), sub-25ms. Zero LLM cost.

Your AI agent can't do math. OraClaw gives it deterministic optimization, simulation, forecasting, and risk analysis through the Model Context Protocol. Every tool returns structured JSON, runs in under 25ms, and costs nothing to compute.


🚀 Using OraClaw in production — or want managed hosting, premium tools, or priority support? Tell me about your use case → — I read every one.

💬 Building something with it? Star the repo and say hi in Discussions — what you build steers what I ship next.


What this solves

LLMs generate plausible text, not mathematically optimal answers. OraClaw gives an AI agent a set of deterministic numerical tools it can call instead of guessing — each returns structured JSON from a real algorithm, with no token spend on reasoning. Concretely:

  • Your agent needs to pick the next variant to try (A/B test arm, ad/email copy, recommendation) and balance exploration against exploitation — without hand-rolling a bandit or letting the model eyeball it. Call optimize_bandit (or optimize_contextual when the best choice depends on per-call features).

  • Your agent needs a provably optimal allocation or schedule under hard constraints (budget split, integer counts, capacity caps) — without the model hallucinating constraints. Call solve_constraints (LP/MIP/QP via HiGHS) or solve_schedule for task-to-slot fitting.

  • Your agent needs to quantify uncertainty around an outcome — project a value under an uncertain input, or measure VaR/CVaR on a weighted multi-asset book with auditable assumptions — without a Monte Carlo loop in the prompt. Call simulate_montecarlo, simulate_scenario, or analyze_risk.

  • Your agent needs a point forecast or an outlier flag on a time series (demand, KPIs, sensor/metric streams) — without inventing trend math. Call predict_forecast (ARIMA / Holt-Winters) or detect_anomaly (Z-score / IQR).

  • Your agent needs to fuse or score probability signals — combine model outputs, measure how much independent sources agree, or check whether past predictions were well-calibrated. Call predict_ensemble, score_convergence, or score_calibration.

  • Your agent needs to reason over a graph — rank influential nodes, cluster a dependency/knowledge graph, find a critical path, or route between two nodes. Call analyze_graph or plan_pathfind.


Related MCP server: Math-Physics-ML MCP System

Where the algorithms have been used

OraClaw's algorithms have informed implementations in several open-source projects -- through contributed routing specs, algorithm guidance, and shared math -- spanning AI agent orchestration, time-series tracking, vector search, and optimization.

Selected contributions (see CHANGELOG.md for the full list):

  • chernistry/bernstein -- agent orchestration framework. LinUCB contextual router (α=0.3) with shadow-evaluation path and interpretable decision reasons, shipped in codex/issue-367-linucb-router after a contributed spec correction.

  • stxkxs/nanohype -- contextual bandit routing, pluggable strategy registry (hash / sliding-TTL / semantic), cost anomaly detection. "Your input shaped a lot of what actually shipped."

  • rfivesix/hypertrack -- Bayesian/Kalman-style adaptive estimator with phase-aware ramp. Shipped in 0.8.0-beta.

  • AlanHuang99/pyrollmatch -- entropy balancing (Hainmueller 2012) with moment constraints + max_weight cap. Shipped in v0.1.3.

  • stffns/vstash -- IDF-sigmoid relevance weighting. Shipped in v0.17.0.

Marketplace distribution:


Quick Start

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "oraclaw": {
      "command": "npx",
      "args": ["-y", "@oraclaw/mcp-server"]
    }
  }
}

Then ask your agent:

"I have 3 email subject line variants. Which should I send next?"

The agent calls optimize_bandit and gets a statistically optimal selection in 0.01ms.

2. REST API (no install)

curl -X POST https://oraclaw-api.onrender.com/api/v1/optimize/bandit \
  -H 'Content-Type: application/json' \
  -d '{
    "arms": [
      {"id": "A", "name": "Option A", "pulls": 10, "totalReward": 7},
      {"id": "B", "name": "Option B", "pulls": 10, "totalReward": 5},
      {"id": "C", "name": "Option C", "pulls": 2, "totalReward": 1.8}
    ],
    "algorithm": "ucb1"
  }'

Response (<1ms):

{
  "selected": { "id": "C", "name": "Option C" },
  "score": 1.876,
  "algorithm": "ucb1",
  "exploitation": 0.9,
  "exploration": 0.976,
  "regret": 0.1
}

Free tier: 25 calls/day, no API key needed.

3. npm SDK

npm install @oraclaw/bandit
import { OraBandit } from '@oraclaw/bandit';

const client = new OraBandit({ baseUrl: 'https://oraclaw-api.onrender.com' });
const result = await client.optimize({
  arms: [
    { id: 'A', name: 'Short Subject', pulls: 500, totalReward: 175 },
    { id: 'B', name: 'Long Subject', pulls: 300, totalReward: 126 },
  ],
  algorithm: 'ucb1',
});

14 SDK packages: @oraclaw/bandit, @oraclaw/solver, @oraclaw/simulate, @oraclaw/risk, @oraclaw/forecast, @oraclaw/anomaly, @oraclaw/graph, @oraclaw/bayesian, @oraclaw/ensemble, @oraclaw/calibrate, @oraclaw/evolve, @oraclaw/pathfind, @oraclaw/cmaes, @oraclaw/decide


Why?

LLMs generate plausible text, not optimal solutions. Ask GPT to pick the best A/B test variant and it applies a heuristic that ignores the exploration-exploitation tradeoff. Ask it to solve a linear program and it hallucinates constraints. OraClaw gives your agent access to real algorithms -- bandits, solvers, forecasters, risk models -- that return mathematically correct answers in sub-millisecond time, without burning tokens on reasoning.


MCP Tool Catalog (17 tools)

Free tier (11 tools, no API key — 25 calls/day per IP):

Tool

What It Does

Latency

optimize_bandit

UCB1 / Thompson / Epsilon-Greedy arm selection

0.01ms

optimize_contextual

Context-aware LinUCB bandit

0.05ms

optimize_evolve

Genetic algorithm for discrete + multi-objective problems

<10ms

solve_schedule

Energy-matched task scheduling

3ms

score_convergence

Multi-source probability consensus (Hellinger)

0.04ms

score_calibration

Brier + log score for forecaster accuracy

0.02ms

predict_bayesian

Beta posterior update from weighted evidence

0.05ms

predict_ensemble

Multi-model consensus + uncertainty decomposition

0.1ms

plan_pathfind

A* + Yen's k-shortest paths

0.1ms

simulate_montecarlo

Single-factor Monte Carlo (6 distributions)

<2ms

simulate_scenario

What-if comparison + sensitivity ranking

<5ms

Premium tier (6 tools, requires ORACLAW_API_KEY):

Tool

What It Does

Latency

optimize_cmaes

CMA-ES continuous black-box optimization

12ms

solve_constraints

LP / MIP / QP solver via HiGHS (provably optimal)

2ms

analyze_graph

PageRank, Louvain communities, bottleneck detection

0.5ms

analyze_risk

VaR and CVaR (Expected Shortfall)

<2ms

predict_forecast

ARIMA + Holt-Winters time series forecasting

0.08ms

detect_anomaly

Z-Score + IQR anomaly detection

0.01ms

14 of 18 REST endpoints respond in under 1ms. All under 25ms.


Try It Now

The API is live. No signup required.

# Bayesian inference
curl -X POST https://oraclaw-api.onrender.com/api/v1/predict/bayesian \
  -H 'Content-Type: application/json' \
  -d '{"prior": 0.3, "evidence": [{"factor": "positive_test", "weight": 0.9, "value": 0.05}]}'

# Monte Carlo simulation
curl -X POST https://oraclaw-api.onrender.com/api/v1/simulate/montecarlo \
  -H 'Content-Type: application/json' \
  -d '{"simulations": 1000, "distribution": "normal", "params": {"mean": 100, "stddev": 15}}'

# Monte Carlo with a non-normal distribution
curl -X POST https://oraclaw-api.onrender.com/api/v1/simulate/montecarlo \
  -H 'Content-Type: application/json' \
  -d '{"simulations": 1000, "distribution": "triangular", "params": {"min": 80, "mode": 100, "max": 140}}'

Premium tools (detect_anomaly, predict_forecast, analyze_risk, solve_constraints, analyze_graph, optimize_cmaes) need an API key or an x402 payment — see Pricing below.


Pricing

Tier

Calls

Price

Auth

Free

25/day

$0

None

Pay-per-call

1K/day

$0.005/call

API key

Starter

50K/mo

$9/mo

API key

Growth

500K/mo

$49/mo

API key

Scale

5M/mo

$199/mo

API key

x402 (for autonomous agents): pay $0.001/call in USDC on Base — no signup, no API key. Send a signed PAYMENT-SIGNATURE header on any premium endpoint; the API verifies, meters, and settles per call. Get a key instead with a one-line POST /api/v1/auth/signup ({"email":"you@…"}) — instant, no card.


Source Code


Building with OraClaw?

We'd love to hear what you're working on. Share your use case, ask questions, or request features:



If this saved your agent from hallucinating math, star us :star:

License

MIT

Available Tools

17 tools
analyze_graphA
Read-onlyIdempotent

[Premium] Compute structural properties of a directed graph: PageRank centrality, Louvain community detection, shortest critical path between two nodes, and bottleneck identification. Use to surface influential nodes, community clusters, or chokepoints in dependency graphs, knowledge graphs, supply chains, social networks. For pathfinding alone (single source→goal route), use plan_pathfind — it's faster and free. Requires ORACLAW_API_KEY.

Inputs: nodes (required), edges (required), sourceGoal, targetGoal. Returns: pageRank, communities, clusters, criticalPath, +3 more

analyze_riskA
Read-onlyIdempotent

[Premium] Compute portfolio Value-at-Risk (VaR) and Conditional VaR (Expected Shortfall) from historical asset return series, accounting for cross-asset correlation. Use for portfolio risk attribution, regulatory capital sizing, drawdown scenario analysis. Returns are matrix [asset][time] of period returns. For simulating outcomes from a parametric distribution rather than historical data, use simulate_montecarlo. Requires ORACLAW_API_KEY.

Inputs: returns (required), weights (required), confidence, horizonDays. Returns: var, cvar, expectedReturn, volatility, +3 more

detect_anomalyA
Read-onlyIdempotent

[Premium] Flag outlier points in a numeric series using Z-score (parametric, assumes ~normal) or IQR (robust to skew). Use for monitoring metrics, fraud signals, sensor noise, quality control. Z-score is faster and tighter on near-normal data; IQR is the right default when the distribution has heavy tails or known outliers. Returns indices + values + the underlying statistics. For projecting a series forward, use predict_forecast. Requires ORACLAW_API_KEY.

Inputs: data (required), method, threshold. Returns: method, anomalies, stats, totalPoints, +1 more

optimize_banditA
Read-only

Pick the best option from a set of variants (Multi-Armed Bandit: UCB1, Thompson sampling, or ε-greedy). Use this when you have N options with observed reward history and need to choose the next one with optimal explore/exploit tradeoff (A/B test arm selection, ad/email variant routing, recommendation ranking). For context-dependent selection (different best option per user/situation), use optimize_contextual instead. For continuous parameter tuning, use optimize_cmaes. Returns the selected arm + score breakdown in <1ms.

Inputs: arms (required), algorithm. Returns: selected, score, algorithm, exploitation, +2 more

optimize_cmaesA
Read-only

[Premium] Continuous black-box optimization via CMA-ES (Covariance Matrix Adaptation Evolution Strategy). Use for tuning N continuous parameters when the objective is non-convex, noisy, or has no gradient — hyperparameter search, simulator calibration, control policy tuning. 10-100x fewer evaluations than grid search. For discrete combinatorial problems, use optimize_evolve. For LP/MIP problems with linear constraints, use solve_constraints. Stochastic init means re-runs with the same input may differ slightly. Requires ORACLAW_API_KEY.

Inputs: dimension (required), objectiveWeights (required), initialSigma, maxIterations, +1 more. Returns: bestSolution, bestFitness, iterations, evaluations, +2 more

optimize_contextualA
Read-onlyIdempotent

Pick the best option given a situational context vector (LinUCB contextual bandit). Use when the best option depends on features that vary per call (user demographics, time of day, weather, market regime). Pass observed history so the model can learn per-context preferences. If you have no per-call context features, use optimize_bandit instead. Returns selected arm with expected reward + confidence width.

Inputs: arms (required), context (required), history, alpha. Returns: selected, score, expectedReward, confidenceWidth, +1 more

optimize_evolveA
Read-only

Genetic algorithm for combinatorial / discrete optimization with optional Pareto frontier for multi-objective problems. Use when the search space is discrete or mixed (binary feature selection, integer allocation, permutation problems like TSP), or when you want to explore multiple non-dominated solutions. For continuous black-box parameters, use optimize_cmaes — it converges faster on smooth objectives. Stochastic: same input gives different best chromosome each run. Free.

Inputs: geneLength (required), bounds, fitnessWeights, populationSize, +5 more. Returns: bestChromosome, paretoFrontier, convergenceGeneration, totalGenerations, +2 more

plan_pathfindA
Read-onlyIdempotent

Find the shortest (or k-shortest) path between two nodes in a weighted graph using A* + Yen's algorithm. Use for routing, dependency resolution, project critical-path discovery, or 'how do I get from X to Y' questions on graphs. Set kPaths>1 to also return alternatives. For full graph structure analysis (centrality, communities), use analyze_graph. For task-to-time-slot assignment, use solve_schedule. Free.

Inputs: nodes (required), edges (required), start (required), end (required), +2 more. Returns: path, totalCost, breakdown, nodesExplored, +3 more

predict_bayesianA
Read-onlyIdempotent

Update a prior probability with weighted evidence using a Beta-Bayesian posterior. Use for incremental belief revision: starting from a baseline probability, fold in new signals (each with a value in [0,1] and a weight) and get an updated posterior plus calibration score. Suited to fraud-risk scoring, A/B test stopping decisions, diagnostic probability stacking. For combining N independent model predictions, use predict_ensemble. For full distribution sampling, use simulate_montecarlo. Free.

Inputs: prior (required), evidence (required). Returns: posterior, priorProbability, factors, posteriorMean, +2 more

predict_ensembleA
Read-onlyIdempotent

Combine N model predictions into a single consensus value using weighted voting, stacking, or Bayesian model averaging. Returns the consensus, decomposed uncertainty (epistemic vs aleatoric), agreement score, weight share per model, and Shannon entropy of the weight distribution. Use to fuse outputs from heterogeneous predictors (statistical + ML + human forecasters). For fusing source-agreement on a probability of one event, use score_convergence. Free.

Inputs: predictions (required), method. Returns: consensus, confidence, weights, entropy, +4 more

predict_forecastA
Read-onlyIdempotent

[Premium] Project future values from a univariate time series using ARIMA or Holt-Winters (additive seasonal). Use for short-to-medium horizon point forecasts with confidence bands: demand planning, KPI projection, capacity forecasting. ARIMA suits non-seasonal trend data; Holt-Winters handles repeating seasonality (set seasonLength). Needs at least ~20 observations for stable fit. For point-anomaly flags rather than projection, use detect_anomaly. Requires ORACLAW_API_KEY.

Inputs: data (required), steps (required), method, seasonLength. Returns: forecast, confidence, model, method, +2 more

score_calibrationA
Read-onlyIdempotent

Score how well-calibrated a set of probability predictions are against observed binary outcomes using Brier score and log score. Use to evaluate forecaster accuracy, model calibration, prediction-market fairness. Lower Brier/log score = better. predictions[i] is the probability assigned to event i; outcomes[i] is 1 if it happened, 0 otherwise. For comparing multiple forecasters' agreement, use score_convergence instead. Free.

Inputs: predictions (required), outcomes (required). Returns: brier_score, log_score, n_predictions, mean_prediction, +1 more

score_convergenceA
Read-onlyIdempotent

Score how much multiple independent sources agree on a probability estimate, weighting by recency, volume, and confidence. Use to fuse signals from polling, prediction markets, model ensembles, or any source emitting a 0..1 probability. Returns an aggregate convergence score, the consensus probability, and per-pair disagreement so you can see which sources are outliers. Free tier. For comparing pre-binned distributions, prefer this over simulate_montecarlo.

Inputs: sources (required), config. Returns: convergenceScore, consensusProbability, sources, components

simulate_montecarloA
Read-only

Sample N draws from a parametric distribution and return summary statistics + percentiles + histogram. Use to quantify uncertainty around a single random factor: project NPV with uncertain growth rate, estimate latency tail percentiles, size insurance reserves. Supports normal/lognormal/uniform/triangular/beta/exponential. For multi-asset portfolio risk with correlations, use analyze_risk. Each call re-samples (non-idempotent). Capped at 2000 iterations on the free tier.

Inputs: distribution (required), params (required), simulations. Returns: mean, stdDev, percentiles, histogram, +3 more

simulate_scenarioA
Read-onlyIdempotent

Compare named what-if scenarios against a base case, returning per-scenario outcome delta plus a sensitivity ranking showing which input variables move the outcome most across scenarios. Use for budget sensitivity analysis, deal what-ifs, capacity planning under multiple demand assumptions. The default outcome metric is the sum of input variables — supply scenarios that vary individual drivers to isolate their impact. For random sampling from a distribution, use simulate_montecarlo. Free.

Inputs: baseCase (required), scenarios (required). Returns: baseCase, results, sensitivityRanking, scenarioCount

solve_constraintsA
Read-onlyIdempotent

[Premium] Solve linear / mixed-integer / quadratic programs (HiGHS solver). Use when the objective and constraints are linear (or quadratic) and you need a provably optimal solution: budget allocation across line items, supply chain optimization, capacity planning with integer counts, portfolio construction with hard caps. For continuous black-box objectives, use optimize_cmaes. For task→slot scheduling, use solve_schedule. Returns variable assignments + objective value. Requires ORACLAW_API_KEY.

Inputs: direction (required), objective (required), variables (required), constraints (required). Returns: status, objectiveValue, variables

solve_scheduleA
Read-onlyIdempotent

Assign tasks to time slots maximizing productivity, matching task energy requirements with slot energy levels. Use specifically for task→slot assignment with energy matching (deep-work scheduling, shift planning, exercise scheduling). For general resource allocation with arbitrary linear constraints, use solve_constraints. For sequence/route problems, use plan_pathfind. Deterministic.

Inputs: tasks (required), slots (required). Returns: assignments, unassignedTasks, totalScore

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.6/5.0

    Scored across 17 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose, with descriptions that guide selection among related tools (e.g., optimize_bandit vs. optimize_contextual, analyze_graph vs. plan_pathfind). No two tools appear to overlap in functionality.

    Naming Consistency5/5

    All tool names follow a consistent `verb_noun` pattern with lowercase and underscores (e.g., `analyze_graph`, `predict_bayesian`, `solve_schedule`). The naming is predictable and clear throughout.

    Tool Count5/5

    With 17 tools covering optimization, prediction, simulation, risk, graph analysis, scheduling, and constraints, the count is well-scoped for a general-purpose analytical toolkit. Each tool earns its place without overwhelming the surface.

    Completeness4/5

    The tool surface provides comprehensive coverage for the stated domain (decision support, analytics, optimization). Minor gaps exist, such as missing tools for simple regression or categorical classification, but core workflows like prediction, simulation, and optimization are well-covered.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides 21 mathematical tools across 6 domains including basic calculations, array operations, statistics, financial mathematics, linear algebra, and calculus. Supports batch execution for complex multi-step workflows with intelligent dependency resolution.
      21
      6
      MIT
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Arithym — lightweight precision math for agents on the go. Exact arithmetic MCP server with 62 tools, zero hallucination, sub-millisecond computation and is 61% cheaper than Python code execution at scale.
      -
    • A
      license
      A
      quality
      B
      maintenance
      AI Agent Mission Control — 200+ MCP tools across 31 domains. Manage agents, experiments, workflows, crews, skills, tools, credentials, approvals, signals, budgets, marketplace, knowledge bases, chatbots, and more. Self-hosted, open-source (AGPL-3.0). Supports stdio + Streamable HTTP/SSE with OAuth 2.0 auth.
      34
      83
      AGPL 3.0