alphaledger
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@alphaledgerhas my momentum factor been tried before? evaluate it and gate the result"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
The problem, in one table
What you see | What you conclude | |
One factor, on its own | RankIC | Significant. Ship it. |
The same factor, 200 draws deep | the same numbers, plus | It is luck. Drop it. |
Nothing about the factor changed. Only the count did.
That count is the one thing an agent cannot keep. A researcher tests five ideas a day and remembers them. An agent tests two hundred an hour, and every session starts with a blank context.
Related MCP server: plzebo-mcp
See it in twenty seconds
One command, on a panel of 300 names × 250 dates where every factor is pure noise:
$ python demos/noise_200.py
best factor fp=v1:32625af66…
RankIC +0.0105
t (iid / NW) 3.03 / 3.27
p_single 0.00273 <- looks publishable
family 200 trials
bar_q95 3.67 <- what a real factor needed
p_family 0.346 <- it is luck
verdict REJECT
"Trial #200 of 200 — REJECT. IC=+0.0105, t=3.03, p_single=0.0027, p_family=0.346."A RankIC of 1% is an ordinary magnitude for a real factor, so the size of the effect cannot tell you whether it is real. The only discriminating information is how many times you drew.
How it works
flowchart LR
F["factor panel"] --> IC["RankIC series<br/>one value per date"]
R["forward returns"] --> IC
IC --> ID["fingerprint<br/>rank pattern, hashed"]
IC --> ST["t, p_single"]
ID --> L[("ledger")]
L --> FAM["family<br/>N trials on this panel"]
FAM --> NUL["null of max abs(t)<br/>block bootstrap"]
ST --> G{"p_family ≤ α ?"}
NUL --> G
G -->|yes| P["PASS"]
G -->|no| X["REJECT"]Four tools sit on top of that loop:
Tool | Question it answers | Cost |
| Have I tried this factor before? | free — no trial consumed |
| What is its RankIC, and what is its trial number? | one trial |
| Does it survive the family correction, and how far off was it? | free |
| How much have I tried, and where am I going in circles? | free |
A PASS requires p_family ≤ α. p_single is reported and is never evidence.
Install
alphaledger is an MCP server, wrapped in a four-file dsh plugin. One implementation, two ways in; nothing leaves the machine and no API key is involved.
DeepSeek Harness — one command:
$ dsh plugin --profile web add dsh-alphaledgerThe bundle only writes the config that launches the server. If you would rather see it:
- insert:
- id: alphaledger
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: alphaledger
transport: stdio
command: uvx
args: ['alphaledger-mcp']
failOnStartupError: trueClaude Code, Codex, or any other MCP client:
claude mcp add alphaledger -- uvx alphaledger-mcpTools appear as mcp__alphaledger__evaluate, mcp__alphaledger__gate, and so on.
Both routes need uv once (curl -LsSf https://astral.sh/uv/install.sh | sh),
because dsh deliberately does not manage Python environments. The server is on PyPI;
the npm bundle is not published yet, so for now the dsh route installs from the
checkout: dsh plugin --profile web add ./dsh/alphaledger. That is the ordinary
pnpm add path, not a fallback — it was run against dsh 0.2.0-rc.2 with an isolated
DSH_HOME: the command exits 0, dsh-alphaledger is added to dsh.profile.bundles,
and its MCP entry appears in dsh --profile <name> --dump-config. Publishing to npm
would only buy the shorter spelling dsh plugin add dsh-alphaledger.
Dependencies are numpy and the standard library. scipy would double the install and add seconds to a cold start, and the two things we needed from it — rank correlation and Student-t tails — are a few dozen lines. See
docs/METHOD.md.
Three things the ledger refuses to do
It will not count rank(x) as a new factor.
Identity is the factor's rank pattern, hashed as integers. x, rank(x), log(x) and 2x+3 rank identically, so they are one trial with four evaluations. Flipping the sign is the same trial too — recorded as a sign_flip, which is the cheapest way a family quietly grows.
It will not merge near-duplicates.
Two factors correlating at 0.97 are reported as NEAR_DUPLICATE and left alone. Merging them would let "I only changed one parameter" escape the count, which is the entire problem.
It will not pass a leaked factor.
A factor ranked identically to the forward return is LABEL_CONTAMINATION, checked before significance — because that is the one case where the numbers look best.
What it does not do
No data layer — you bring a panel, and an akshare adapter is planned. No backtest engine, no portfolio construction, no UI. It judges one factor's IC series and keeps the books, and that is all.
Documentation
Every formula, with the function and the test that pins it | |
Schemas, error codes, host wiring | |
Three existing dsh quant tools, read at source level | |
Measured false-positive rate and power | |
What shipped, what is v0.2 |
Status
0.1.0. On PyPI as alphaledger-mcp. The npm bundle is not published yet. Statistics, identity, ledger and the MCP surface are implemented and tested: 104 tests, ruff and mypy clean, false-positive rate 8.3% (1 in 12 studies), power 4 of 4 on a planted IC of 0.03.
v0.2: akshare adapter, one-shot OOS test lock, full look-ahead perturbation.
Available Tools
4 toolsevaluateB
Measure one factor and record it as a trial. Returns cross-sectional RankIC, Newey-West t, single-test p, the trial's index within its family, and the family-adjusted verdict. This is the only supported way to produce evidence.
| Name | Required | Description | Default |
|---|---|---|---|
| expr | No | ||
| alpha | No | ||
| label | No | ||
| factor | Yes | A (dates x names) panel. Prefer {'path': 'f.npz', 'key': 'factor'}; inline {'values': [[...]]} is allowed only up to 200x200. | |
| forward | Yes | Forward returns, already shifted: forward[t] follows factor[t]. | |
| horizon | No | ||
| with_gate | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations, so the description carries full behavioral burden. It usefully discloses that a trial is recorded (a state-mutating side effect) and enumerates the statistical outputs, but says nothing about permissions, idempotency, or what 'family-adjusted verdict' means operationally.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three tight sentences with purpose front-loaded, then return values, then positioning. No filler, though the return-value sentence is dense and could be enumerated more legibly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description usefully enumerates the returned statistics, which is its main strength. But for a 7-parameter, nested-object tool it leaves the trial/family concept and five parameters undefined, so an agent cannot fully reason about the call.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 29%, and the description adds no parameter-level meaning at all. Five parameters (expr, alpha, label, horizon, with_gate) are undocumented in both schema and description, including the horizon and the gate behavior that materially change the result.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource ('Measure one factor and record it as a trial') and names what it produces. It gestures at differentiation via 'the only supported way to produce evidence,' implying fingerprint/gate are not evidence producers, but never names a sibling explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'This is the only supported way to produce evidence' gives a positive usage cue, and 'record it as a trial' implies the ledger/family context. However there is no when-not guidance, no named alternative, and no prerequisites (e.g., what must exist before evaluating).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
fingerprintA
Identify a factor WITHOUT consuming a trial. Returns the value fingerprint, whether the ledger has seen it, and its position if so. Call this before writing new factor code to avoid re-testing something already counted.
| Name | Required | Description | Default |
|---|---|---|---|
| expr | No | Optional factor expression, for diagnostics only. | |
| factor | Yes | A (dates x names) panel. Prefer {'path': 'f.npz', 'key': 'factor'}; inline {'values': [[...]]} is allowed only up to 200x200. | |
| forward | Yes | The return panel this factor would be tested on. Required because identity is scoped to a panel: the same factor tested on a different universe is a different trial, not a repeat. | |
| horizon | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does disclose the single most important behavioral trait here: this operation does not consume a trial budget, i.e. it is a non-mutating lookup. It also previews the return fields. It omits error behavior, whether anything is written to the ledger, and cost/limits for large inline panels.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, front-loaded with the core value proposition (identity without trial cost), followed by return shape and then the call-to-action. No filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and no annotations, the description steps up by naming the three return values (fingerprint, seen status, position). Still missing enough to be fully complete for a 4-param nested tool: it does not explain 'position', 'horizon', or what happens when the ledger has not seen the factor.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 75% and the nested factor/forward/horizon descriptions already explain panel format, path resolution, and the panel-scoping rationale. The tool description adds no additional parameter meaning beyond a vague 'already counted' notion. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Identify a factor') plus a scope constraint ('WITHOUT consuming a trial') and enumerates the return contents. Sibling differentiation is only implicit — it never names 'evaluate', though the 'without consuming a trial' contrast points at it.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives an explicit trigger: 'Call this before writing new factor code to avoid re-testing something already counted.' That is clear when-to-use guidance, but no when-not condition or named alternative (e.g. use evaluate when you actually want to test) is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
gateA
Re-judge an already-recorded trial against its family, optionally at a different alpha. Use after importing more trials or to ask 'how much better would this need to be'.
| Name | Required | Description | Default |
|---|---|---|---|
| fp | Yes | Value fingerprint returned by evaluate. | |
| alpha | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It never states whether re-judging is a read-only computation or whether a new verdict is persisted to the ledger, nor does it describe error behavior when the fingerprint is stale or unknown. For an operation whose name suggests a decision gate, this ambiguity about side effects is a real gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tight sentences: purpose first, then usage context. No filler, and the core action is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no annotations, no output schema, and only one of two parameters documented, the description should do more — notably explain what the re-judged result contains and whether state changes. It covers purpose and timing adequately but leaves behavioral completeness thin.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 50%: 'fp' is documented in the schema as the fingerprint from evaluate, but 'alpha' has only numeric bounds and a default. The description partially compensates by clarifying that alpha is optional and re-sets the significance threshold ('optionally at a different alpha'), adding meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a specific verb ('Re-judge') and resource ('an already-recorded trial against its family'), which is far more informative than the opaque name 'gate'. It implicitly differentiates from the sibling 'evaluate' by specifying that the trial is already recorded, but never names or contrasts the siblings explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives concrete triggering conditions: 'after importing more trials' and 'to ask how much better would this need to be'. That is clear when-to-use guidance, though it offers no when-not-to-use or explicit pointer to 'evaluate' vs 'gate'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ledger_statsB
How much has been tried, and where the session is going in circles: repeated evaluations, sign flips, near-duplicate clusters, and the cross-family error rate.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full behavioral burden. It does disclose the analytical dimensions returned (repeat counts, sign flips, cluster duplicates, error rate), implying a read-only aggregation, but says nothing about output format, scoring semantics (e.g. what 'cross-family' means), or cost.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence that front-loads the intent and enumerates the metrics. Somewhat flowery phrasing ('going in circles') costs a little precision but the sentence is compact and earns its length.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-param, no-annotation tool with no output schema, the description is reasonably complete: it tells the agent what the tool reports. It stops short of clarifying how to interpret 'cross-family' or the return shape, which would fully close the gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, so there is nothing to document; the baseline for a parameterless tool is 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names concrete metrics (repeated evaluations, sign flips, near-duplicate clusters, cross-family error rate), which tells the agent this is a reporting/aggregation tool over some ledger. However, the framing 'how much has been tried, and where the session is going in circles' is impressionistic, and it never states a clear verb+resource or distinguishes itself from siblings like evaluate or gate.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to call this versus fingerprint, evaluate, or gate, no prerequisites, and no exclusions. The agent must infer usage entirely from the metric list.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
evaluate - First observed
fingerprint - First observed
gate - First observed
ledger_stats
TDQS
Scored across 4 tools
Each tool has a distinct role: fingerprint checks identity without a trial, evaluate records evidence, ledger_stats summarizes behavior, and gate re-judges existing trials. The only mild overlap is between evaluate and gate, both of which return family-adjusted verdicts, but their preconditions and use cases are clearly separated.
All names are lowercase snake_case and readable, but they mix noun-style names (fingerprint, gate, ledger_stats) with a verb (evaluate). There is no single predictable verb_noun or noun pattern throughout.
Four tools is well-scoped for a focused factor-research ledger. Each tool covers a distinct part of the workflow and none feels redundant or excessive.
The core lifecycle is covered: identify a factor, evaluate and record it, inspect ledger health, and re-judge recorded trials. Minor gaps exist around listing or retrieving individual trials and explicit import/export operations, though these may be intentionally outside the server's scope.
Maintenance
Related MCP Connectors
Live trading-pipeline intelligence for AI agents: signal scoring, calibration, recorded outcomes.
Checkpoint-paired twin trials for agent fleet changes with blinded verdicts.
Market regime, execution-cost, bar-QC and backtest-audit tools for agents. Pay per call via x402.
Quantitative equity toolkit: factor data, backtests, risk model, attribution, optimizer.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables recording and analyzing AI agent execution traces, including event logging, metric computation, loop detection, and JSON export for debugging agent behavior.MIT
- AlicenseNot gradedqualityCmaintenanceEnables cost-parity benchmarking of agent loops by starting, extending, and monitoring paired trials, and retrieving receipts with statistical verdicts.30 npmMIT
- AlicenseAqualityAmaintenanceProvides point-in-time financial data access and an honest backtesting engine via MCP, enabling users to research restated fundamentals, run backtests with deflated Sharpe metrics, and benchmark returns against published factors.841 PyPI1MIT
- AlicenseNot gradedqualityBmaintenanceEnables A-share quantitative factor workflows from any MCP client, including sandboxed factor execution, qlib backtesting, out-of-sample admission checks, daily factor computation, decay monitoring, ML training/prediction, and portfolio/volatility analytics.1MIT