Skip to content

MCP Package Permissions

Packages bundle permissions that subscriptions attach to customers. The permission model is mixed — a single package can grant access to HTTP endpoints AND MCP tools across multiple upstream servers.

The data model

Package.permissions[] is an array of entries, each with a kind field:

interface PackagePermission {
kind?: 'http' | 'mcp_tool'; // default 'http' for backwards compatibility
// kind='http'
method?: string; // GET, POST, PUT, PATCH, DELETE
path?: string; // e.g. "/api/v1/tickets/{id}"
// kind='mcp_tool'
mcpServerId?: string; // id from /api/mcp-servers
toolName?: string; // unprefixed tool name as declared by the upstream
// shared
summary?: string;
tags?: string[];
}

A package can mix kinds freely:

{
"name": "Monitor Pro",
"permissions": [
{ "kind": "http", "method": "GET", "path": "/api/v1/tickets" },
{ "kind": "http", "method": "POST", "path": "/api/v1/tickets" },
{ "kind": "mcp_tool", "mcpServerId": "…lm…", "toolName": "list_alerts" },
{ "kind": "mcp_tool", "mcpServerId": "…lm…", "toolName": "get_alert" },
{ "kind": "mcp_tool", "mcpServerId": "…cw…", "toolName": "list_companies" }
]
}

Auto-tags

When the portal discovers an upstream’s tools, it derives autoTags[] for each tool from the tool name. The derivation rules (apps/api/src/services/mcp-client.ts):

  1. Split tool name by _ or -
  2. If the first token is a read verb (list, get, read, find, search, query, describe, fetch, show, generate), emit read + strip the verb
  3. If the first token is a write verb (create, update, delete, remove, add, set, patch, ack, acknowledge, start, stop, restart, enable, disable, run, execute), emit write + strip the verb
  4. Collapse trailing s (plural → singular)
  5. The remaining first token is the resource tag

Examples:

Tool name Auto-tags
list_alerts ['alert', 'read']
get_alert_rule ['alert_rule', 'read']
acknowledge_alert ['alert', 'write']
generate_report ['report', 'read']

Admins can override via the inline tag editor on the MCP Servers → Tools tab. Overrides are stored in tool.tags and take precedence over autoTags.

Suggested groups

After discover, the portal groups tools by their resource tag and stores a suggestedGroups[] on the MCP Server record:

interface McpToolGroup {
tag: string; // e.g. 'alert'
toolNames: string[];
suggestedPackageName: string; // "LogicMonitor — Alert"
}

Groups with fewer than 2 tools are skipped (noise). The auto-scaffold dialog on the Packages tab offers one package per group + an “All Tools” package.

Bulk-create endpoint

POST /api/mcp-servers/:id/create-suggested-packages
{
"selections": [{ "tag": "alert" }, { "tag": "dashboard" }],
"includeAll": true
}

Creates one Package per selected group + (optionally) a full “All Tools” package. Each package’s permissions[] contains kind: 'mcp_tool' entries for every tool in the group.

Gateway validation

When a customer calls a tool, the gateway asks the portal /api/gateway/validate whether the customer’s subscription allows it:

POST /api/gateway/validate
{
"apiKey": "ltg_xxx",
"mcpServerId": "…", // optional — enables per-tool check
"toolName": "list_alerts"
}

The validator:

  1. Checks subscription is active and within rate limit + daily quota
  2. If the subscription has packages assigned:
    • If the request has mcpServerId + toolName: builds the allowed tool set from all assigned packages’ kind='mcp_tool' permissions (filtered by mcpServerId), plus any customPermissions on the subscription. Denies if the requested toolName isn’t in the set.
    • Otherwise (HTTP request): builds the allowed METHOD:path set from kind='http' permissions. Denies if no match.
  3. Increments the per-subscription counter and dispatches usage tracking

If no packages are assigned to the subscription, access is unrestricted (matches pre-packages behavior). Once you assign any package, enforcement kicks in.

Denial messages

On denial the validator returns a specific error with hints:

{
"valid": false,
"error": "Tool not permitted — \"list_collectors\" is not included in this subscription's packages",
"mcpServerId": "…",
"toolName": "list_collectors",
"assignedPackages": ["LogicMonitor — Alerts", "LogicMonitor — Dashboards"],
"hint": "Existing packages for this server: LogicMonitor — Alerts, LogicMonitor — Dashboards"
}

The gateway surfaces this to the customer as a human-readable message including a link to /pricing.

The cross-product tool-grid builder

On the Packages page, admins build mixed-kind packages via the MCP Tool Permissions card:

  1. Pick Custom from the Product dropdown (or any product — both work)
  2. Use the MCP Sources dropdown to add one or more MCP servers as sources
  3. Each source renders a tool grid grouped by resource tag, with per-group “All / None” toggles
  4. Select tools across multiple sources; save
  5. The resulting package has kind: 'mcp_tool' permissions spanning the picked servers

Deep-link shortcut: the Build Custom button on an MCP Server’s Packages tab navigates to /packages?mcpServerId=<id> which auto-opens the create modal with that server pre-added as a source.

Per-tool usage tracking

Every per-tool validate call also increments the subscription’s callCount and records /mcp/<serverId>/<toolName> in Request Trace. No extra wiring needed — the Hub and dedicated MCP services both feed into the same counter.

Backwards compatibility

  • Existing PackagePermission entries without a kind field are treated as kind: 'http' — zero disruption to pre-existing packages.
  • Existing customPermissions on subscriptions are similarly kind: 'http' by default.
  • The legacy McpServer.productId field still works as a fallback: if a subscription has no packages granting access to a given MCP server, the validator checks data.productId === w.productId || 'default' — preserving the pre-permissions behavior.