创建 MCP 会话
POST
/mcp/sessions
const url = 'https://api.intematrix.tech/mcp/sessions';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"client_name":"intematrix-cli","client_version":"1.0.0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.intematrix.tech/mcp/sessions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "client_name": "intematrix-cli", "client_version": "1.0.0" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
client_name
required
string
client_version
string
Responses
Section titled “Responses”会话已创建
Media typeapplication/json
object
session_id
string
client_name
string
expires_at
string format: date-time
Example generated
{ "session_id": "example", "client_name": "example", "expires_at": "2026-04-15T12:00:00Z"}未鉴权或密钥无效
Media typeapplication/json
object
error
object
code
string
message
string
Example
{ "error": { "code": "unauthorized" }}