qyl-mcp-server 7.1.0 → 7.2.0

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 (75) hide show
  1. package/README.md +118 -15
  2. package/dist/auth-extensions.d.ts +20 -0
  3. package/dist/auth-extensions.js +81 -0
  4. package/dist/auth-extensions.js.map +1 -0
  5. package/dist/auth.d.ts +4 -0
  6. package/dist/auth.js +5 -0
  7. package/dist/auth.js.map +1 -0
  8. package/dist/authorization.d.ts +14 -0
  9. package/dist/authorization.js +82 -0
  10. package/dist/authorization.js.map +1 -0
  11. package/dist/ci.d.ts +5 -5
  12. package/dist/ci.js +25 -19
  13. package/dist/ci.js.map +1 -1
  14. package/dist/collector-access.d.ts +17 -0
  15. package/dist/collector-access.js +61 -0
  16. package/dist/collector-access.js.map +1 -0
  17. package/dist/collector.d.ts +4 -1
  18. package/dist/collector.js +6 -2
  19. package/dist/collector.js.map +1 -1
  20. package/dist/config.d.ts +4 -3
  21. package/dist/config.js +5 -5
  22. package/dist/config.js.map +1 -1
  23. package/dist/contract-operations.d.ts +1 -1
  24. package/dist/contract-operations.js +1 -1
  25. package/dist/contract-operations.js.map +1 -1
  26. package/dist/contract-validation.d.ts +1 -1
  27. package/dist/contract-validation.js +45 -1
  28. package/dist/contract-validation.js.map +1 -1
  29. package/dist/events-authorization.d.ts +9 -0
  30. package/dist/events-authorization.js +160 -0
  31. package/dist/events-authorization.js.map +1 -0
  32. package/dist/events.d.ts +235 -0
  33. package/dist/events.js +647 -0
  34. package/dist/events.js.map +1 -0
  35. package/dist/main.d.ts +14 -23
  36. package/dist/main.js +99 -36
  37. package/dist/main.js.map +1 -1
  38. package/dist/mcp-app.html +1 -1
  39. package/dist/mcp-dashboard.html +1 -1
  40. package/dist/mcp-home.html +6 -6
  41. package/dist/metrics-tools.js +16 -13
  42. package/dist/metrics-tools.js.map +1 -1
  43. package/dist/native-execution.d.ts +8 -52
  44. package/dist/native-execution.js +51 -222
  45. package/dist/native-execution.js.map +1 -1
  46. package/dist/oauth-metadata.d.ts +8 -0
  47. package/dist/oauth-metadata.js +89 -0
  48. package/dist/oauth-metadata.js.map +1 -0
  49. package/dist/oauth.d.ts +7 -17
  50. package/dist/oauth.js +16 -68
  51. package/dist/oauth.js.map +1 -1
  52. package/dist/request-scope.d.ts +4 -12
  53. package/dist/request-scope.js +9 -22
  54. package/dist/request-scope.js.map +1 -1
  55. package/dist/server.d.ts +7 -1
  56. package/dist/server.js +83 -33
  57. package/dist/server.js.map +1 -1
  58. package/dist/summaries.d.ts +1 -1
  59. package/dist/summaries.js +2 -2
  60. package/dist/summaries.js.map +1 -1
  61. package/dist/telemetry-redaction.js +13 -0
  62. package/dist/telemetry-redaction.js.map +1 -1
  63. package/dist/tools.d.ts +10 -0
  64. package/dist/tools.js +77 -18
  65. package/dist/tools.js.map +1 -1
  66. package/dist/trace-query.d.ts +5 -0
  67. package/dist/trace-query.js +8 -0
  68. package/dist/trace-query.js.map +1 -0
  69. package/dist/ui-domain.d.ts +4 -0
  70. package/dist/ui-domain.js +28 -0
  71. package/dist/ui-domain.js.map +1 -0
  72. package/dist/webhook.d.ts +45 -0
  73. package/dist/webhook.js +198 -0
  74. package/dist/webhook.js.map +1 -0
  75. package/package.json +27 -22
@@ -6,7 +6,7 @@
6
6
  <meta name="color-scheme" content="dark">
7
7
  <meta name="description" content="Bring qyl traces, logs, and MCP telemetry into your coding agent.">
8
8
  <title>qyl · MCP telemetry for coding agents</title>
9
- <script type="module" crossorigin>(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=`7.1.0`,t=`https://mcp.qyl.at/mcp`,n={codex:{title:`terminal`,value:`codex mcp add qyl --url ${t}`},claude:{title:`terminal`,value:`claude mcp add --transport http qyl ${t}`},cursor:{title:`mcp.json`,value:`{
9
+ <script type="module" crossorigin>(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=`7.2.0`,t=`https://mcp.qyl.at/mcp`,n={codex:{title:`terminal`,value:`codex mcp add qyl --url ${t}`},claude:{title:`terminal`,value:`claude mcp add --transport http qyl ${t}`},cursor:{title:`mcp.json`,value:`{
10
10
  "mcpServers": {
11
11
  "qyl": {
12
12
  "url": "${t}"
@@ -117,23 +117,23 @@
117
117
  <p class="section-index">02 / REQUEST SCOPE</p>
118
118
  <div class="protocol-heading">
119
119
  <h2 id="scope-title">Every call runs inside its request.</h2>
120
- <p>One frame around all eleven tools. A tool registered outside it fails the build, so none of the three can go missing.</p>
120
+ <p>One frame around all eleven tools. A tool registered outside it fails the build, so cancellation and requested progress stay in the common frame.</p>
121
121
  </div>
122
122
  <div class="protocol-grid scope-grid">
123
123
  <article><span>Cancel</span><h3>Stop means stop</h3><p>A <code>notifications/cancelled</code>, or a dropped connection, aborts the in-flight collector fetch at once instead of waiting out its timeout.</p></article>
124
124
  <article><span>Progress</span><h3>Only when you ask</h3><p>A request that carries a <code>progressToken</code> gets one <code>notifications/progress</code> per collector round trip and a final <em>Result ready</em>. No token, no noise.</p></article>
125
- <article><span>Log</span><h3>One line per call</h3><p>A request that names a log level in its <code>_meta</code> envelope receives one <code>notifications/message</code>: <em>info</em> on success, <em>warning</em> on failure, logger <code>qyl.mcp</code>.</p></article>
125
+ <article><span>Observe</span><h3>Operation telemetry</h3><p>Native tool telemetry records timing, status and error type through OpenTelemetry. The server sends no deprecated protocol log messages.</p></article>
126
126
  </div>
127
127
  </section>
128
128
 
129
129
  <section class="protocol-section" aria-labelledby="protocol-title">
130
130
  <p class="section-index">03 / PROTOCOL</p>
131
131
  <div class="protocol-heading">
132
- <h2 id="protocol-title">Built for the 2026 MCP.</h2>
133
- <p>No session, no 2025 handshake, no SSE compatibility layer &mdash; a 2025-era request is refused with <code>-32022</code>.</p>
132
+ <h2 id="protocol-title">Connect your MCP client.</h2>
133
+ <p>Tools support MCP <code>2026-07-28</code> and 2025-era clients. Events use <code>2026-07-28</code>.</p>
134
134
  </div>
135
135
  <div class="protocol-grid">
136
- <article><span>01</span><h3>Per-request identity</h3><p>Every request carries its protocol, client identity, and capabilities.</p></article>
136
+ <article><span>01</span><h3>Per-request identity</h3><p>Modern requests declare their protocol and capabilities; authorization is checked on every HTTP request.</p></article>
137
137
  <article><span>02</span><h3>OAuth resource server</h3><p>Your client discovers authorization and opens the browser flow automatically.</p></article>
138
138
  <article><span>03</span><h3>Trace context intact</h3><p>W3C trace context follows calls from the agent through MCP into downstream work.</p></article>
139
139
  <article><span>04</span><h3>Server-rendered views</h3><p>Trace and traffic interfaces travel as MCP Apps, beside the evidence they explain.</p></article>
@@ -20,7 +20,7 @@ import { listMetricSeries, listMetrics, queryMetric, } from "./metrics.js";
20
20
  import { summarizeMetricCatalog, summarizeMetricQuery, summarizeMetricSeries, } from "./summaries.js";
21
21
  import { runTool } from "./request-scope.js";
22
22
  import { telemetryToolResult } from "./telemetry-redaction.js";
23
- import { READ_ONLY_TELEMETRY_TOOL_ANNOTATIONS } from "./tools.js";
23
+ import { READ_ONLY_TELEMETRY_TOOL_ANNOTATIONS, TELEMETRY_TOOL_AUTH_META } from "./tools.js";
24
24
  const METRICS_PATH = "/api/v1/metrics";
25
25
  const SERIES_PATH = "/api/v1/metrics/{metric_name}/series";
26
26
  const QUERY_PATH = "/api/v1/metrics/{metric_name}/query";
@@ -34,12 +34,13 @@ export function registerMetricsTools(server) {
34
34
  title: "List Metrics",
35
35
  description: "List the metric instruments recorded for this project: name, kind " +
36
36
  "(gauge/sum/histogram), unit, how many attribute streams exist under each " +
37
- "name, and when it was last written. Start here — query_metric needs an " +
38
- "exact instrument name, and this is where the names come from.",
37
+ "name, and when it was last written. Useful when the user wants to discover " +
38
+ "instrument names before querying a metric by its exact name.",
39
39
  inputSchema: operationInputSchema(METRICS_PATH),
40
40
  outputSchema: compactOutputSchema(MetricsListResponseSchema),
41
41
  annotations: READ_ONLY_TELEMETRY_TOOL_ANNOTATIONS,
42
- }, (args, ctx) => runTool(ctx, "list_metrics", 1, async (scope) => {
42
+ _meta: TELEMETRY_TOOL_AUTH_META,
43
+ }, (args, ctx) => runTool(ctx, 1, async (scope) => {
43
44
  const { metrics, mode } = await listMetrics(args, scope.collector);
44
45
  await scope.step(`Fetched ${metrics.length} metric instrument(s)`);
45
46
  return telemetryToolResult(summarizeMetricCatalog(metrics, mode), {
@@ -50,14 +51,14 @@ export function registerMetricsTools(server) {
50
51
  server.registerTool("get_metric_series", {
51
52
  title: "Get Metric Series",
52
53
  description: "List the distinct attribute streams recorded under one metric name, with " +
53
- "each stream's attributes, service, and first/last seen. Use it to discover " +
54
- "which attribute keys are worth passing to query_metric as group_by or attr " +
55
- "filters, before running a range query that would otherwise collapse or " +
56
- "explode the result.",
54
+ "each stream's attributes, service, and first/last seen. Useful when the user " +
55
+ "wants to discover group_by keys or attr filters for query_metric before " +
56
+ "choosing the groups in a range query.",
57
57
  inputSchema: operationInputSchema(SERIES_PATH),
58
58
  outputSchema: compactOutputSchema(MetricSeriesListResponseSchema),
59
59
  annotations: READ_ONLY_TELEMETRY_TOOL_ANNOTATIONS,
60
- }, (args, ctx) => runTool(ctx, "get_metric_series", 1, async (scope) => {
60
+ _meta: TELEMETRY_TOOL_AUTH_META,
61
+ }, (args, ctx) => runTool(ctx, 1, async (scope) => {
61
62
  const { series, mode } = await listMetricSeries(args, scope.collector);
62
63
  await scope.step(`Fetched ${series.length} series of ${args.metric_name}`);
63
64
  return telemetryToolResult(summarizeMetricSeries(series, mode), {
@@ -67,16 +68,18 @@ export function registerMetricsTools(server) {
67
68
  }));
68
69
  server.registerTool("query_metric", {
69
70
  title: "Query Metric",
70
- description: "Run a time-bucketed range query over one metric: a window (start_time, " +
71
+ description: "Run a time-bucketed range query when the user wants to compare a metric " +
72
+ "over time or across groups: a window (start_time, " +
71
73
  "end_time), a bucket width (step_ms), a reducer (aggregation: avg, min, max, " +
72
74
  "sum, count, last, p50, p90, p95, p99), optional group_by attribute keys, and " +
73
75
  "optional attr/attr_prefix matchers written 'key=value'. Returns one stream " +
74
- "per grouping with its buckets. One bucket spanning the whole window collapses " +
75
- "the answer to a single number.",
76
+ "per grouping with its buckets. With step_ms equal to the window duration, " +
77
+ "each grouping yields one bucket: one number per series.",
76
78
  inputSchema: operationInputSchema(QUERY_PATH),
77
79
  outputSchema: compactOutputSchema(MetricQueryResultSchema),
78
80
  annotations: READ_ONLY_TELEMETRY_TOOL_ANNOTATIONS,
79
- }, (args, ctx) => runTool(ctx, "query_metric", 1, async (scope) => {
81
+ _meta: TELEMETRY_TOOL_AUTH_META,
82
+ }, (args, ctx) => runTool(ctx, 1, async (scope) => {
80
83
  const { result, mode } = await queryMetric(args, scope.collector);
81
84
  await scope.step(`Queried ${args.metric_name}: ${result.series.length} series, ` +
82
85
  `${result.series[0]?.buckets.length ?? 0} bucket(s) each`);
@@ -1 +1 @@
1
- {"version":3,"file":"metrics-tools.js","sourceRo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BAAiB,CAC5D,CAAC;QACF,OAAO,mBAAmB,CAAC,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IACzE,CAAC,CAAC,CACL,CAAC;AACJ,CAAC"}
@@ -1,12 +1,11 @@
1
- import type { WorkbenchExecutionCost, WorkbenchExecutionTokenUsage } from "@ancplua/qyl-api-schema/types";
2
1
  import type { McpServer, CallToolRequest, CallToolResult, ServerContext } from "@modelcontextprotocol/server";
3
- import { z } from "zod";
2
+ import * as z from "zod/v4";
4
3
  import type { McpTelemetryTransport } from "./mcp-semconv.js";
5
4
  import { SecretRedactor } from "./secret-redactor.js";
6
5
  import { McpTelemetry } from "./telemetry.js";
7
6
  declare const NativeExecutionRecordSchema: z.ZodObject<{
8
7
  id: z.ZodString;
9
- serverId: z.ZodLiteral<"qyl.mcp/native">;
8
+ toolName: z.ZodString;
10
9
  status: z.ZodEnum<{
11
10
  failed: "failed";
12
11
  running: "running";
@@ -16,51 +15,7 @@ declare const NativeExecutionRecordSchema: z.ZodObject<{
16
15
  startedAt: z.ZodISODateTime;
17
16
  completedAt: z.ZodOptional<z.ZodISODateTime>;
18
17
  durationMs: z.ZodOptional<z.ZodNumber>;
19
- attemptCount: z.ZodLiteral<1>;
20
- request: z.ZodObject<{
21
- requestId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
22
- toolName: z.ZodString;
23
- arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
24
- transport: z.ZodEnum<{
25
- builtin: "builtin";
26
- http: "http";
27
- inproc: "inproc";
28
- sse: "sse";
29
- stdio: "stdio";
30
- "streamable-http": "streamable-http";
31
- streamable_http: "streamable_http";
32
- }>;
33
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
34
- }, z.core.$strict>;
35
- result: z.ZodOptional<z.ZodUnknown>;
36
- error: z.ZodOptional<z.ZodObject<{
37
- code: z.ZodString;
38
- message: z.ZodString;
39
- }, z.core.$strict>>;
40
- tokenUsage: z.ZodOptional<z.ZodType<WorkbenchExecutionTokenUsage, unknown, z.core.$ZodTypeInternals<WorkbenchExecutionTokenUsage, unknown>>>;
41
- cost: z.ZodOptional<z.ZodType<WorkbenchExecutionCost, unknown, z.core.$ZodTypeInternals<WorkbenchExecutionCost, unknown>>>;
42
- protocolEvents: z.ZodArray<z.ZodObject<{
43
- sequence: z.ZodNumber;
44
- timestamp: z.ZodISODateTime;
45
- direction: z.ZodEnum<{
46
- inbound: "inbound";
47
- outbound: "outbound";
48
- }>;
49
- messageKind: z.ZodEnum<{
50
- error: "error";
51
- request: "request";
52
- result: "result";
53
- }>;
54
- jsonrpc: z.ZodLiteral<"2.0">;
55
- requestId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
56
- method: z.ZodLiteral<"tools/call">;
57
- payload: z.ZodUnknown;
58
- }, z.core.$strict>>;
59
- telemetryCorrelation: z.ZodObject<{
60
- executionId: z.ZodString;
61
- traceIds: z.ZodArray<z.ZodString>;
62
- spanIds: z.ZodArray<z.ZodString>;
63
- }, z.core.$strict>;
18
+ errorType: z.ZodOptional<z.ZodString>;
64
19
  }, z.core.$strict>;
65
20
  export type NativeExecutionRecord = z.infer<typeof NativeExecutionRecordSchema>;
66
21
  export interface NativeExecutionRepository {
@@ -73,7 +28,7 @@ export interface FileNativeExecutionRepositoryOptions {
73
28
  redactor?: SecretRedactor;
74
29
  environment?: Readonly<Record<string, string | undefined>>;
75
30
  }
76
- /** Durable, redacted native-server evidence kept separately from workbench state. */
31
+ /** Bounded operation metadata kept separately from Workbench execution state. */
77
32
  export declare class FileNativeExecutionRepository implements NativeExecutionRepository {
78
33
  private store;
79
34
  private readonly openStore;
@@ -81,17 +36,18 @@ export declare class FileNativeExecutionRepository implements NativeExecutionRep
81
36
  private readonly maxExecutions;
82
37
  private readonly now;
83
38
  private initialization;
39
+ private needsMigration;
84
40
  constructor(options?: FileNativeExecutionRepositoryOptions);
85
41
  /**
86
42
  * Move a state file this build cannot read out of the way, and say so.
87
43
  *
88
- * The schema deliberately refuses to half-parse an older layout, but refusing
44
+ * The schema deliberately refuses to guess an unknown layout, but refusing
89
45
  * forever is not the same as refusing to guess: a state file written before a
90
46
  * version bump would otherwise fail every single tool call for the life of the
91
47
  * installation, because the store caches its failed load and evidence is
92
48
  * written before the tool runs. Renaming preserves the old records for anyone
93
- * who wants them and lets this process start a fresh log. Nothing is deleted
94
- * and nothing is migrated.
49
+ * who wants them and lets this process start a fresh log. Known version-1/2
50
+ * files follow the payload-removing migration instead of this recovery path.
95
51
  */
96
52
  private archiveUnreadableState;
97
53
  save(record: NativeExecutionRecord): Promise<void>;