MatLogica AADC: AAD, Greeks and the AADC Tracer

com.matlogicaPublished by matlogica.comv0.2.1Updated Nov 6, 2026

AAD from your coding agent: exact Greeks with MatLogica AADC, and a price traced to its source line

Overview

AI-generated overview

Runs MatLogica AADC automatic adjoint differentiation locally: traces Python pricers, computes exact Greeks, and replays tapes at new inputs.

What you can do
  • Check the local AADC engine, licence edition and self-tests
  • Run a Python script with tracing on and keep the resulting tape, or load and list existing tapes
  • Question a tape in the engine's grammar: stats, leaves, branches, sites, source lines, find, origin, uses, cone
  • Replay a tape at new input values and report whether the recorded path still holds
  • Open a live recording session, ask it the same questions, replay it exactly, and close it
  • List, read and run bundled examples, including unmodified QuantLib pricers
When to use it
Useful when an assistant is helping with AADC work: exact derivatives and Greeks for a Python pricer, derivatives that jump at a branch or kink, or tracing a computed price back to the source lines that produced it.
Requirements
Runs as a local stdio process installed from the aadc-mcp PyPI package, on desktop only. Needs a Python interpreter with the AADC engine and, for QuantLib examples, aadc-quantlib-tracing on Linux x86-64 or macOS arm64. No authentication, environment variables or headers are declared.
Before you install
trace_script and run_example execute Python code on the user's own machine with tracing on; the server states this is not a sandbox. Tapes and sessions are held in the server's working folder. A replay with survives=false carries no value and should not be estimated. A tape reflects one execution at one input point, not all possible paths.

Installation

In SourceWeft

  1. Open MatLogica AADC: AAD, Greeks and the AADC Tracer in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Tools

15

check_environment

What this interpreter can do with AADC and the Tracer, measured: installed packages and versions, platform, licence (one sentence naming the edition the engine runs as and what it permits; tell the user), an engine self-test (record, replay, reverse: dz/dx = 6 at x = 3), a tracing self-test (one traced QuantLib call must attribute leaves to QuantLib's C++), and findings with the pip command that fixes each. Call it first; call it again after installing anything.

Takes no parameters.

trace_script

Run a Python script with tracing on and keep the record (tape) it leaves. The script needs no changes: it runs in its own directory with AADC_TRACE=1, so every calculation through aadc types or an AADC-built library such as aadc-quantlib-tracing is recorded with its source coordinates. Returns tape_id, the script's stdout and stderr, the engine's census (frozen branch sites, outputs) and stats. A script that records itself and ends with f.save_tape() writes to AADC_TRACE_OUT; mark its first line with 'mode=explicit'. outputs: optional AADC_TRACE_OUTPUTS entries, e.g. ['value=123.45'] or ['pricer.py:42'], to name the program's results on the tape. python: another interpreter to run under (the one where the user's packages live). This runs the user's own code on the user's own machine; it is not a sandbox.

Parametersargspathrequiredpythonoutputsworkdirtimeout_s

inspect_tape

Ask the tape one question in the engine's own grammar and get its text answer plus the parsed header. Verbs: 'stats' | 'leaves [kind=input|constant] [by=leaf] [limit=N]' | 'branches order=margin [limit=N]' | 'sites [file=NAME] [limit=N]' | 'at FILE:LINE [context=N]' (source with the recorded values; hash=ok means the file shown is the one compiled) | 'find value=X' (where a printed number was computed) | 'origin #N' (the formula behind a value) | 'uses #N' | 'cone #N' (which leaves can move a value, by derivative or only by a branch) | 'source root=COMPILED=LOCAL' (map compiled paths to a local source tree) | 'replay ...' (prefer the replay tool). Ids are #N from earlier answers. A malformed request answers status=error in the header, never an exception.

Parametersrequestrequiredtape_idrequiredmax_lines

replay

Re-evaluate the tape at new inputs without re-running the model. assignments: '#12=101' or '#12=101,#15=0.21' (leaf ids from 'leaves kind=input' or 'leaves by=leaf'); out: the output id from 'find value=<printed price>'. survives=true: the recorded path holds and value is exact (equal to a fresh run to the last digit). survives=false: WITHHELD; flipped names the decision (file:line, decided true -> false) and unchecked the conversions the tape cannot check. There is no value to quote in that case. A tape read back from a file keeps no operand for a counted conversion, so on most QuantLib tapes a replay is withheld with unchecked naming the line (often errorfunction.cpp:200); say so and re-run the script at the new inputs for the price. path_recorded=true returns the recorded path's value labelled as such, for comparison only.

Parametersoutrequiredtape_idrequiredassignmentsrequiredpath_recorded

set_source_root

Map the compiled source prefix recorded on the tape (for aadc-quantlib-tracing 1.41 it is /project/work/QLAADC/ql) to a local directory holding that source, so 'at FILE:LINE' and 'origin' can show the code. Later answers say hash=ok when the local file is the one the library was compiled from and hash=MISMATCH when it is not; a mismatch is reported, never silent. Remembered for this tape.

Parameterstape_idrequiredlocal_dirrequiredcompiled_prefixrequired

load_tape

Register an existing .tape file written earlier (by trace_script, by a script's own save_tape(), or downloaded from a report) and return its tape_id and stats.

Parameterspathrequired

list_tapes

The tapes this server holds: id, file, size, the script that produced each, and the source roots applied.

Takes no parameters.

open_session

Run a Python script that records itself (aadc.Functions, start_recording with marked inputs, stop_recording) and keep its process alive, so later questions are answered by the object that recorded. Returns session_id, the script's stdout, which Functions object was kept, and its stats. Why: a record read back from a file cannot re-check a counted conversion, so 'replay' on it is often withheld; in the recording process the same replay is exact (the same digits as pricing again). Use it for what-ifs and sensitivities on a script with marked inputs; for an unmodified script use trace_script. The script's save_tape() to AADC_TRACE_OUT also registers a tape. Idle sessions close themselves after AADC_MCP_SESSION_IDLE_S seconds (default 1800). This runs the user's own code on the user's own machine.

Parametersargspathrequiredpythontimeout_s

ask_session

The same question grammar as inspect_tape (stats, leaves, branches, sites, at, find, origin, uses, cone, source), answered by the live recording of an open_session.

Parametersrequestrequiredmax_linessession_idrequired

replay_session

Replay the live recording at new inputs. assignments: '#0=101' (leaf ids from ask_session 'leaves kind=input by=leaf'); out: the id marked OUTPUT from 'find value=<printed price>'. survives=true means the recorded path holds and value is exact to the last digit; survives=false is WITHHELD with the decision named (flipped) and no value.

Parametersoutrequiredsession_idrequiredassignmentsrequiredpath_recorded

close_session

End a live session and free its process.

Parameterssession_idrequired

list_sessions

The live sessions this server holds: id, script, start time, questions answered.

Takes no parameters.

list_examples

Bundled scripts to start from: plain AADC (any platform), and unmodified QuantLib pricers that aadc-quantlib-tracing records (Linux x86-64, macOS arm64). mode=auto scripts are traced as they are; mode=explicit scripts record themselves and print sensitivities. Each is a starting point to copy and edit.

Takes no parameters.

get_example

The source of one bundled example, to read, copy or adapt.

Parametersnamerequired

run_example

Copy one bundled example into the server's working folder, run it with tracing on and return its tape_id, its printed output and the tape's stats. Then question the tape with inspect_tape and replay.

Parametersnamerequiredtimeout_s

Version history

2
  1. v0.2.1LatestNov 5, 2026
  2. v0.2.0Nov 5, 2026

Score

55% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts

    Publish an icon in the registry entry.

  • Documentation15 pts

    Declare a GitHub repository with a README, or serve resource_documentation in the OAuth protected-resource metadata.

  • License10 pts

    Declare a license in the repository or the registry entry.