Skip to main content Switch to mobile version ectype-mcp 0.1.1 An MCP server for Ectype: realistic, checkable synthetic tables for AI agents, made locally.
pip install ectype-mcp Copy PIP instructions
An MCP (Model Context Protocol) server that lets AI agents create and check realistic synthetic tables with the local Ectype engine.
An agent that needs a table usually invents one: it reasons about distributions, writes a NumPy script, runs it and checks nothing. With this server the agent makes one tool call instead:
One call. create_table_from_spec takes a short JSON spec and writes the rows (.csv or .parquet) plus a fingerprint (.dfp) for more rows later.
Rules hold on every row. Constraints such as date_diff_days(ship_date, order_date) >= 1 are enforced on every generated row, and validation confirms it.
The result says how the rows compare with the spec. Each column and correlation is checked, stated against achieved, with a one-line summary and a verdict.
Same seed, same file. Same spec (or fingerprint), rows and seed give a byte-identical file.
Everything local. No network requests, no port, no cloud. File access is confined to folders you name.
Real tables work too: describe_table and profile_table learn a table's structure and a fingerprint, generate_rows makes look-alike rows, and no cell value of a real table appears in any result.
Measured (cold-start experiment): eight agents that saw only the tool list made 24 data requests. 24 of 24 first calls returned without an error, 19 of 24 first attempts fully met the request, and 23 of 24 were met within five attempts (the one miss asked for hourly timestamps, which the spec cannot express).
Less to write, and checked. A spec and its call are about a third to half the size of the NumPy script an agent would otherwise write: 0.3 to 0.5 times as many characters, roughly 200 tokens against 400 to 600 per table. The result comes back with every column and rule checked, so the agent writes no checking code either.
Into any Python 3.11 to 3.13 environment:
pip install ectype-mcp ectype-mcp --version # ectype-mcp 0.1.1 ectype-mcp --help This installs the engine, ectype-data, with it.
cd ectype-mcp uv sync uv run ectype-mcp --version # ectype-mcp 0.1.1 Add it to an MCP client
The server speaks MCP over stdio. Most clients take a configuration of this shape:
{ "mcpServers": { "ectype": { "command": "ectype-mcp", "args": ["--root", "/path/to/project"] } } } The exact file and keys depend on your client; check its documentation. If ectype-mcp is not on the client's PATH, give the full path to the executable in your environment (for example .venv/bin/ectype-mcp, or .venv\Scripts\ectype-mcp.exe on Windows). Every file the server reads or writes must be inside a --root folder; repeat --root for more folders.
A recorded session with ectype-mcp 0.1.0 and ectype-data 0.2.0, over stdio. The calls and results are real; only the folder prefix of the paths is removed.
The request: 50,000 orders placed during 2024 by customers numbered 1 to 5,000. Each order ships one to seven days after it is placed, has at least one item (2.5 on average) at a unit price of about $30, comes 70% from the web and 30% from stores, is returned 3% of the time, and carries a total. Orders with more items have slightly lower unit prices.
The call: create_table_from_spec, with the spec abbreviated:
{ "output_path": "orders.parquet", "rows": 50000, "seed": 42, "spec": { "name": "orders", "columns": [ {"name": "order_id", "type": "identifier", "kind": "int_sequence"}, {"name": "order_date", "type": "datetime", "start": "2024-01-01", "end": "2024-12-31"}, {"name": "quantity", "type": "numeric", "dist": "negbinom", "mean": 1.5, "r": 3, "shift": 1}, "... five more columns ..." ], "derived": {"total": "round(quantity * unit_price, 2)"}, "constraints": ["date_diff_days(ship_date, order_date) >= 1", "date_diff_days(ship_date, order_date) = 1", "date_diff_days(ship_date, order_date) <= 7"], "correlations": [{"columns": ["quantity", "unit_price"], "rho": -0.3}] } } The result, trimmed:
{ "summary": "Wrote 50,000 rows to orders.parquet and the fingerprint to orders.dfp. All 9 checks match the spec. Validation passed.", "spec_status": "matches", "validation": { "passed": true, "structure": "5/5 checks ok", "rules": "2/2 hard rules hold on every row", "sealed": "40/40 targets passed; 0 failed beyond sampling noise", "...": "..." }, "checks": [ {"item": "quantity", "asked": "negbinom mean 2.5, sd 1.5", "got": "mean 2.49, sd 1.49", "ok": true, "by_rules": false}, {"item": "unit_price", "asked": "lognormal median 29.96", "got": "median 30.14, mean 35.96", "ok": true, "by_rules": false}, {"item": "channel", "asked": "web 0.7, store 0.3", "got": "web 0.697, store 0.303", "ok": true, "by_rules": false}, {"item": "quantity ~ unit_price", "asked": "rank correlation -0.3", "got": "rank correlation -0.285", "ok": true, "by_rules": false}, "..." ] } Two follow-up calls. Ten times the rows from the saved fingerprint, then an independent check of the new file:
generate_rows {"fingerprint_path": "orders.dfp", "output_path": "orders-big.parquet", "rows": 500000, "seed": 1} -> "Wrote 500,000 rows to orders-big.parquet. All 9 checks match the spec." validate_rows {"fingerprint_path": "orders.dfp", "table_path": "orders-big.parquet"} -> passed: true; "2/2 hard rules hold on every row"; "40/40 targets passed; 0 failed beyond sampling noise" The seven tools
Paths are absolute or relative to the first --root. Existing files are never replaced unless you pass overwrite: true. Results are small JSON objects (paths, counts, names, verdicts), never table rows. The examples below are real results, trimmed with ....
The main tool. Arguments: spec (or spec_path, a .json file holding it), output_path, rows (default 1000), seed (default 0), fingerprint_path (default: output_path with .dfp), overwrite (default false).
{ "output_path": "orders.csv", "rows": 2000, "seed": 7, "spec": { "name": "orders", "columns": [ {"name": "order_id", "type": "identifier", "kind": "int_sequence"}, {"name": "customer_id", "type": "numeric", "dist": "uniform", "lo": 0.5, "hi": 5000.5, "decimals": 0, "dtype": "Int64"}, {"name": "order_date", "type": "datetime", "start": "2024-01-01", "end": "2024-12-31"}, {"name": "ship_date", "type": "datetime", "start": "2024-01-02", "end": "2025-01-07"}, {"name": "quantity", "type": "numeric", "dist": "negbinom", "mean": 1.5, "r": 3, "shift": 1}, {"name": "unit_price", "type": "numeric", "dist": "lognormal", "mu": 3.4, "sigma": 0.6, "decimals": 2}, {"name": "channel", "type": "categorical", "probs": {"web": 0.7, "store": 0.3}}, {"name": "returned", "type": "boolean", "p": 0.03} ], "derived": {"total": "round(quantity * unit_price, 2)"}, "constraints": ["date_diff_days(ship_date, order_date) >= 1", "date_diff_days(ship_date, order_date) <= 7"], "correlations": [{"columns": ["quantity", "unit_price"], "rho": -0.3}] } } Result:
{ "summary": "Wrote 2,000 rows to ...\\orders.csv and the fingerprint to ...\\orders.dfp. All 9 checks match the spec. Validation passed.", "spec_status": "matches", "output_path": "...\\orders.csv", "fingerprint_path": "...\\orders.dfp", "rows": 2000, "seed": 7, "columns": [{"name": "order_id", "dtype": "Int64"}, {"name": "order_date", "dtype": "Date"}, "..."], "validation": { "passed": true, "structure": "5/5 checks ok", "rules": "2/2 hard rules hold on every row", "sealed": "39/40 targets passed; 0 failed beyond sampling noise", "calibration": "41/43 targets passed (optimizer evidence only)", "...": "..." }, "checks": [ {"item": "channel", "asked": "web 0.7, store 0.3", "got": "web 0.702, store 0.298", "ok": true, "by_rules": false}, {"item": "unit_price", "asked": "lognormal median 29.96", "got": "median 30.3, mean 36.28", "ok": true, "by_rules": false}, {"item": "ship_date", "asked": "spread evenly 2024-01-02 to 2025-01-07", "got": "2024-01-03 to 2025-01-06, median 2024-07-03", "ok": true, "by_rules": true}, {"item": "quantity ~ unit_price", "asked": "rank correlation -0.3", "got": "rank correlation -0.318", "ok": true, "by_rules": false}, "..." ], "notes": ["98% of the rows drawn broke a rule and were redrawn; the columns still match the spec."] } How to read it:
summary: one line to act on: what was written, how many checks are off and the first one, and the validation verdict.
spec_status: matches (every check passes), differs (a check that no rule explains is off: fix the spec), or rules_shifted (only checks on columns that rules use are off).
checks: stated against achieved for each column and correlation, failed ones first. Rules redraw the rows that break them, which can move the columns they use; those checks carry by_rules: true and, when off, suggest a value to state instead. For example, a churn date with missing 0.8 and a rule "churn after signup" came back with "got": "0.872 (to land at 0.8 after the rules, try missing 0.701)".
validation: the engine's verdict: structure and dtypes, every rule on every row, and statistics held back from the generator (sealed targets). Validation measures the rows after the rules, so it can pass while a check is off; read spec_status too.
Same spec, rows and seed give the same file. Rows are random draws, so shares land within sampling noise (about 2 to 3 points either way at 1,000 rows), not exactly.
More rows from a saved fingerprint. Arguments: fingerprint_path, output_path, rows, seed, overwrite.
{"fingerprint_path": "orders.dfp", "output_path": "more_orders.parquet", "rows": 20000, "seed": 1} { "summary": "Wrote 20,000 rows to ...\\more_orders.parquet. All 9 checks match the spec.", "spec_status": "matches", "origin": "authored", "rows": 20000, "seed": 1, "checks": ["..."], "notes": ["98% of the rows drawn broke a rule and were redrawn; the columns still match the spec."] } For a fingerprint made from a spec the result compares the rows with the spec. For one fitted to real data, spec_status is null and checks is empty; check the rows with validate_rows.
Check a table against a fingerprint. Arguments: fingerprint_path, table_path, optional holdout_path (real rows the fingerprint was not made from), sensitivity (strict | standard | lenient, default standard).
{"fingerprint_path": "orders.dfp", "table_path": "more_orders.parquet"} { "validation": { "passed": true, "rows": 20000, "structure": "5/5 checks ok", "rules": "2/2 hard rules hold on every row", "sealed": "40/40 targets passed; 0 failed beyond sampling noise", "calibration": "43/43 targets passed (optimizer evidence only)", "holdout": null, "failure_reasons": [], "worst_targets": [], "notes": [] }, "...": "..." } describe_table
Describe a real table without returning any of its values. Argument: table_path. On a fabricated customer table with names and e-mail addresses:
{"table_path": "customers_jan.csv"} { "table": { "rows": 5000, "column_count": 7, "columns": [ {"name": "full_name", "dtype": "String", "type": "categorical", "role": "pseudonym", "nulls": 0.0, "distinct": 160}, {"name": "email", "dtype": "String", "type": "string", "role": "identifier", "nulls": 0.0, "distinct": 4900}, "..." ], "personal_columns": ["full_name", "email"], "identifier_columns": ["customer_id", "email"], "suggested_rules": ["monthly_spend >= (bound, high)", "seats >= (bound, high)", "customer_id is unique (unique, high)"], "...": "..." } } Literals taken from real data are masked ( ).
Learn a fingerprint from a real table. Arguments: table_path, fingerprint_path (default: table_path with .dfp), constraints, derived, exclude_columns, personal_columns, joint (gaussian_copula, the fast default, or chain_copula, closest to the source and slower), policy (standard or strict), overwrite.
{"table_path": "customers_jan.csv", "fingerprint_path": "customers_jan_chain.dfp", "joint": "chain_copula", "constraints": ["seats >= 1"]} { "fingerprint_path": "...\\customers_jan_chain.dfp", "targets": "21 calibration + 15 sealed", "table": {"rows": 5000, "personal_columns": ["full_name", "email"], "...": "..."}, "notes": ["Generate rows with generate_rows; check them with validate_rows."] } Rows generated from this fingerprint carry stand-in tokens such as full_name_qvqr_088 for the names and fresh values for the unique keys; in this run none of the 10,000 generated rows repeated a source name or e-mail address.
Drift between two fingerprints, with no data. Arguments: reference_path (the baseline), candidate_path, sensitivity.
{"reference_path": "customers_jan.dfp", "candidate_path": "customers_feb.dfp"} { "drift": { "verdict": "drift", "targets_drifted": 4, "targets_compared": 35, "top_columns": ["monthly_spend score=5.95 (4 targets)"], "top_pairs": [], "schema_changes": [], "warnings": ["full_name: pseudonymised (...): category sets not compared; ...", "..."] }, "...": "..." } verdict is no_drift, drift or inconclusive.
What a .dfp holds. Argument: fingerprint_path.
{"fingerprint_path": "orders.dfp"} { "fingerprint": { "name": "orders", "origin": "authored", "policy": "standard", "joint_model": "gaussian_copula", "engine_version": "0.2.0", "format_version": "0.5.0", "targets": "43 calibration + 40 sealed", "rules": ["user_1: date_diff_days(ship_date, order_date) >= 1", "user_2: date_diff_days(ship_date, order_date) <= 7"], "table": {"relationships": ["total = round(quantity * unit_price, 2)"], "...": "..."}, "spec": {"name": "orders", "columns": ["..."], "...": "..."} } } For a fingerprint made from a spec, spec is the engine-format spec: edit it and call create_table_from_spec again.
Errors come back as tool errors with one or two sentences: what is wrong, then what to do. For example: Spec error in column 'price': lognormal has no parameter 'mean'; it takes mu, sigma (optional shift). Hint: .... A compact guide for agents is in docs/for-agents.md.
Cost. The tool list is a fixed cost of about 18,000 characters (roughly 4,500 tokens) on every request while the server is enabled, which pays off over several tables or when the client caches tool definitions.
Fixed: a spec of at most 256 KB and 500 columns, and a result of at most 16,000 characters (long lists are cut with a count of what was left out). One heavy job runs at a time; other calls queue.
The only transport is stdio. The server opens no port. Logs go to stderr, never stdout.
The agent is not fully trusted (it may follow instructions injected by content it read), the files are the user's, and real tables may hold personal data. In short:
Path confinement. Every path is resolved (.., symlinks and junctions followed) and must end up inside a --root folder. NUL bytes, Windows device names, alternate data streams and directories are refused.
No silent overwrite. An existing file is refused unless overwrite is true.
Atomic writes. Each output is written to a temporary file next to its destination and moved into place at the end; a failed call leaves no partial files.
Limits on rows, cells, file sizes, spec size and result size (above).
No network, no code execution. No network requests. Expressions go to the engine's closed grammar (no eval); loading a fingerprint never runs code; spec files are parsed as JSON only.
No real cell values in results. For real tables, results carry counts, names, dtypes, roles and verdicts; literals from fitted fingerprints are masked; parser errors that could quote cells are replaced by a generic message.
Engine privacy defaults kept. The research policy is not offered, and columns the engine pseudonymised cannot be switched back to real values.
Generated rows are a statistical likeness, not a privacy guarantee. Read SECURITY.md for the threat model, the limits of these measures and how to report a vulnerability.
The spec cannot yet express these; docs/ENGINE-GAPS.md has the detail and the proposed engine additions.
A date defined as an interval after another date (today: two date_diff_days rules, which redraw most rows).
A repeating key with realistic group sizes (today: a whole-number uniform).
A distribution that depends on a category or a flag, other than through lookup times a factor column; no if/when.
Hiding helper columns: every spec column is written to the output.
Shares that hold exactly after the rules (the checks suggest a value to state instead).
Timestamps on a step (hourly readings) and series per entity.
Names, e-mail addresses and other free text in a spec.
Mixtures, zero-inflated values and exact counts.
uv sync # installs the package and the dev tools uv run pytest # tests uv run ruff check . # lint uv run mypy # type check (strict) scripts/call_tool.py drives the server over stdio the way a client does. .scratch/ is ignored by git; make a folder there and use it as the root:
uv run python scripts/call_tool.py --root .scratch/try --list --out .scratch/try/tools.json uv run python scripts/call_tool.py --root .scratch/try create_table_from_spec .scratch/try/args.json args.json holds the tool's arguments as one JSON object, for example the create_table_from_spec arguments above.
Author: ZeroPoint Holdings LLC
Both files in this release have provenance metadata.
Apache-2.0 View SPDX License List
agents ectype mcp model context protocol synthetic data tabular
Development Status 3 - Alpha
Intended Audience Developers
Operating System OS Independent
Programming Language Python :: 3
Topic Scientific/Engineering :: Information Analysis
Release files for ectype-mcp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 290.6 kB
Release files / ectype_mcp-0.1.1.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Release files / ectype_mcp-0.1.1-py3-none-any.whl
Security for ectype-mcp 0.1.1
Both files in this release have been uploaded with provenance metadata.
With provenance ectype_mcp-0.1.1.tar.gz Nov 28, 2026
With provenance ectype_mcp-0.1.1-py3-none-any.whl Nov 28, 2026
Attestation for ectype_mcp-0.1.1.tar.gz
Attestation for ectype_mcp-0.1.1-py3-none-any.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Nov 28, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




