Skip to main content
Glama

mcp_connect

Connect to an MCP server via registry slug, explicit command, or remote URL and expose its tools for use.

Instructions

Connect to an MCP server and make its tools available. Provide either a server slug (from mcp_discover) to look up in the registry, OR an explicit command + args to spawn directly, OR a url for remote servers. An explicit command needs the person's approval, which the gateway asks for itself.

Input Schema

NameRequiredDescriptionDefault
envNoAdditional environment variables for the server process
urlNoURL for remote transports (SSE, WebSocket, Streamable HTTP). Use instead of command for remote servers.
argsNoCommand arguments (e.g., ['-y', '@modelcontextprotocol/server-everything'])
slugNoServer slug from MCP-Rating registry (e.g., '@modelcontextprotocol/inspector')
commandNoExplicit command to spawn (e.g., 'npx'). Use when server is not in registry. The gateway asks the person first, and refuses if the client can't ask.
confirmedNoSet to true to confirm connection to community/unknown trust tier servers, once the user has said yes. Required when the initial connect returns a confirmation warning. Where the client can ask the person directly, the gateway does that instead and this has no effect.
saveProfileNoSet to true to save this connection as an auto-connect profile. The server will auto-reconnect on gateway restart.
transportTypeNoTransport type. Defaults to 'stdio' for command-based, auto-detected from URL scheme if url is provided.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.5.0
    • changedInput schema / properties / command / description
      Previous value: -"Explicit command to spawn (e.g., 'npx'). Use when server is not in registry."New value: +"Explicit command to spawn (e.g., 'npx'). Use when server is not in registry. The gateway asks the person first, and refuses if the client can't ask."
    • changedInput schema / properties / confirmed / description
      Previous value: -"Set to true to confirm connection to community/unknown trust tier servers. Required when the initial connect returns a confirmation warning."New value: +"Set to true to confirm connection to community/unknown trust tier servers, once the user has said yes. Required when the initial connect returns a confirmation warning. Where the client can ask the person directly, the gateway does that instead and this has no effect."
  2. First observedv0.2.3

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and does disclose the key non-obvious trait: explicit commands require human approval and the gateway refuses when the client cannot ask. It does not cover persistence across restarts, duplicate/already-connected behavior, or authentication expectations for remote URLs, which are real gaps for a stateful connection tool.

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

Conciseness5/5

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

Three sentences, front-loaded with the outcome and then the three input modes. Every sentence carries distinct information and nothing is padded or repeated.

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?

For an 8-parameter, state-changing tool with no annotations and no output schema, the definition covers the modes and the approval gate adequately. It leaves the caller unsure what a successful connect returns (connection handle, tool list?) and how failures surface, which an agent would want to know before wiring follow-up calls.

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

Parameters3/5

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

Schema description coverage is 100%, so each parameter is already documented individually, setting the baseline at 3. The description adds the one thing the schema cannot express: that slug, command, and url are alternative modes rather than a flat bag of options, which is a modest but real increment.

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 opens with a specific verb and resource plus the resulting side effect: 'Connect to an MCP server and make its tools available.' It also distinguishes itself from the sibling mcp_discover by naming it as the source of a slug, so an agent can separate discovery from connection without reading either schema.

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

Usage Guidelines4/5

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

It clearly lays out three mutually exclusive invocation paths (registry slug, explicit command + args, or url for remote servers) and points to mcp_discover for slug lookup, which is exactly the routing an agent needs. It stops short of stating when not to use this tool, such as already-connected servers (mcp_list_active) or teardown via mcp_disconnect.

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