sigrank 0.15.1 → 0.15.4
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.
- package/README.md +1 -1
- package/index.mjs +88 -2
- package/package.json +1 -1
- package/tools.mjs +57 -13
package/README.md
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
For all builders, burners and 10xers.
|
|
12
12
|
|
|
13
13
|
[](https://www.npmjs.com/package/sigrank)
|
|
14
|
-
[](https://www.npmjs.com/package/sigrank)
|
|
15
14
|
[](https://github.com/SunrisesIllNeverSee/sigrank-mcp/actions/workflows/ci.yml)
|
|
16
15
|
[](./LICENSE)
|
|
17
16
|
[](https://nodejs.org)
|
|
18
17
|
[](https://signalaf.com)
|
|
18
|
+
[](https://glama.ai/mcp/servers/SunrisesIllNeverSee/sigrank-mcp)
|
|
19
19
|
|
|
20
20
|
</div>
|
|
21
21
|
|
package/index.mjs
CHANGED
|
@@ -23,7 +23,14 @@
|
|
|
23
23
|
|
|
24
24
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js'
|
|
25
25
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
CallToolRequestSchema,
|
|
28
|
+
ListToolsRequestSchema,
|
|
29
|
+
ListPromptsRequestSchema,
|
|
30
|
+
GetPromptRequestSchema,
|
|
31
|
+
McpError,
|
|
32
|
+
ErrorCode,
|
|
33
|
+
} from '@modelcontextprotocol/sdk/types.js'
|
|
27
34
|
import { TOOLS, callTool } from './tools.mjs'
|
|
28
35
|
import { runCli } from './cli.mjs'
|
|
29
36
|
import { readFileSync } from 'node:fs'
|
|
@@ -52,7 +59,10 @@ process.on('unhandledRejection', (reason) => {
|
|
|
52
59
|
})
|
|
53
60
|
|
|
54
61
|
async function startMcpServer() {
|
|
55
|
-
const server = new Server(
|
|
62
|
+
const server = new Server(
|
|
63
|
+
{ name: 'sigrank', version: serverVersion() },
|
|
64
|
+
{ capabilities: { tools: {}, prompts: {} } },
|
|
65
|
+
)
|
|
56
66
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }))
|
|
57
67
|
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
58
68
|
// Unknown tool name = a client/host bug → JSON-RPC -32602 protocol error, per the MCP
|
|
@@ -67,6 +77,82 @@ async function startMcpServer() {
|
|
|
67
77
|
return { content: [{ type: 'text', text: `Error: ${e.message}` }], isError: true }
|
|
68
78
|
}
|
|
69
79
|
})
|
|
80
|
+
|
|
81
|
+
// --- Prompts: interactive templates that agents can offer to users ---
|
|
82
|
+
const PROMPTS = [
|
|
83
|
+
{
|
|
84
|
+
name: 'check-my-efficiency',
|
|
85
|
+
description:
|
|
86
|
+
'Pull your local token usage, compute your SigRank yield, and compare your efficiency against the leaderboard. Shows your class tier (Burner/Builder/10xer) and where you rank.',
|
|
87
|
+
arguments: [],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'simulate-improvement',
|
|
91
|
+
description:
|
|
92
|
+
'Run a what-if analysis on your token mix: "if I increased my cache reads by 50k, how would my yield change?" Uses simulate_change to show the payoff before you change your workflow.',
|
|
93
|
+
arguments: [
|
|
94
|
+
{
|
|
95
|
+
name: 'change',
|
|
96
|
+
description: 'The change to simulate (e.g. "increase cache reads by 50000" or "reduce input by 100000")',
|
|
97
|
+
required: true,
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'compare-with-leader',
|
|
103
|
+
description:
|
|
104
|
+
'Fetch the top operator from the SigRank leaderboard and compare their token efficiency metrics against yours. Shows the gap and what you\'d need to change to close it.',
|
|
105
|
+
arguments: [],
|
|
106
|
+
},
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => ({ prompts: PROMPTS }))
|
|
110
|
+
server.setRequestHandler(GetPromptRequestSchema, async (req) => {
|
|
111
|
+
const name = req.params.name
|
|
112
|
+
const args = req.params.arguments || {}
|
|
113
|
+
if (name === 'check-my-efficiency') {
|
|
114
|
+
return {
|
|
115
|
+
messages: [
|
|
116
|
+
{
|
|
117
|
+
role: 'user',
|
|
118
|
+
content: {
|
|
119
|
+
type: 'text',
|
|
120
|
+
text: 'Pull my local token usage with tokenpull, compute my yield, and then fetch the leaderboard so I can see where I rank. Show me my class tier and my key metrics (Yield, Leverage, Velocity).',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (name === 'simulate-improvement') {
|
|
127
|
+
const change = args.change || 'increase cache reads by 50000'
|
|
128
|
+
return {
|
|
129
|
+
messages: [
|
|
130
|
+
{
|
|
131
|
+
role: 'user',
|
|
132
|
+
content: {
|
|
133
|
+
type: 'text',
|
|
134
|
+
text: `First pull my local token usage with tokenpull to get my current pillars. Then use simulate_change to answer: "what if I ${change}?" Show me the yield delta and whether my class tier would change.`,
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (name === 'compare-with-leader') {
|
|
141
|
+
return {
|
|
142
|
+
messages: [
|
|
143
|
+
{
|
|
144
|
+
role: 'user',
|
|
145
|
+
content: {
|
|
146
|
+
type: 'text',
|
|
147
|
+
text: 'Fetch the SigRank leaderboard with get_leaderboard, then pull my local token usage with tokenpull. Compare my yield, leverage, and velocity against the top operator. What\'s the gap and what would I need to change to close it?',
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
throw new McpError(ErrorCode.InvalidParams, `Unknown prompt: ${name}`)
|
|
154
|
+
})
|
|
155
|
+
|
|
70
156
|
await server.connect(new StdioServerTransport())
|
|
71
157
|
}
|
|
72
158
|
|
package/package.json
CHANGED
package/tools.mjs
CHANGED
|
@@ -169,30 +169,63 @@ export const TOOLS = [
|
|
|
169
169
|
{
|
|
170
170
|
name: 'rank_paste',
|
|
171
171
|
description:
|
|
172
|
-
'
|
|
173
|
-
inputSchema: {
|
|
172
|
+
'Computes the SigRank yield cascade from a paste of token counts. Parses the input, runs the full cascade math locally (no network calls), and returns: Υ Yield (the headline efficiency metric, Υ = Cache Reads × Output / Input²), SNR (signal-to-noise ratio), Leverage ratio (Cr/I = cache reads divided by input), Velocity (O/I = output divided by input), 10xDEV score, operator class tier (Burner / Builder / 10xer), and a deterministic prose "card" summarizing the result in plain English. Accepts two input formats: (1) JSON object {"input":N,"output":N,"cacheCreate":N,"cacheRead":N} or (2) four whitespace-separated numbers in order: input output cacheCreate cacheRead. Returns an error if the input is malformed or has negative values. Use this for a quick one-off ranking without submitting to the board. Do NOT use this to submit your score — use submit_paste instead, which both ranks and publishes. Do NOT use this if you want to rank all four time windows at once — use rank_windows for that. After calling this, use submit_paste to publish the result if you want to appear on the leaderboard.',
|
|
173
|
+
inputSchema: {
|
|
174
|
+
type: 'object',
|
|
175
|
+
properties: {
|
|
176
|
+
text: {
|
|
177
|
+
type: 'string',
|
|
178
|
+
description: 'Token counts to rank. Two formats accepted: (1) JSON object {"input":N,"output":N,"cacheCreate":N,"cacheRead":N} where all values are non-negative integers, or (2) four whitespace-separated numbers in order: input output cacheCreate cacheRead. Get these from `ccusage` output, the Claude Max usage dashboard, tokscale, or any token reader. Example valid input: {"input":1000000,"output":500000,"cacheCreate":50000,"cacheRead":800000}',
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
required: ['text'],
|
|
182
|
+
description: 'Requires the token counts as a string. No other parameters are accepted.',
|
|
183
|
+
},
|
|
174
184
|
},
|
|
175
185
|
{
|
|
176
186
|
name: 'get_leaderboard',
|
|
177
|
-
description:
|
|
178
|
-
|
|
187
|
+
description:
|
|
188
|
+
"Fetches the live public SigRank leaderboard from signalaf.com. Reads all ranked operators sorted by yield (Υ = Cache Reads × Output / Input²) and returns an array of operator summaries. Each entry contains: codename (public display name), yield (Υ, the headline efficiency metric), leverage ratio (Cr/I = cache reads divided by input), velocity (O/I = output divided by input), class tier (Burner / Builder / 10xer), and rank position (integer, 1-based). Returns an empty array if no operators have submitted yet. Use this to see where operators stand overall, to find specific codenames for get_operator lookups, or to display the current rankings. Do NOT use this to check your own rank if you already know your codename — use get_operator instead for a single-operator profile with per-window breakdowns. After calling this, follow up with get_operator to get detailed metrics for any operator of interest.",
|
|
189
|
+
inputSchema: {
|
|
190
|
+
type: 'object',
|
|
191
|
+
properties: {},
|
|
192
|
+
description: 'This tool takes no parameters. It always fetches the full public leaderboard.',
|
|
193
|
+
},
|
|
179
194
|
},
|
|
180
195
|
{
|
|
181
196
|
name: 'get_operator',
|
|
182
|
-
description:
|
|
183
|
-
|
|
197
|
+
description:
|
|
198
|
+
"Fetches one operator's live profile from the SigRank board by their codename. Reads the operator's current submission data from signalaf.com and returns their detailed metrics: yield (Υ), leverage ratio (Cr/I), velocity (O/I), class tier (Burner / Builder / 10xer), rank position (integer, 1-based), and per-window breakdowns for each time range (7d, 30d, 90d, all-time) with the four canonical pillars (input, output, cacheCreate, cacheRead) per window. Returns an error if the codename is not found on the board. Use this to look up any operator who has submitted to the board — codenames are public and visible on the leaderboard. Do NOT use this to browse all operators — use get_leaderboard for that. After calling this, you can use simulate_change to model what would happen if the operator adjusted their token mix.",
|
|
199
|
+
inputSchema: {
|
|
200
|
+
type: 'object',
|
|
201
|
+
properties: {
|
|
202
|
+
codename: {
|
|
203
|
+
type: 'string',
|
|
204
|
+
description: 'The operator\'s public codename as shown on the SigRank leaderboard. Case-insensitive — "Ghost Falcon" and "ghost falcon" are equivalent. Must match a codename that exists on the board; returns an error if not found. To discover valid codenames, call get_leaderboard first.',
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
required: ['codename'],
|
|
208
|
+
description: 'Requires the operator\'s codename. No other parameters are accepted.',
|
|
209
|
+
},
|
|
184
210
|
},
|
|
185
211
|
{
|
|
186
212
|
name: 'submit_paste',
|
|
187
213
|
description:
|
|
188
|
-
'
|
|
214
|
+
'Ranks a paste of token counts AND publishes it to the live SigRank board at signalaf.com in one call. First computes the cascade locally for an instant preview (yield, leverage, velocity, class, card), then submits the raw paste to the board\'s web-paste endpoint, which re-parses and re-scores it server-side. The server score is authoritative — it may differ from the local preview if the board applies additional validation. Returns both the local preview and the server response (including the operator\'s new rank if accepted). A codename is required to publish — omit it for a local preview only (no board submission). Token-only, no auth required. Use this when you have token counts from ccusage or a dashboard and want to both see your score and publish it. Do NOT use this if you want to pull your local usage automatically — use tokenpull_submit for the zero-paste flow. Do NOT use this for multi-window dashboard pastes — use rank_windows to rank them first, then submit each window. After calling this, use get_operator with your codename to verify your submission appeared on the board.',
|
|
189
215
|
inputSchema: {
|
|
190
216
|
type: 'object',
|
|
191
217
|
properties: {
|
|
192
|
-
text: {
|
|
193
|
-
|
|
218
|
+
text: {
|
|
219
|
+
type: 'string',
|
|
220
|
+
description: 'Token counts to rank and submit. Two formats: (1) JSON {"input":N,"output":N,"cacheCreate":N,"cacheRead":N} from ccusage (preferred — the board parses this reliably), or (2) four whitespace-separated numbers: input output cacheCreate cacheRead. The 4-number form ranks locally but the board may reject it. Example: {"input":1000000,"output":500000,"cacheCreate":50000,"cacheRead":800000}',
|
|
221
|
+
},
|
|
222
|
+
codename: {
|
|
223
|
+
type: 'string',
|
|
224
|
+
description: 'Operator codename to publish under on the leaderboard (e.g. "Ghost Falcon"). Required to submit — omit for local preview only (no board submission, just returns the local cascade result). Must be a non-empty string.',
|
|
225
|
+
},
|
|
194
226
|
},
|
|
195
227
|
required: ['text'],
|
|
228
|
+
description: 'Requires token counts (text). Codename is optional but required for board submission — omit it for preview-only mode.',
|
|
196
229
|
},
|
|
197
230
|
},
|
|
198
231
|
{
|
|
@@ -213,13 +246,24 @@ export const TOOLS = [
|
|
|
213
246
|
{
|
|
214
247
|
name: 'tokenpull_submit',
|
|
215
248
|
description:
|
|
216
|
-
"Pull your LOCAL usage
|
|
249
|
+
"Pull your LOCAL token usage from session logs AND publish it to the SigRank board in one call — the zero-paste flow. Reads the four canonical pillars (input, output, cacheCreate, cacheRead) per window from your local logs, computes the cascade, and submits each window to the board where it is re-scored server-side and tagged with the source platform. Requires a codename to publish; omit for a local preview only. Token-only — no prompt content is read or transmitted.",
|
|
217
250
|
inputSchema: {
|
|
218
251
|
type: 'object',
|
|
219
252
|
properties: {
|
|
220
|
-
codename: {
|
|
221
|
-
|
|
222
|
-
|
|
253
|
+
codename: {
|
|
254
|
+
type: 'string',
|
|
255
|
+
description: 'Operator codename to publish under on the leaderboard (e.g. "Iron Lotus"). Required to submit — omit for local preview only.',
|
|
256
|
+
},
|
|
257
|
+
window: {
|
|
258
|
+
type: 'string',
|
|
259
|
+
enum: ['7d', '30d', '90d', 'all'],
|
|
260
|
+
description: 'Submit only this time window (default: all 4 windows). Use "7d" for recent activity or "all" for all-time ranking.',
|
|
261
|
+
},
|
|
262
|
+
platform: {
|
|
263
|
+
type: 'string',
|
|
264
|
+
enum: ALL_PLATFORMS,
|
|
265
|
+
description: `Source platform to pull from (default: claude). Supported: ${ALL_PLATFORMS.join(', ')}. Each platform reads its own session logs locally.`,
|
|
266
|
+
},
|
|
223
267
|
},
|
|
224
268
|
},
|
|
225
269
|
},
|