Skip to main content
Glama
meshive-mcp

meshive-mcp

Official
by meshive

Allow Preflight Requests on Port

set_port_preflight
Idempotent

Allow or block CORS preflight OPTIONS requests on a locked port so cross-origin browser pages can reach the app while all other requests still need a key.

Instructions

Let CORS preflight requests (OPTIONS) to a locked port reach the app without a key (allow=true), or refuse them like any other request without a key (allow=false, the default for every port). The pod isn't restarted, and the change takes a few seconds to apply. An endpoint's allow_preflight in the pods tool shows the setting. Use it when a web page on another site calls a locked port from a browser: the browser first sends a preflight request that carries no key, and the lock refuses it (a CORS error in the page). Every other request still needs a key, and the app's own CORS settings decide which sites may call it. allow=true opens a way past the lock, so do it only when the user asks. With confirm=false (default) it only returns a summary and changes nothing; call again with confirm=true and the summary's pod_name after the user agreed. Tell the user that a key put in a web page is visible to everyone who opens that page: that page should get its own key, rolled if it leaks. allow=false applies at once, without confirm. The setting is kept when the port is unlocked and locked again; it does nothing while the port is unlocked. Only a workspace admin or billing member can change it. An internal port has no such setting (port_not_public). Every write requires operation_id. Reuse the ID returned by the preview, or generate a UUID before the first call. Keep it for confirmation and all retries; a new ID means a new operation. After a timeout, check operation_status and resource state before retrying.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pod": "<pod>",
      "port": "<port>",
      "allow": "<allow>"
    },
    "name": "set_port_preflight"
  }
}

Input Schema

NameRequiredDescriptionDefault
podYesThe pod_name from the pods tool. Its display name also works, except on a confirmed call (confirm=true) that opens a port, changes a key or signs out browsers: use the `pod_name` the preview returned.
portYesThe port number, from the pod's `endpoints` in the pods tool; it must be exposed over HTTPS (`access` locked or unlocked).
allowYes
confirmNo
workspaceNo
operation_idNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.10.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, it discloses that the pod is not restarted, changes take a few seconds, confirm=false previews without changing anything, allow=false applies immediately, and the setting persists across lock/unlock cycles. It also covers permissions, internal-port behavior, security implications, and operation_id lifecycle, consistent with the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core behavior and use case, followed by warnings and operation_id guidance. It is appropriately detailed for a security-sensitive mutation tool, though somewhat dense and could be tightened around confirmation and operation_id instructions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema, return values need not be explained, and the description is otherwise complete for a complex mutating tool: it covers confirmation, permissions, persistence, internal-port errors, and retry guidance. The main remaining gap is that the optional workspace parameter is not described.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With only 33% schema description coverage, the description adds substantial meaning for allow, confirm, and operation_id, including preview semantics, confirmation requirements, and retry behavior. It also constrains pod and port through pod_name and HTTPS endpoint requirements, though the workspace parameter is not explained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action: controlling whether CORS preflight OPTIONS requests to a locked port can bypass the key requirement. It clearly distinguishes allow=true from allow=false and separates preflight handling from all other keyed requests.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit use case: a browser on another site calls a locked port and its preflight request is refused. It also states when not to enable it, the default behavior, and the required preview/confirm flow when opening the bypass.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.