@general-liquidity/sharpebench-mcp 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +36 -0
  2. package/dist/server.js +53 -0
  3. package/package.json +44 -0
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # @general-liquidity/sharpebench-mcp
2
+
3
+ An **MCP server** that exposes the [SharpeBench](https://github.com/general-liquidity/sharpebench) luck-robust scoring kernel as agent-callable tools. Point Claude (or any MCP client) at it and it can deflate a Sharpe, check pass^k reliability, audit a briefing for bias, or price an option's tail-risk — all from the deterministic Rust kernel, no network.
4
+
5
+ ## Tools
6
+
7
+ | Tool | What it does |
8
+ |---|---|
9
+ | `score` | Rank a field of submissions on the luck-robust composite |
10
+ | `score_agent` | Score one submission → deflated Sharpe / pass^k / process / rolling Sharpe |
11
+ | `self_audit` | Fire known gaming attacks at the scorer (anti-gaming proof) |
12
+ | `audit_briefing` | Audit a shared briefing for input-side salience bias |
13
+ | `score_allocation` | Score a weight-vector trajectory (validity + turnover) |
14
+ | `greeks` | Black-Scholes price + Greeks + tail-selling risk |
15
+ | `canary` | Derive a do-not-train contamination tripwire |
16
+
17
+ All tools are read-only and deterministic — safe to expose without sandboxing.
18
+
19
+ ## Use it
20
+
21
+ Add to your MCP client config (e.g. Claude Desktop's `mcpServers`):
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "sharpebench": {
27
+ "command": "npx",
28
+ "args": ["-y", "@general-liquidity/sharpebench-mcp"]
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ## License
35
+
36
+ MIT OR Apache-2.0, at your option.
package/dist/server.js ADDED
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * SharpeBench MCP server — exposes the luck-robust scoring kernel as
4
+ * Model-Context-Protocol tools, so Claude and other agents can call
5
+ * "deflate this Sharpe / check pass^k / audit this briefing" in their tool loop.
6
+ *
7
+ * Every tool is read-only and deterministic (the kernel has no I/O), so the
8
+ * server is safe to expose without sandboxing.
9
+ */
10
+ import { fileURLToPath } from "node:url";
11
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
12
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
13
+ import { z } from "zod";
14
+ import * as sb from "@general-liquidity/sharpebench";
15
+ /** Run a kernel call, returning its result as pretty JSON or a typed error result. */
16
+ function run(fn) {
17
+ try {
18
+ return { content: [{ type: "text", text: JSON.stringify(fn(), null, 2) }] };
19
+ }
20
+ catch (e) {
21
+ const message = e instanceof Error ? e.message : String(e);
22
+ return { content: [{ type: "text", text: `error: ${message}` }], isError: true };
23
+ }
24
+ }
25
+ /** Build the SharpeBench MCP server with all kernel tools registered. */
26
+ export function createServer() {
27
+ const server = new McpServer({ name: "sharpebench", version: "0.0.3" });
28
+ server.tool("score", "Rank a field of agent submissions on the luck-robust composite (deflated Sharpe + pass^k + process discipline). Raw return is reported but is never the rank key. Returns ranked CompositeScore[].", { submissions: z.array(z.any()), config: z.any().optional() }, async ({ submissions, config }) => run(() => sb.score(submissions, config)));
29
+ server.tool("score_agent", "Score a single submission → one CompositeScore (deflated Sharpe, pass^k verdict, process score, rolling worst-case Sharpe).", { submission: z.any(), config: z.any().optional() }, async ({ submission, config }) => run(() => sb.scoreAgent(submission, config)));
30
+ server.tool("self_audit", "Fire the known gaming attacks at the scorer and report whether each is demoted (the benchmark's anti-gaming proof). No input.", async () => run(() => sb.selfAudit()));
31
+ server.tool("audit_briefing", "Audit a shared briefing artifact for input-side salience bias: per-asset attention caps, required counterbalancing, no performance-sorted return tables.", { briefing: z.any(), policy: z.any().optional() }, async ({ briefing, policy }) => run(() => sb.auditBriefing(briefing, policy)));
32
+ server.tool("score_allocation", "Score a target-allocation weight-vector trajectory: weight validity + L1 turnover/churn.", { trajectory: z.any(), policy: z.any().optional() }, async ({ trajectory, policy }) => run(() => sb.scoreAllocation(trajectory, policy)));
33
+ server.tool("greeks", "Black-Scholes price + Greeks (delta/gamma/theta/vega/rho) + tail-selling (short-gamma/vega) classification for one option.", {
34
+ spot: z.number(),
35
+ strike: z.number(),
36
+ t_years: z.number(),
37
+ rate: z.number(),
38
+ vol: z.number(),
39
+ is_call: z.boolean(),
40
+ }, async (params) => run(() => sb.greeks(params)));
41
+ server.tool("canary", "Derive a deterministic do-not-train contamination tripwire token from seed material.", { seed: z.string() }, async ({ seed }) => run(() => sb.canary(seed)));
42
+ return server;
43
+ }
44
+ async function main() {
45
+ const server = createServer();
46
+ await server.connect(new StdioServerTransport());
47
+ }
48
+ if (process.argv[1] === fileURLToPath(import.meta.url)) {
49
+ main().catch((e) => {
50
+ console.error(e);
51
+ process.exit(1);
52
+ });
53
+ }
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@general-liquidity/sharpebench-mcp",
3
+ "version": "0.0.3",
4
+ "description": "MCP server exposing the SharpeBench luck-robust scoring kernel as agent-callable tools (deflated Sharpe, pass^k, process discipline, briefing audit, options Greeks).",
5
+ "keywords": [
6
+ "mcp",
7
+ "model-context-protocol",
8
+ "trading",
9
+ "sharpebench",
10
+ "benchmark",
11
+ "ai-agents"
12
+ ],
13
+ "license": "MIT OR Apache-2.0",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/general-liquidity/sharpebench.git",
17
+ "directory": "npm/mcp"
18
+ },
19
+ "type": "module",
20
+ "bin": {
21
+ "sharpebench-mcp": "dist/server.js"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "scripts": {
27
+ "build": "tsc",
28
+ "test": "node --test",
29
+ "start": "node dist/server.js",
30
+ "prepublishOnly": "tsc"
31
+ },
32
+ "dependencies": {
33
+ "@general-liquidity/sharpebench": "^0.0.3",
34
+ "@modelcontextprotocol/sdk": "^1.0.0",
35
+ "zod": "^3.23.0"
36
+ },
37
+ "devDependencies": {
38
+ "@types/node": "^20.0.0",
39
+ "typescript": "^5.6.0"
40
+ },
41
+ "engines": {
42
+ "node": ">=18"
43
+ }
44
+ }