mergestorm-mcp 0.2.28 → 0.2.30

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.
@@ -0,0 +1,27 @@
1
+ import { WEB_SEARCH_KINDS, WEB_SEARCH_RECENCIES, readWebPage, searchWeb, type Config } from "mergestorm/client";
2
+ import { z } from "zod";
3
+ import type { ToolPayload } from "./types.js";
4
+ export declare const webSearchSchema: {
5
+ query: z.ZodString;
6
+ kind: z.ZodOptional<z.ZodEnum<["web", "news"]>>;
7
+ recency: z.ZodOptional<z.ZodEnum<["day", "week", "month", "year"]>>;
8
+ page: z.ZodOptional<z.ZodNumber>;
9
+ };
10
+ export declare const readWebPageSchema: {
11
+ url: z.ZodString;
12
+ };
13
+ export type WebApi = {
14
+ searchWeb: typeof searchWeb;
15
+ readWebPage: typeof readWebPage;
16
+ };
17
+ export declare function createWebToolHandlers(cfg: Config | undefined, api?: WebApi): {
18
+ search: (input: {
19
+ query: string;
20
+ kind?: (typeof WEB_SEARCH_KINDS)[number];
21
+ recency?: (typeof WEB_SEARCH_RECENCIES)[number];
22
+ page?: number;
23
+ }) => Promise<ToolPayload>;
24
+ read: (input: {
25
+ url: string;
26
+ }) => Promise<ToolPayload>;
27
+ };
@@ -0,0 +1,36 @@
1
+ import { CommandError, WEB_SEARCH_KINDS, WEB_SEARCH_PAGE_MAX, WEB_SEARCH_RECENCIES, readWebPage, searchWeb } from "mergestorm/client";
2
+ import { z } from "zod";
3
+ export const webSearchSchema = {
4
+ query: z.string().trim().min(1).max(400),
5
+ kind: z.enum(WEB_SEARCH_KINDS).optional(),
6
+ recency: z.enum(WEB_SEARCH_RECENCIES).optional(),
7
+ page: z.number().int().min(1).max(WEB_SEARCH_PAGE_MAX).optional(),
8
+ };
9
+ export const readWebPageSchema = { url: z.string().trim().url().max(2000) };
10
+ const liveApi = { searchWeb, readWebPage };
11
+ async function guarded(run) {
12
+ try {
13
+ return await run();
14
+ }
15
+ catch (err) {
16
+ const message = err instanceof Error ? err.message : String(err);
17
+ const code = err instanceof CommandError ? err.code ?? "web_failed" : "web_failed";
18
+ return {
19
+ summary: message,
20
+ data: { error: { code, message, ...(err instanceof CommandError && err.retryAfterSeconds !== undefined ? { retry_after_seconds: err.retryAfterSeconds } : {}) } },
21
+ isError: true,
22
+ };
23
+ }
24
+ }
25
+ export function createWebToolHandlers(cfg, api = liveApi) {
26
+ return {
27
+ search: (input) => guarded(async () => {
28
+ const found = await api.searchWeb(input, cfg);
29
+ return { summary: found.text, data: { query: input.query } };
30
+ }),
31
+ read: (input) => guarded(async () => {
32
+ const page = await api.readWebPage(input.url, cfg);
33
+ return { summary: page.text, data: { url: input.url } };
34
+ }),
35
+ };
36
+ }
@@ -1,4 +1,4 @@
1
- import { CommandError, apiBase, configPath, getMe, loadConfig, resolveApiKey, } from "mergestorm/client";
1
+ import { CommandError, accountLabel, apiBase, configPath, getMe, loadConfig, resolveApiKey, } from "mergestorm/client";
2
2
  export async function whoami(cfg, serverVersion) {
3
3
  const resolved = cfg ?? (await loadConfig());
4
4
  const key = resolveApiKey(resolved);
@@ -9,7 +9,11 @@ export async function whoami(cfg, serverVersion) {
9
9
  if (!me) {
10
10
  throw new CommandError("Live account details unavailable. Could not verify account with /me.");
11
11
  }
12
+ const account = accountLabel(me.account);
12
13
  const data = {
14
+ account,
15
+ github_login: me.account?.github_login ?? null,
16
+ email: me.account?.email ?? null,
13
17
  key_prefix: me.key.prefix,
14
18
  key_name: me.key.name ?? null,
15
19
  plan_key: me.plan_key ?? null,
@@ -21,7 +25,7 @@ export async function whoami(cfg, serverVersion) {
21
25
  };
22
26
  const plan = data.plan_label_key ?? data.plan_key ?? "unknown plan";
23
27
  return {
24
- summary: `${data.key_prefix} · ${plan}${serverVersion ? ` · mergestorm-mcp ${serverVersion}` : ""}`,
28
+ summary: `${account ? `${account} · ` : ""}${data.key_prefix} · ${plan}${serverVersion ? ` · mergestorm-mcp ${serverVersion}` : ""}`,
25
29
  data,
26
30
  };
27
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mergestorm-mcp",
3
- "version": "0.2.28",
3
+ "version": "0.2.30",
4
4
  "description": "Mergestorm MCP server — identity, review, and read-only stack tools over stdio",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@modelcontextprotocol/sdk": "^1.30.0",
42
- "mergestorm": "0.3.64",
42
+ "mergestorm": "0.3.67",
43
43
  "zod": "^3.24.2"
44
44
  },
45
45
  "devDependencies": {