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
items
Object{"items": {"0": {"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": {}},"object": "example_object","id": "example_id","status": "","connection_status": "","client_secret": {"object": "example_object","type": "","id": "example_id","secret": "example_secret","expires_at": "2025-10-15T16:41:26.887Z"},"server_deployments": {"object": "example_object","id": "example_id","name": "example_name","oauth_session_id": "example_oauth_session_id","description": "example_description","metadata": "example_metadata","created_at": "2025-10-15T16:41:26.887Z","updated_at": "2025-10-15T16:41:26.887Z","server": {"object": "example_object","id": "example_id","name": "example_name","description": "example_description","type": "","created_at": "2025-10-15T16:41:26.887Z","updated_at": "2025-10-15T16:41:26.887Z"},"connection_urls": {"sse": "example_sse","streamable_http": "example_streamable_http"}},"usage": {"total_productive_message_count": 0,"total_productive_client_message_count": 0,"total_productive_server_message_count": 0},"metadata": "example_metadata","created_at": "2025-10-15T16:41:26.887Z","updated_at": "2025-10-15T16:41:26.887Z"},"pagination": {"has_more_before": false,"has_more_after": false}}
List sessions
List all sessions
Query Parameters
limit
NumberOptionalafter
StringOptionalbefore
StringOptionalcursor
StringOptionalorder
EnumOptionalstatus
UnionOptionalserver_id
UnionOptionalserver_variant_id
UnionOptionalserver_implementation_id
UnionOptionalserver_deployment_id
UnionOptionalGEThttp://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
StringThe 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 UnionPOSThttp://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": [{"name": "example_name","description": "example_description","metadata": "example_metadata","config": "example_config","oauth_config": {"client_id": "example_client_id","client_secret": "example_client_secret"},"oauth_session_id": "example_oauth_session_id"}]}'
Delete session
Delete a session
URL Parameters
session_id
StringThe 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_..."