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

String

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

Object

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",
"status": "active",
"connection_status": "connected",
"client_secret": {
"object": "client_secret",
"type": "session"
},
"server_deployments": [
{
"object": "session.server_deployment#preview",
"metadata": {},
"server": {
"object": "server#preview",
"type": "public"
},
"connection_urls": {}
},
{
"object": "session.server_deployment#preview",
"metadata": {},
"server": {
"object": "server#preview",
"type": "public"
},
"connection_urls": {}
}
],
"usage": {},
"metadata": {}
}

List sessions

List all sessions

Query Parameters

limit

NumberOptional

after

StringOptional

before

StringOptional

cursor

StringOptional

order

EnumOptional

status

UnionOptional

server_id

UnionOptional

server_variant_id

UnionOptional

server_implementation_id

UnionOptional

server_deployment_id

UnionOptional
GEThttp://api.metorial.com/sessions
curl -X GET "https://api.metorial.com/sessions" \
-H "Authorization: Bearer metorial_sk_..."

Get session

Get the information of a specific session

URL Parameters

session_id

String

The unique identifier for the session

GEThttp://api.metorial.com/sessions/:session_id
curl -X GET "https://api.metorial.com/sessions/ses_Rm4Mnheq2bfEPhBhP7SY" \
-H "Authorization: Bearer metorial_sk_..."

Create session

Create a new session

Request Body

server_deployments

Array of Union
POSThttp://api.metorial.com/sessions
curl -X POST "https://api.metorial.com/sessions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..." \
-d '{
"server_deployments": [
{
"oauth_session_id": "example_oauth_session_id"
}
]
}'

Delete session

Delete a session

URL Parameters

session_id

String

The unique identifier for the session

DELETEhttp://api.metorial.com/sessions/:session_id
curl -X DELETE "https://api.metorial.com/sessions/ses_Rm4Mnheq2bfEPhBhP7SY" \
-H "Authorization: Bearer metorial_sk_..."