Session

Before you can connect to an MCP server, you need to create a session. Each session can be linked to one or more server deployments, allowing you to connect to multiple servers simultaneously. Once you have created a session, you can use the provided MCP URL to connect to the server deployments via MCP.

Session object

Attributes

object

Object

id

String

The unique identifier of the session

status

Enum

The current status of the session

connection_status

Enum

The connection state of the session

client_secret

Object

Client secret object associated with this session

server_deployments

Array of Objects

List of server deployments related to this session

usage

Object

Usage statistics for the session

metadata

Object

Additional metadata associated with the session

created_at

Date

Timestamp when the session was created

updated_at

Date

Timestamp when the session was last updated

{
"object": "session",
"id": "example_id",
"status": "active",
"connection_status": "connected",
"client_secret": {
"object": "client_secret",
"type": "session",
"id": "example_id",
"secret": "example_secret",
"expires_at": "2025-08-12T09:45:15.873Z"
},
"server_deployments": [
{
"object": "session.server_deployment#preview",
"id": "example_id",
"name": "example_name",
"description": "example_description",
"metadata": {},
"created_at": "2025-08-12T09:45:15.873Z",
"updated_at": "2025-08-12T09:45:15.873Z",
"server": {
"object": "server#preview",
"id": "example_id",
"name": "example_name",
"description": "example_description",
"type": "public",
"created_at": "2025-08-12T09:45:15.873Z",
"updated_at": "2025-08-12T09:45:15.873Z"
},
"connection_urls": {
"sse": "example_sse",
"streamable_http": "example_streamable_http",
"websocket": "example_websocket"
}
},
{
"object": "session.server_deployment#preview",
"metadata": {},
"server": {
"object": "server#preview",
"type": "public"
},
"connection_urls": {}
}
],
"usage": {
"total_productive_message_count": 0,
"total_productive_client_message_count": 0,
"total_productive_server_message_count": 0
},
"metadata": {},
"created_at": "2025-08-12T09:45:15.873Z",
"updated_at": "2025-08-12T09:45:15.873Z"
}

List sessions

List all sessions

GEThttp://api.metorial.com/sessions
curl -X GET "https://api.metorial.com/sessions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..."

Get session

Get the information of a specific session

URL Parameters

sessionId

String

The unique identifier for the session

GEThttp://api.metorial.com/sessions/:sessionId
curl -X GET "https://api.metorial.com/sessions/ses_Rm4Mnheq2bfEPhBhP7SY" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..."

Create session

Create a new session

POSThttp://api.metorial.com/sessions
curl -X POST "https://api.metorial.com/sessions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..."

Delete session

Delete a session

URL Parameters

sessionId

String

The unique identifier for the session

DELETEhttp://api.metorial.com/sessions/:sessionId
curl -X DELETE "https://api.metorial.com/sessions/ses_Rm4Mnheq2bfEPhBhP7SY" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..."