@microlink/mcp 2.1.12 → 2.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.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@microlink/mcp",
3
3
  "description": "MCP server for Microlink API",
4
4
  "homepage": "https://github.com/microlinkhq/microlink",
5
- "version": "2.1.12",
5
+ "version": "2.2.0",
6
6
  "main": "./src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js"
@@ -66,5 +66,5 @@
66
66
  "access": "public"
67
67
  },
68
68
  "type": "module",
69
- "gitHead": "ad16e1cbd956569c8b7c47e50c9d2a4b828f4526"
69
+ "gitHead": "6a9b3891741143671b096d53c0d9e69f6b62cb94"
70
70
  }
@@ -1,5 +1,5 @@
1
1
  import { functionInputSchema } from '../schemas.js'
2
- import { register } from './register.js'
2
+ import { INTERACTIVE_ANNOTATIONS, register } from './register.js'
3
3
 
4
4
  export function fn (server) {
5
5
  register(
@@ -12,6 +12,7 @@ export function fn (server) {
12
12
  'Also returns `isFulfilled`, `profiling`, and `logging`. Mirrors the `microlink.function(url, code)` library method.'
13
13
  ].join(' '),
14
14
  functionInputSchema,
15
- (client, { url, code, ...options }) => client.function(url, code, options)
15
+ (client, { url, code, ...options }) => client.function(url, code, options),
16
+ INTERACTIVE_ANNOTATIONS
16
17
  )
17
18
  }
@@ -39,6 +39,20 @@ function getApiKeyFromRequestHeaders (headers) {
39
39
  return undefined
40
40
  }
41
41
 
42
+ // Every tool is a remote read against the Microlink API: it never modifies
43
+ // the caller's environment. `microlink_function` is the exception: it runs
44
+ // caller-supplied code against the live page, so it is not declared read-only.
45
+ const READ_ONLY_ANNOTATIONS = {
46
+ readOnlyHint: true,
47
+ destructiveHint: false,
48
+ openWorldHint: true
49
+ }
50
+
51
+ export const INTERACTIVE_ANNOTATIONS = {
52
+ readOnlyHint: false,
53
+ openWorldHint: true
54
+ }
55
+
42
56
  // Common shape: a tool that maps to `client.<method>(url, options)`.
43
57
  export function urlMethod (method) {
44
58
  return (client, { url, ...options }) => client[method](url, options)
@@ -57,10 +71,17 @@ export function capabilityMethod (method, key) {
57
71
  }
58
72
  }
59
73
 
60
- export function register (server, name, description, inputSchema, invoke) {
74
+ export function register (
75
+ server,
76
+ name,
77
+ description,
78
+ inputSchema,
79
+ invoke,
80
+ annotations = READ_ONLY_ANNOTATIONS
81
+ ) {
61
82
  server.registerTool(
62
83
  name,
63
- { description, inputSchema },
84
+ { description, inputSchema, annotations },
64
85
  async (args, extra) => {
65
86
  const parsed = inputSchema.safeParse(args)
66
87