DataMagik MCP API
Plug DataMagik into any AI agent that speaks the Model Context Protocol.
The DataMagik MCP server exposes the full platform — scripts, document templates, lookup tables, dashboards, automations, SQL queries, app designer entries, email templates, schedules, allowed domains, credentials, documentation, and the Plex database schema — to AI tools that speak MCP. If you're building an AI agent, IDE plugin, or LLM-driven workflow that needs to read or modify DataMagik resources on a user's behalf, this is the surface.
Quick start
- Generate a bearer token on your user profile page under API Keys. Same token authorises both the DataMagik REST API and the MCP server — no second key to manage.
- Point your MCP client at the endpoint below using
Authorization: Bearer <token>. - Start with the
initializehandshake, thentools/list, then call any tool.
Endpoint
POST https://mcp.data-magik.com/mcpThe server speaks MCP Streamable HTTP — JSON-RPC 2.0 in, single JSON or SSE stream out depending on the tool.
Authentication
Every request requires an Authorization: Bearer <token> header. The MCP server resolves the bearer into the issuing user's (user_id, company_id) pair and enforces ownership inside every tool: a token for Customer A cannot read or modify Customer B's resources, even if the model requests it.
Rate limit
60 requests per minute per API key, enforced as a sliding window. Every response includes:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset(epoch seconds)
Exceeding the limit returns 429 Too Many Requests with a Retry-After header. Need a higher rate? Contact support.
Initialize handshake
curl -X POST https://mcp.data-magik.com/mcp \
-H 'Authorization: Bearer dm_pat_...' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {"name": "my-agent", "version": "1.0.0"}
}
}'List available tools
curl -X POST https://mcp.data-magik.com/mcp \
-H 'Authorization: Bearer dm_pat_...' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'Returns 114+ tools across 13 families. Highlights below.
Tool families
Click a family to see every tool it exposes.
plex_* 12 toolsPlex DB schema introspection. Walk databases, tables, columns, and foreign-key relationships.
Plex DB schema introspection. Walk databases, tables, columns, and foreign-key relationships.
plex_search Free-text search across tables and columns in one callplex_describe Compact table summary: columns + types + FK targetsplex_summary High-level stats for a database (table count, size, key entities)plex_neighborhood Given a table, return its FK neighborhood (1-hop graph)plex_join_path Shortest FK-join path between two tables, ready to translate to SQLplex_validate_sql Static-check a SQL string against the Plex schema before runningplex_list_databases List the 32 known Plex databasesplex_list_tables List tables in a databaseplex_search_tables Search table names by patternplex_search_columns Search column names by pattern, optionally scoped to a tableplex_get_table Full schema for one tableplex_find_relationships List all FK relationships in/out of a tablescripts_* 12 toolsRead and write Plex scripts. Versions are tracked; executions stream output back via status polling.
Read and write Plex scripts. Versions are tracked; executions stream output back via status polling.
scripts_list List all scripts in the companyscripts_get Get one script with code + metadatascripts_create Create a new script (writes a version row)scripts_update Update script metadata or codescripts_delete Soft-delete a scriptscripts_execute Run the saved script (returns execution_id; poll with _get_execution_status)scripts_test_run Run code against a test input without savingscripts_get_execution_status Poll one execution for output/statusscripts_list_executions Recent executions for a scriptscripts_list_versions Version historyscripts_create_version Snapshot current code as a new versionscripts_validate_syntax Quick parse-check of script codesql_* 8 toolsSaved SQL queries against Plex. Async execution model (submit then poll), plus a synchronous test_run for verification.
Saved SQL queries against Plex. Async execution model (submit then poll), plus a synchronous test_run for verification.
sql_list_queries List all saved queriessql_get_query Get one query with body + metadatasql_create_query Save a new querysql_update_query Update a saved querysql_delete_query Delete a saved querysql_execute Submit for execution; returns execution_idsql_test_run Synchronous run with row cap + timeout; returns rows in the same callsql_get_execution_status Poll for results/errorsdashboards_* 9 toolsCRUD on dashboards plus live data reads of dashboard elements.
CRUD on dashboards plus live data reads of dashboard elements.
dashboards_list List dashboardsdashboards_get Get one dashboard configdashboards_create Create a dashboarddashboards_update Update title, layout, or elementsdashboards_update_settings Update only settings (filters, refresh interval)dashboards_toggle Enable or disabledashboards_delete Delete a dashboarddashboards_get_data Read live data for the whole dashboarddashboards_get_element_data Read live data for one elementapps_* 8 toolsApplication Designer apps. Versioned + auditable; saves and rollbacks are explicit.
Application Designer apps. Versioned + auditable; saves and rollbacks are explicit.
apps_list List appsapps_get Get one app configapps_create Create an appapps_update Update app metadataapps_delete Delete an appapps_list_versions Version historyapps_save_version Snapshot current state as a new versionapps_rollback_version Restore a prior versionautomations_* 17 toolsAutomation parent records plus actions, screens, questions, and execution lifecycle.
Automation parent records plus actions, screens, questions, and execution lifecycle.
automations_list List automationsautomations_create Create a new automation parent row (required before adding actions/screens/questions)automations_get Get one automation by id (cross-tenant safe)automations_delete Delete an automation and cascade its childrenautomations_list_actions List actions in an automationautomations_create_action Add an actionautomations_get_action Get one actionautomations_update_action Update an actionautomations_delete_action Delete an actionautomations_list_screens List screensautomations_add_screen Add a screenautomations_list_questions List questionsautomations_create_question Add a questionautomations_update_question Update a questionautomations_delete_question Delete a questionautomations_execute Run an automationautomations_get_execution_status Poll one executiondoc_templates_* 11 toolsDocument templates: edit, preview, commit versions, render output to PDF/CSV/Excel/etc.
Document templates: edit, preview, commit versions, render output to PDF/CSV/Excel/etc.
doc_templates_list List templatesdoc_templates_get Get template metadatadoc_templates_get_editor Get full editor payload (sections, styles)doc_templates_create Create a templatedoc_templates_preview Render preview with test datadoc_templates_commit_version Snapshot current state as a new versiondoc_templates_activate_version Mark a version as activedoc_templates_rollback_version Restore a prior versiondoc_templates_list_versions Version historydoc_templates_list_generated Recently generated documents from this templatedoc_templates_generate_pdf Render a template against a data context to PDF/HTML/CSV/Excel/XML/JSON/custom_text (queued via pdf-service)schedules_* 8 toolsScheduled script + task execution. Cron-style, with on/off toggle and run history.
Scheduled script + task execution. Cron-style, with on/off toggle and run history.
schedules_list List schedulesschedules_get Get one scheduleschedules_create Create a scheduleschedules_update Update a scheduleschedules_delete Delete a scheduleschedules_toggle Enable / disableschedules_history Recent run historyschedules_validate_cron Validate a cron expressionlookup_tables_* 10 toolsLookup tables and entries (bulk add + by-key access).
Lookup tables and entries (bulk add + by-key access).
lookup_tables_list List lookup tableslookup_tables_get Get one tablelookup_tables_create Create a tablelookup_tables_update Update a tablelookup_tables_delete Delete a tablelookup_entries_add Add one entrylookup_entries_bulk_add Bulk add many entrieslookup_entries_update Update an entrylookup_entries_delete Delete an entrylookup_by_key Fetch a value by lookup keyemail_templates_* 7 toolsEmail templates: CRUD + duplicate + send test.
Email templates: CRUD + duplicate + send test.
email_templates_list List templatesemail_templates_get Get one templateemail_templates_create Create a templateemail_templates_update Update a templateemail_templates_delete Delete a templateemail_templates_duplicate Clone a templateemail_templates_send_test Send a test emailcredentials_* 4 toolsPer-company credential vault for scripts and integrations. AES-encrypted at rest.
Per-company credential vault for scripts and integrations. AES-encrypted at rest.
credentials_list List credentialscredentials_create Create a credentialcredentials_update Update (re-encrypts secret on every write)credentials_delete Delete a credentialallowed_domains_* 3 toolsAllow-list of domains scripts can reach from outbound HTTP.
Allow-list of domains scripts can reach from outbound HTTP.
allowed_domains_list List allowed domainsallowed_domains_add Add a domainallowed_domains_remove Remove a domaindocumentation_* 5 toolsCustomer-facing markdown docs hosted on the platform.
Customer-facing markdown docs hosted on the platform.
documentation_list List docsdocumentation_get Get one docdocumentation_create Create a docdocumentation_update Update a docdocumentation_delete Delete a docWrite-tool approval flow
Tools that mutate state (anything with verbs like _create / _update / _delete) are recorded to the ai_audit_log table with the calling user_id, company_id, tool name, arguments, and outcome. Tools called from the in-product chat additionally require the user to click Approve on a preview card before they execute. External MCP clients do not get the preview UI — the audit log is the authoritative record.
Discovery
A discovery document is published at /.well-known/mcp:
curl https://mcp.data-magik.com/.well-known/mcpReturns the endpoint URL, transport name, auth scheme, and a pointer to this docs page. MCP-aware clients can use this for auto-configuration.
Compatibility
- MCP protocol version:
2024-11-05 - SDK: @modelcontextprotocol/sdk ^1.12
- Transport: Streamable HTTP (POST
/mcp) with optional SSE responses. Stdio transport not exposed publicly.
Need help?
The companion in-product AI assistant uses this same MCP server. If you can't get a tool call working, ask the in-product chat — it has access to the same tools and can debug alongside you.