
A bunch of vtubers in a room collaborating on building a monster. There are tools strewn about and several are being wacky and unhelpful while some are getting upset and trying their hardest.
🔹 Why MCTP?
MCTP extends MCP by making it a fully web-compatible protocol that integrates smoothly with existing cloud APIs. The main goals of MCTP:
- Decentralization & Web-Native
- Works without requiring local installs.
- Any web service can implement it with minimal changes.
- Self-Discoverable & Dynamic
- Uses a discovery mechanism so clients don’t need hardcoded task routes.
- Dynamically adjusts as services add or remove task capabilities.
- Lightweight & Efficient
- Stateless HTTP(s)-only approach means it can be used in serverless environments.
- No need for custom message queues, gRPC, or proprietary protocols.
- Interoperability
- Works across different backends (Python, Node.js, Go, etc.).
- Can be integrated into existing SaaS, cloud, and enterprise APIs.
🔹 MCTP vs MCP: Key Differences
Feature | MCP | MCTP |
---|---|---|
Intended Use | Local service orchestration | Web-native API protocol |
Discovery | Optional | Required (dynamic task discovery) |
Communication | Any method (local IPC, HTTP, gRPC) | HTTP(s)-only |
Task Execution | Local or networked | Fully remote, stateless |
Status Checking | PATCH or polling | HEAD with status header |
Designed For | Localized workflows | Scalable, decentralized APIs |
🔹 MCTP Core Principles
- 📍 Discovery-First
- Every MCTP service exposes a discovery endpoint (
/discovery
). - Clients use this to determine available task routes dynamically.
- Every MCTP service exposes a discovery endpoint (
- 📡 Stateless Task Execution
- MCTP avoids long-lived connections (e.g., WebSockets) in favor of async polling.
- Tasks are submitted (
POST
), checked (HEAD
), and retrieved (GET
).
- 📊 Standardized Task Flow
POST
→ Create TaskHEAD
→ Get Status (in headers)GET
→ Retrieve Result
- 🔑 Security via Existing Web Standards
- Supports OAuth2, API keys, JWTs.
- No need for proprietary authentication mechanisms.
- 🚀 Cloud & Edge Optimized
- Works in serverless and distributed environments.
- Can be proxied and cached by API gateways.
🔹 MCTP in Action
1️⃣ Discover Available Tasks
Request:
GET /discovery
Response:
{
"endpoints": {
"image_processing": "https://api.example.com/image",
"text_analysis": "https://api.example.com/text"
}
}
2️⃣ Submit a Task
Request:
POST /text_analysis
Content-Type: application/json
{
"parameters": {
"text": "Hello world",
"language": "en"
}
}
Response:
{
"id": "12345",
"status": "pending",
"createdAt": "2025-02-22T12:00:00Z"
}
3️⃣ Check Task Status
Request:
HEAD /text_analysis/12345
Response Headers:
X-Task-Status: in_progress
4️⃣ Retrieve Task Result
Request:
GET /text_analysis/12345/result
Response:
{
"task": {
"id": "12345",
"status": "completed",
"createdAt": "2025-02-22T12:00:00Z"
},
"result": {
"sentiment": "positive",
"score": 0.98
}
}
🔹 Why MCTP Matters for Web APIs
- Zero client installs required → Works on any HTTP-capable platform.
- Dynamic and self-updating → New tasks can be added without client-side changes.
- Secure, scalable, and interoperable → Works in cloud-native environments.
- Minimal overhead → No WebSockets, gRPC, or persistent state required.
Revised JSON Schema for MCP
This schema now includes:
- Discovery Response (
DiscoveryResponse
)- Returns a list of tool task endpoints (e.g.,
/tools/someTask
).
- Returns a list of tool task endpoints (e.g.,
- Generic Task Request (
TaskRequest
)- Used for
POST
requests to the discovered tool task endpoint.
- Used for
- Generic Task Response (
TaskResponse
)- Returns the task ID and status.
- Status Check (
TaskStatusResponse
)- Used in
HEAD
requests, with status returned in headers.
- Used in
- Task Result (
TaskResultResponse
)- Used in
GET
requests to fetch task results.
- Used in
Schema Definition
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/mcp.schema.json",
"title": "Model Context Task Protocol Schema",
"type": "object",
"definitions": {
"DiscoveryResponse": {
"type": "object",
"properties": {
"endpoints": {
"type": "object",
"additionalProperties": {
"type": "string",
"description": "Base URL of a tool task"
},
"description": "Mapping of tool task names to their respective API base URLs"
}
},
"required": ["endpoints"]
},
"TaskRequest": {
"type": "object",
"properties": {
"parameters": {
"type": "object",
"additionalProperties": true,
"description": "Task-specific parameters"
}
}
},
"TaskResponse": {
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid", "description": "Unique identifier for the task" },
"status": {
"type": "string",
"enum": ["pending", "in_progress", "completed", "failed"],
"description": "Current status of the task"
},
"createdAt": { "type": "string", "format": "date-time", "description": "Task creation timestamp" }
},
"required": ["id", "status", "createdAt"]
},
"TaskStatusResponse": {
"type": "object",
"properties": {
"status": { "$ref": "#/definitions/TaskResponse/properties/status" }
},
"required": ["status"]
},
"TaskResultResponse": {
"type": "object",
"properties": {
"task": { "$ref": "#/definitions/TaskResponse" },
"result": { "type": "object", "additionalProperties": true, "description": "Task result data" }
},
"required": ["task", "result"]
}
}
}
How This Works with Discovery
Step | Method | Endpoint | Request Body | Response Schema | Notes |
---|---|---|---|---|---|
1. Discover available tool tasks | GET | /discovery | None | DiscoveryResponse | Returns task-specific endpoints |
2. Create a task | POST | {discovered_task_url} | TaskRequest | TaskResponse | Task is created dynamically |
3. Check task status | HEAD | {discovered_task_url}/{id} | None | Headers: X-Task-Status | Returns task status in headers |
4. Fetch task result | GET | {discovered_task_url}/{id}/result | None | TaskResultResponse | Retrieves completed task result |
.