Card SDK Tools
The Card SDK tools let you create, validate, test, and manage custom partner cards through MCP. Partner cards extend DocFlow with custom business logic written in Python.
Card Lifecycle
Create → Validate → Test → Approve → Use in WorkflowsCreate a card with
sdk_create_cardorsdk_import_githubValidate with
sdk_validate_card(5-stage validation)Test with
sdk_test_card(sandboxed execution)Approve with
sdk_approve_card(admin required)The card is now available in
list_cardsand can be used in workflows
Development Tools
sdk_create_card
Create a new partner card from source code and manifests. Runs full 5-stage validation and stores the card in the database. The card starts in a pending state and requires admin approval to activate.
Parameters:
app_manifest
object
Yes
App manifest with id, name, version, partner info
card_manifest
object
Yes
Card manifest with id, title, entry_point, class_name, args
card_type
string
Yes
action or condition
source_code
string
Yes
Python source code (must extend PartnerCard)
test_code
string
Yes
Pytest test code for the card
locales
object
No
Locale translations, e.g. {"en": {...}, "de": {...}}
App Manifest Example:
Card Manifest Example:
Source Code Example:
Example Response:
sdk_validate_card
Run 5-stage validation on a partner card without saving. Two modes:
Mode A — Validate an existing card by ID
Mode B — Validate new source code inline
Parameters:
card_id
string
No
UUID of existing card (Mode A)
app_manifest
object
No
App manifest (Mode B)
card_manifest
object
No
Card manifest (Mode B)
card_type
string
No
action or condition (Mode B)
source_code
string
No
Python source code (Mode B)
test_code
string
No
Test code (Mode B)
Provide either card_id alone (Mode A) or app_manifest + card_manifest + source_code together (Mode B).
Validation Stages:
Structure — Verifies file layout, manifest schema, required files
AST Analysis — Checks Python syntax, class hierarchy, method signatures
Dependencies — Validates imports against allowed modules
Tests — Runs the card's test suite
Behavioral — Executes the card in sandbox to check runtime behavior
sdk_test_card
Execute a partner card in a sandboxed environment with a mock context. Uses the same security model as production (restricted builtins, import whitelist, 10-second timeout).
Parameters:
card_id
string
No
UUID of existing card (Mode A)
source_code
string
No
Source code for inline testing (Mode B)
class_name
string
No
Class name for inline testing (Mode B)
variables
object
No
Variables to pass to the card constructor
mock_context
object
No
Mock execution context
Mock Context Fields:
Example Response:
sdk_import_github
Import a partner app from a GitHub repository. Clones the repo, reads app.json, and imports all cards found in the .docflowcompose directory.
Parameters:
github_url
string
Yes
GitHub HTTPS URL (e.g. https://github.com/org/repo)
branch
string
No
Branch to clone (default: main)
token
string
No
GitHub token for private repos
Expected Repository Structure:
Example Response:
Management Tools
sdk_list_submissions
List all partner card submissions for the current organization.
Parameters: None
Example Response:
sdk_get_submission_status
Get the validation status and report for a specific partner card submission.
Parameters:
card_id
string
Yes
UUID of the partner card
Example Response:
sdk_approve_card
Approve a validated partner card and activate it for use in workflows. The card is registered in the runtime registry and becomes available in list_cards.
Parameters:
card_id
string
Yes
UUID of the partner card
Requires organization admin permissions. The card must be in validated or rejected state.
sdk_reject_card
Reject a partner card submission and deactivate it.
Parameters:
card_id
string
Yes
UUID of the partner card
reason
string
No
Reason for rejection
Requires organization admin permissions.
sdk_delete_submission
Deactivate or delete a partner card submission. Rejected or disabled cards are physically deleted from the database. Active cards are deactivated first.
Parameters:
card_id
string
Yes
UUID of the partner card
Requires organization admin permissions.
sdk_list_cards_picker
List all enabled, non-deprecated cards with role flags. Useful for determining which cards can be used in which node types when building workflows.
Parameters: None
Example Response:
Last updated
Was this helpful?