\x06 for all its communications##START\x06[TaskID][Seq][JSON payload]##ENDmcp00001{
"type": "register",
"data": {
"services": {
"serviceName": {
"description": "What this service does",
"parameters": {
"type": "object",
"properties": {
"paramName": {
"type": "string|number|boolean|array|object",
"description": "Meaning of the parameter",
"enum": ["optional", "value", "list"]
}
},
"required": ["mandatoryParam1", "mandatoryParam2"]
}
}
}
}
}{
"type": "register",
"data": {
"services": {
"get_current_time": {
"description": "Retrieve current date and time",
"parameters": {
"type": "object",
"properties": {
"format": {
"type": "string",
"enum": ["simple", "detailed"],
"description": "simple = short, detailed = full info"
}
}
}
},
"create_file": {
"description": "Create a local file and write content",
"parameters": {
"type": "object",
"properties": {
"filename": {
"type": "string",
"description": "Name of the file to create"
},
"content": {
"type": "string",
"description": "Text to write into the file"
}
},
"required": ["filename", "content"]
}
}
}
}
}{
"type": "call",
"data": {
"call_id": "unique-call-identifier",
"method": "serviceName",
"params": {
"paramName": "paramValue"
}
}
}{
"type": "result",
"data": {
"call_id": "same-call-identifier",
"result": {
"success": true | false,
"data": "return-value",
"error": "error-message (only if success=false)"
}
}
}stringnumberintegerbooleanarrayobjectrequired: list of mandatory parametersenum: allowed valuesminimum / maximum: numeric rangeminLength / maxLength: string length limits{
"success": true, // execution status
"data": "payload", // present when success=true
"error": "error message" // present when success=false
}{
"type": "result",
"data": {
"call_id": "call-identifier",
"result": {
"success": false,
"error": "detailed error message"
}
}
}# 1. Client registers service
C -> S: ##START\x06mcp00001[0000]{
"type": "register",
"data": {
"services": {
"get_current_time": {
"description": "Get current time",
"parameters": {
"type": "object",
"properties": {
"format": {
"type": "string",
"enum": ["simple", "detailed"]
}
}
}
}
}
}
}##END
# 2. User requests time
C -> S: ##START\x04task12340000What time is it?##END
C -> S: ##START\x03task12340001##END
# 3. Server invokes client service
S -> C: ##START\x06mcp00001[0000]{
"type": "call",
"data": {
"call_id": "call_001",
"method": "get_current_time",
"params": {
"format": "simple"
}
}
}##END
# 4. Client returns result
C -> S: ##START\x06mcp00001[0000]{
"type": "result",
"data": {
"call_id": "call_001",
"result": {
"success": true,
"data": "2025-01-22 14:30:25"
}
}
}##END
# 5. Server responds to user
S -> C: ##START\x04task12340000It is 14:30:25 on 22 Jan 2025##END
S -> C: ##START\x03task12340001##END