Getting started
MCP quickstart
Zero to a working render_datachain + resources/read in five calls.
Five curls. Five minutes. Ends with a rendered datachain HTML document fetched from the MCP Apps resource.
All calls target https://api.dtpr.io/mcp and use the same mcp-session-id so the rendered document persists between them.
SID=$(uuidgen)
1. Initialize
curl -s https://api.dtpr.io/mcp \
-H 'content-type: application/json' \
-H "mcp-session-id: $SID" \
--data '{"jsonrpc":"2.0","id":1,"method":"initialize"}'
Response includes protocolVersion: "2025-06-18" and the server capabilities.
2. List tools
curl -s https://api.dtpr.io/mcp \
-H 'content-type: application/json' \
-H "mcp-session-id: $SID" \
--data '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
Returns the nine tools documented at MCP tools.
3. Discover schema versions
curl -s https://api.dtpr.io/mcp \
-H 'content-type: application/json' \
-H "mcp-session-id: $SID" \
--data '{
"jsonrpc":"2.0","id":3,
"method":"tools/call",
"params":{"name":"list_schema_versions","arguments":{"datachain_type":"dtpr"}}
}'
Pick a canonical version from data.versions[].id for step 4.
4. Render a datachain
curl -s https://api.dtpr.io/mcp \
-H 'content-type: application/json' \
-H "mcp-session-id: $SID" \
--data '{
"jsonrpc":"2.0","id":4,
"method":"tools/call",
"params":{
"name":"render_datachain",
"arguments":{
"version":"dtpr@2026-09-01-beta",
"datachain":{
"id":"acme-resume-screener",
"schema_version":"dtpr@2026-09-01-beta",
"created_at":"2026-09-01T00:00:00Z",
"elements":[
{"element_id":"employment"},
{"element_id":"organization","context_type_id":"deployer","variables":[
{"id":"title","value":[{"locale":"en","value":"Acme Corp"}]},
{"id":"description","value":[{"locale":"en","value":"Runs the screener."}]}]},
{"element_id":"people","context_type_id":"subject","variables":[
{"id":"title","value":[{"locale":"en","value":"Job applicants"}]},
{"id":"description","value":[{"locale":"en","value":"Anyone who submits a resume."}]}]},
{"element_id":"recommends","context_type_id":"human_decides"}
]
}
}
}
}'
The response's _meta.ui.resourceUri is ui://dtpr/datachain/view.html. Step 5 fetches that HTML.
5. Read the rendered HTML
curl -s https://api.dtpr.io/mcp \
-H 'content-type: application/json' \
-H "mcp-session-id: $SID" \
--data '{
"jsonrpc":"2.0","id":5,
"method":"resources/read",
"params":{"uri":"ui://dtpr/datachain/view.html"}
}'
The response body carries the full HTML document (mime type text/html;profile=mcp-app). Hand it to your iframe's srcdoc.
Next
- Browse the full MCP tool reference.
- Learn the envelope + soft-failure pattern.
- Understand MCP Apps resources.