b2match-mcp 0.1.1 → 0.1.2
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/dist/cli.js +5 -1
- package/dist/client.js +2 -1
- package/dist/packageVersion.d.ts +4 -0
- package/dist/packageVersion.js +12 -0
- package/dist/server.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -249,7 +249,7 @@ The smoke test is skipped unless both environment variables are set.
|
|
|
249
249
|
|
|
250
250
|
## Publishing
|
|
251
251
|
|
|
252
|
-
Releases are cut by Release Please from Conventional Commits on `main`. The same workflow (`.github/workflows/release-please.yml`) publishes with `npm publish --provenance --access public` when a release is created. Provenance requires a public repo. Configure npm trusted publishing against `release-please.yml`. `
|
|
252
|
+
Releases are cut by Release Please from Conventional Commits on `main`. The same workflow (`.github/workflows/release-please.yml`) publishes with `npm publish --provenance --access public` when a release is created (OIDC trusted publishing only — no `NODE_AUTH_TOKEN`). Provenance requires a public repo. Configure npm trusted publishing against workflow `release-please.yml`. To republish an existing tag: `gh workflow run release-please.yml -f publish_tag=vX.Y.Z`. `.github/workflows/publish.yml` is a tip-of-branch manual republish only.
|
|
253
253
|
|
|
254
254
|
## Verification status
|
|
255
255
|
|
package/dist/cli.js
CHANGED
|
@@ -4,6 +4,7 @@ import { createInterface } from "node:readline/promises";
|
|
|
4
4
|
import { stdin as input, stdout as output } from "node:process";
|
|
5
5
|
import { AuthStore } from "./auth.js";
|
|
6
6
|
import { loginFromHiddenPrompt, loginWithDedicatedBrowser, logoutLocal } from "./login.js";
|
|
7
|
+
import { packageVersion } from "./packageVersion.js";
|
|
7
8
|
import { runStdioServer } from "./server.js";
|
|
8
9
|
async function main() {
|
|
9
10
|
const [, , command] = process.argv;
|
|
@@ -12,7 +13,10 @@ async function main() {
|
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
15
|
const program = new Command();
|
|
15
|
-
program
|
|
16
|
+
program
|
|
17
|
+
.name("b2match-mcp")
|
|
18
|
+
.description("Read-only MCP server and login helper for B2match")
|
|
19
|
+
.version(packageVersion());
|
|
16
20
|
program
|
|
17
21
|
.command("login")
|
|
18
22
|
.argument("[event]", "B2match event URL, slug, or numeric id")
|
package/dist/client.js
CHANGED
|
@@ -4,6 +4,7 @@ import { parseEventIdentifier } from "./eventIdentifier.js";
|
|
|
4
4
|
import { loginUsage } from "./invocation.js";
|
|
5
5
|
import { EVENT_BY_EUID, EVENT_ID_LOOKUP } from "./queries.js";
|
|
6
6
|
import { assertNoUnacknowledgedSideEffectReads, assertReadOnlyGraphQL } from "./queryGuard.js";
|
|
7
|
+
import { userAgent } from "./packageVersion.js";
|
|
7
8
|
const API_URL = "https://api.b2match.com/v4/query";
|
|
8
9
|
const CACHE_TTL_MS = 60_000;
|
|
9
10
|
const MIN_REQUEST_INTERVAL_MS = 1_000;
|
|
@@ -101,7 +102,7 @@ export class B2matchClient {
|
|
|
101
102
|
headers: {
|
|
102
103
|
"Content-Type": "application/json",
|
|
103
104
|
Accept: "application/json",
|
|
104
|
-
"User-Agent":
|
|
105
|
+
"User-Agent": userAgent(),
|
|
105
106
|
"X-App": "event-next-client",
|
|
106
107
|
"X-b2match-Language": "en",
|
|
107
108
|
"X-Event-Route-Prefix": "/e",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
/** Installed package version from package.json (works from src/ and dist/). */
|
|
4
|
+
export function packageVersion() {
|
|
5
|
+
return require("../package.json").version;
|
|
6
|
+
}
|
|
7
|
+
export function packageName() {
|
|
8
|
+
return require("../package.json").name;
|
|
9
|
+
}
|
|
10
|
+
export function userAgent() {
|
|
11
|
+
return `${packageName()}/${packageVersion()}`;
|
|
12
|
+
}
|
package/dist/server.js
CHANGED
|
@@ -6,6 +6,7 @@ import { AuthStore } from "./auth.js";
|
|
|
6
6
|
import { B2matchAuthError, B2matchClient } from "./client.js";
|
|
7
7
|
import { SIDE_EFFECT_READS_ENV, conversationMessagesGate, notificationListGate } from "./sideEffects.js";
|
|
8
8
|
import { assertNoUnacknowledgedSideEffectReads, assertReadOnlyGraphQL, UnsafeGraphQLOperationError } from "./queryGuard.js";
|
|
9
|
+
import { packageName, packageVersion } from "./packageVersion.js";
|
|
9
10
|
import { EventInput, PagingInput, authErrorResult, errorResult, notFoundResult, textResult } from "./tooling.js";
|
|
10
11
|
const readOnlyAnnotations = {
|
|
11
12
|
readOnlyHint: true,
|
|
@@ -17,8 +18,8 @@ export function createMcpServer(authStore = new AuthStore()) {
|
|
|
17
18
|
const client = new B2matchClient(authStore);
|
|
18
19
|
const api = new B2matchApi(client);
|
|
19
20
|
const server = new McpServer({
|
|
20
|
-
name:
|
|
21
|
-
version:
|
|
21
|
+
name: packageName(),
|
|
22
|
+
version: packageVersion()
|
|
22
23
|
});
|
|
23
24
|
const authTool = (run) => async (args) => {
|
|
24
25
|
try {
|