Optimization middleware for AI agents: JSON problem in, verified and ranked solutions out.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
One-click editor setup isnβt available for this listing yet β we donβt have a confirmed install command, and weβd rather show nothing than point your editor at the wrong package or host. Follow the projectβs own setup instructions, linked above.
English | ηΉι«δΈζ
Combinatorial optimization middleware for AI agents. An agent describes what to optimize as structured JSON; AnnealBridge decides how to encode and solve it, checks every answer against the original problem, and returns ranked, verified solutions over MCP, a CLI, or plain Python.
A 0/1 knapsack: four items, capacity 10, maximize value. No file needed.
Domain failures come back as results, never as exceptions: result.status
is one of success, infeasible, invalid_problem,
resource_limit_exceeded, backend_unavailable, configuration_error or
solver_error. See docs/output-format.md.
Optional extras:
[gpu] is deliberately not part of [all]: PyTorch is a large download,
and on Windows the wheel PyPI serves is the CPU-only build, so a CUDA run needs
torch installed from PyTorch's own index first β see
docs/backends.md.
With uv installed, add the server to
claude_desktop_config.json (or your host's equivalent) and restart the
host; where Claude Desktop, Claude Code and Codex keep that configuration is
listed in docs/mcp.md.
The first run fetches the package into uvx's own cached environment; that
download β numpy, dimod, dwave-samplers and the rest β can take tens of
seconds, long enough for a host's start-up timeout to show the server as
disconnected. Warm the cache once in a terminal first:
It resolves the environment and prints the version; from then on the host starts from that cache.
Claude Code registers it in one line:
Optimizing is then an ordinary chat:
You: I can carry 10 kg. Item A is worth 10 and weighs 6, B is worth 8 and weighs 5, C is worth 7 and weighs 4, D is worth 6 and weighs 3. Which ones should I take?
Behind the reply, the agent writes the request as problem JSON and calls
solve_optimization. Every solution comes back re-validated against the
original constraints, with optimality_proven: true on the exhaustive
exact backend; a document the server rejects comes back as
invalid_problem with every error and a fix for each, which the agent
applies before sending it again. Before solving on a remote backend, or on
a large problem, it calls validate_optimization_problem first, so a mistake
costs nothing; it calls get_optimization_capabilities when it needs the
backend list or the full schema.
Agent: Take A and C: value 17 at exactly 10 kg. The runners-up are A and D (16, at 9 kg) and B and C (15, at 9 kg). This is the proven optimum.
The wording is the agent's; the numbers are the tool result. Another tool,
recommend_backend, ranks the backends for a problem and is advisory only;
when you did not name a backend and more than one local backend fits, the
server instructions tell the agent to show the top entries and ask which to
run rather than to decide for you.
If your host lists prompts in its input menu, three of them β pick_subset,
assign and schedule_shifts β walk the agent from your own sentence to a
problem document of that everyday shape, which it then solves. The server
also serves resources: the six
example documents under annealbridge://examples/ and the full problem
schema at annealbridge://schema, so an agent can read a complete example or
the schema itself instead of guessing.
What it is not for. AnnealBridge does not handle continuous
(real-valued) variables, non-linear objectives or non-linear constraints.
Only exact proves that an answer is optimal or that no feasible one
exists, and by default it takes at most 24 compiled variables (slack bits
included); the other local backends (simulated_annealing, tabu,
simulated_bifurcation) are heuristics whose best answer may not be the
optimum. See the
Backends table below and
docs/limitations.md.
Any stdio-capable MCP host works the same way, a streamable-http transport
exists, and pipx or a pip-installed server behind an absolute path work in
place of uvx. uvx reuses the environment it resolved on its first run, so
a new release reaches an existing install only after uv cache clean annealbridge and a host restart; see docs/mcp.md.
Save the problem JSON below as knapsack.json, then:
Elapsed is the service's own wall clock and varies from run to run. Add
--json for the full SolveResult, --backend simulated_annealing to
override the backend, or try validate, recommend, capabilities,
example and export-schema. See docs/cli.md.
The document behind the MCP and CLI examples above, the reduced form of examples/knapsack.json:
Integer variables ("type": "integer" with bounds, "version": "1.1"),
cardinality constraints β exactly, at most or at least k of a set of binary
variables, a hard at-most-one compiling without slack variables
("cardinality_constraints", "version": "1.2") β quadratic objective terms,
soft constraints with weights and per-backend solver preferences are
described in
docs/problem-format.md.
annealbridge export-schema prints the JSON Schema an agent can use for
structured output.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/annealbridge)<a href="https://allmcps.com/mcp/annealbridge"><img src="https://allmcps.com/api/badge/annealbridge?style=directory" alt="AnnealBridge on AllMCPs" /></a>