Skip to content

kifas.state.save

Capture the current browser state (cookies + localStorage + sessionStorage) for a session and store it under a named handle. Subsequent kifas.state.load calls with the same name (and branch) restore the state into a fresh session.

Required scopes: session:create, state:write

Name Type Required Default Description
session_id string yes — The active session whose state should be captured.
name string yes — Handle name. Re-saving with the same name overwrites the active blob.
branch string no "main" Branch the handle is scoped to. Defaults to KIFAS_BRANCH env var on the calling agent, or “main”.
workflow_id string no — Workflow to replay when state becomes stale.
validity_url string no — URL to probe for 200 to confirm state freshness.
{
"type": "object",
"properties": {
"handle_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"blob_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"superseded_blob_id": {
"anyOf": [
{
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
{
"type": "null"
}
]
},
"size_bytes": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"sha256": {
"type": "string"
}
},
"required": [
"handle_id",
"blob_id",
"superseded_blob_id",
"size_bytes",
"sha256"
],
"additionalProperties": false
}
TypeScript (Anthropic MCP SDK)
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamable-http.js'
const transport = new StreamableHTTPClientTransport(
new URL('https://mcp.kifas.io/'),
{
requestInit: {
headers: { Authorization: `Bearer ${process.env.KIFAS_API_KEY}` },
},
},
)
const client = new Client({ name: 'demo', version: '0.1.0' })
await client.connect(transport)
const result = await client.callTool({
name: 'kifas.state.save',
arguments: {
"session_id": "00000000-0000-0000-0000-000000000000",
"name": "",
"branch": "main"
},
})
console.log(result)
Python (httpx, raw JSON-RPC)
import os
import httpx
resp = httpx.post(
"https://mcp.kifas.io/",
headers={
"Authorization": f"Bearer {os.environ['KIFAS_API_KEY']}",
"Content-Type": "application/json",
},
json={
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "kifas.state.save",
"arguments": {
"session_id": "00000000-0000-0000-0000-000000000000",
"name": "",
"branch": "main"
},
},
},
)
print(resp.json())
curl
Terminal window
curl https://mcp.kifas.io/ \
-H "Authorization: Bearer $KIFAS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "kifas.state.save",
"arguments": {
"session_id": "00000000-0000-0000-0000-000000000000",
"name": "",
"branch": "main"
}
}
}'
Raw JSON-RPC body
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "kifas.state.save",
"arguments": {
"session_id": "00000000-0000-0000-0000-000000000000",
"name": "",
"branch": "main"
}
}
}

Want to try kifas.state.save? Sign in to the dashboard and run it against a real session.

Try in Kifas →