Skip to main content
PUT
/
connect
/
{namespace}
/
{connectionId}
JavaScript
import Smithery from '@smithery/api';

const client = new Smithery({
  apiKey: process.env['SMITHERY_API_KEY'], // This is the default and can be omitted
});

const connection = await client.experimental.connect.connections.set('connectionId', {
  namespace: 'namespace',
  mcpUrl: 'https://mcp.example.com/sse',
});

console.log(connection.connectionId);
{
  "connectionId": "clever-dolphin-a9X3",
  "name": "<string>",
  "mcpUrl": "<string>",
  "metadata": {},
  "iconUrl": "<string>",
  "createdAt": "<string>",
  "status": {
    "state": "<string>"
  },
  "serverInfo": {
    "name": "<string>",
    "version": "<string>",
    "title": "<string>",
    "icons": [
      {
        "src": "<string>",
        "mimeType": "<string>",
        "sizes": [
          "<string>"
        ],
        "theme": "light"
      }
    ],
    "websiteUrl": "<string>",
    "description": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Smithery API key as Bearer token

Path Parameters

namespace
string
required
connectionId
string
required

Body

application/json
mcpUrl
string<uri>
required

URL of the MCP server

Example:

"https://mcp.example.com/sse"

name
string

Human-readable name (optional, defaults to connection ID)

Required string length: 1 - 255
Example:

"My MCP Server"

metadata
object

Custom metadata for filtering connections

Example:
{
"userId": "user123",
"team": "engineering"
}
headers
object

Custom headers to send with MCP requests (stored securely, not returned in responses)

Example:
{ "X-API-Key": "secret-key" }

Response

Connection updated

connectionId
string
required

Connection ID (auto-generated or developer-defined)

Example:

"clever-dolphin-a9X3"

name
string
required

Human-readable name

mcpUrl
string
required

MCP server URL

metadata
object
required
iconUrl
string | null
createdAt
string

ISO 8601 timestamp

status
ConnectionStatusConnected · object

Last known connection status

serverInfo
object

Server information from MCP initialization (name, version)