@digestseo/mcp-gsc 0.3.1 → 0.4.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.
@@ -0,0 +1,23 @@
1
+ import { DurableObject } from 'cloudflare:workers';
2
+ import {
3
+ ToolRateLimiterCore,
4
+ type ToolRateLimitPolicy,
5
+ type ToolRateLimitResult,
6
+ } from './tool-rate-limit';
7
+
8
+ export class ToolRateLimiter extends DurableObject<Record<string, unknown>> {
9
+ private readonly core: ToolRateLimiterCore;
10
+
11
+ constructor(ctx: DurableObjectState, env: Record<string, unknown>) {
12
+ super(ctx, env);
13
+ this.core = new ToolRateLimiterCore(ctx, env);
14
+ }
15
+
16
+ take(
17
+ userBucket: string,
18
+ policy: ToolRateLimitPolicy,
19
+ units = 1,
20
+ ): Promise<ToolRateLimitResult> {
21
+ return this.core.take(userBucket, policy, units);
22
+ }
23
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * MCP hints for each mutation exposed by this server.
3
+ *
4
+ * Search Console's sites and sitemaps APIs use PUT for additions and DELETE
5
+ * for removals, so repeating the same request has the same intended effect.
6
+ * Indexing publishes a URL_UPDATED notification with POST; each call can
7
+ * consume quota and update Google's notification state, so it is not marked
8
+ * idempotent. Every mutation is marked destructive so MCP clients require
9
+ * explicit confirmation before changing external Google state.
10
+ */
11
+ export const WRITE_TOOL_ANNOTATIONS = {
12
+ 'sites.add': {
13
+ readOnlyHint: false,
14
+ destructiveHint: true,
15
+ idempotentHint: true,
16
+ openWorldHint: true,
17
+ },
18
+ 'sites.delete': {
19
+ readOnlyHint: false,
20
+ destructiveHint: true,
21
+ idempotentHint: true,
22
+ openWorldHint: true,
23
+ },
24
+ 'sitemaps.submit': {
25
+ readOnlyHint: false,
26
+ destructiveHint: true,
27
+ idempotentHint: true,
28
+ openWorldHint: true,
29
+ },
30
+ 'sitemaps.delete': {
31
+ readOnlyHint: false,
32
+ destructiveHint: true,
33
+ idempotentHint: true,
34
+ openWorldHint: true,
35
+ },
36
+ 'indexing.request': {
37
+ // The implementation only publishes URL_UPDATED, never URL_DELETED.
38
+ readOnlyHint: false,
39
+ destructiveHint: true,
40
+ idempotentHint: false,
41
+ openWorldHint: true,
42
+ },
43
+ } as const;
@@ -1,35 +1,54 @@
1
- // Cloudflare Worker configuration for mcp-gsc.
2
- //
3
- // Copy this file to `wrangler.jsonc` (gitignored) and fill in your own
4
- // values before deploying. See SETUP.md for the full walkthrough.
5
- {
6
- "name": "mcp-gsc",
7
- "main": "src/index.ts",
8
- "compatibility_date": "2026-05-19",
9
- "compatibility_flags": ["nodejs_compat"],
10
- "observability": { "enabled": true },
11
- "kv_namespaces": [
12
- {
13
- "binding": "OAUTH_KV",
14
- "id": "YOUR_OAUTH_KV_ID"
15
- },
16
- {
17
- "binding": "USER_KV",
18
- "id": "YOUR_USER_KV_ID"
19
- }
20
- ],
21
- "durable_objects": {
22
- "bindings": [
23
- {
24
- "name": "MCP_OBJECT",
25
- "class_name": "GscMcpAgent"
26
- }
27
- ]
28
- },
29
- "migrations": [
30
- {
31
- "tag": "v1",
32
- "new_sqlite_classes": ["GscMcpAgent"]
33
- }
34
- ]
35
- }
1
+ // Cloudflare Worker configuration for mcp-gsc.
2
+ //
3
+ // Copy this file to `wrangler.jsonc` (gitignored) and fill in your own
4
+ // values before deploying. See SETUP.md for the full walkthrough.
5
+ {
6
+ "name": "mcp-gsc",
7
+ "main": "src/entrypoint.ts",
8
+ "compatibility_date": "2026-05-19",
9
+ "compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"],
10
+ "observability": { "enabled": true },
11
+ "vars": {
12
+ "GSC_ACCESS_MODE": "readwrite"
13
+ },
14
+ "kv_namespaces": [
15
+ {
16
+ "binding": "OAUTH_KV",
17
+ "id": "YOUR_OAUTH_KV_ID"
18
+ },
19
+ {
20
+ "binding": "USER_KV",
21
+ "id": "YOUR_USER_KV_ID"
22
+ }
23
+ ],
24
+ "durable_objects": {
25
+ "bindings": [
26
+ {
27
+ "name": "MCP_OBJECT",
28
+ "class_name": "GscMcpAgent"
29
+ },
30
+ {
31
+ "name": "PENDING_AUTH_STATE",
32
+ "class_name": "PendingAuthState"
33
+ },
34
+ {
35
+ "name": "TOOL_RATE_LIMITER",
36
+ "class_name": "ToolRateLimiter"
37
+ }
38
+ ]
39
+ },
40
+ "migrations": [
41
+ {
42
+ "tag": "v1",
43
+ "new_sqlite_classes": ["GscMcpAgent"]
44
+ },
45
+ {
46
+ "tag": "v2",
47
+ "new_sqlite_classes": ["PendingAuthState"]
48
+ },
49
+ {
50
+ "tag": "v3",
51
+ "new_sqlite_classes": ["ToolRateLimiter"]
52
+ }
53
+ ]
54
+ }