MCP pipeline authoring¶
Use the MCP tools to discover connections and build a structured draft. Enciva does not interpret a sentence itself. The external client calls the tools and copies the returned document into Enciva.
MCP does not require an AI provider inside Enciva. The built-in AI Assistant is a separate feature.
What to ask the client to do¶
These are requests a client can carry out from the tool descriptions:
- What data sources and destinations are available?
- What transformations and output formats are supported?
- Describe my Neighborhoods source.
- Create a pipeline that converts Neighborhoods to GeoPackage using WGS84 and delivers it to PostGIS.
- Rename the name field to label.
- Replace the destination records.
- Validate the resulting pipeline.
- Sample a raw source and validate a Prepare plan before adding it to the draft.
The client should ask which saved source or destination to use when more than one matches. It should copy the returned document for import. It should not add SQL, Python, shell, or a synchronization job. A source.new_url value is reported as an unsupported source and is not fetched.
Practical requests¶
These sentences are instructions for the MCP client. Enciva does not read them. The client calls the tools, then you import document. None of these requests save a Job, enable a schedule, or execute the pipeline.
Use saved connection names you already have. The examples below use Neighborhoods as a source, Production PostGIS as a database destination, and Delivery bucket as an S3 destination.
Format conversion¶
List my sources and destinations. Create a draft that converts Neighborhoods to GeoPackage and leaves the coordinate system unchanged. Validate it. Do not save or run it.
The client uses list_sources, list_destinations, and list_operations, then create_pipeline_draft with output_format set to GPKG and target_crs empty. Empty CRS keeps the source CRS.
Coordinate reprojection¶
target_crs is EPSG:3857. That is a job property, not a reproject operation. reproject is listed by list_operations and is rejected inside a generated draft.
Attribute filtering¶
Describe the Neighborhoods source. Create a draft that keeps features where status equals active, writes GeoPackage, and does not choose a destination until I say which one.
The client calls describe_source, then adds one filter_rows operation. If the field is not in the description, the client should ask you rather than invent a column name. A missing destination stays unresolved.
Several transformations¶
Create a draft from Neighborhoods that renames name to label, trims whitespace on label, and keeps rows where status equals active. Output GeoPackage in EPSG:4326.
operations contains rename_column, trim_whitespace, and filter_rows, in that order. output_format is GPKG and target_crs is EPSG:4326.
S3 destination, file name, and write mode¶
List destinations and describe Delivery bucket. Create a draft that converts Neighborhoods to GeoPackage and writes Delivery bucket at exports/neighborhoods.gpkg, failing if that object already exists. Validate the draft.
The client calls describe_destination and copies the write mode that destination advertises. It sets write_mode_specified to true. It does not assume overwrite. If the object key is omitted, the draft may suggest a file name and leave it unresolved until you confirm it in the editor. The suggestion is not stored as the destination target by itself.
Call validate_pipeline on the same draft when you want the authoring check without creating a document to import. Both tools return saved: false, executable: false, and schedule_enabled: false.
Draft result¶
create_pipeline_draft returns:
| Field | Meaning |
|---|---|
saved |
Always false |
executable |
Always false |
schedule_enabled |
Always false |
problems |
Authoring errors, including an unsupported operation or source |
unresolved |
Fields a person must choose in the editor, such as a table name or write mode |
proposal |
The checked draft |
document |
The object to import |
notices |
Reminders that the draft is unsaved, cannot execute, and is manual |
Authoring always returns a manual draft. A schedule sent to the tool is ignored and is not enabled. Configure the execution schedule when saving the pipeline as a Job.
Write mode is omitted unless write_mode_specified is true. Overwrite is never assumed. A missing S3 object key, Azure blob path, or SFTP remote path may include a suggested file name for review. That suggestion is not part of the destination target until a person confirms it.
output_format and target_crs are job properties. An empty value keeps the source value.
Import the document¶
document looks like this:
{
"format": "enciva.pipeline-draft",
"version": 1,
"notice": "Unsaved Enciva pipeline draft. It is not a Job, it cannot run, and the schedule is disabled. Import it in the pipeline editor. Enciva checks it again with your account before opening it. It stays unsaved until you click Save.",
"proposal": {}
}
Copy that object, or save it as a .json file. In the pipeline editor, choose Import draft in the pipeline toolbar. Paste the JSON or choose the file, then choose Open draft. If the canvas already has a pipeline, choose Replace canvas before the imported draft opens. Cancel leaves the current canvas unchanged. An invalid document shows an error in the dialog and does not change the canvas.
Enciva posts the document to POST /api/v1/pipelines/authoring/import with the signed-in browser session. That request checks the draft again with that user's permissions. A check performed earlier by a different token is not reused. The editor then opens the rechecked draft.
The Job is not saved, enabled, or run. Use Save as Job when you want to keep it and choose a schedule. The imported draft is manual. You can Run the opened canvas before you save it. That run is the same explicit canvas run as any other unsaved pipeline.
The import check uses the same authoring rules as a newly composed draft. Another user's source or destination id is not accepted as that user's connection. enabled: true stays off. A synchronization document is not opened as an executable sync job. SQL, Python, shell, and unsupported transforms are rejected. A source URL or filesystem path in the document is not fetched. An existing Job id is an unsupported field and the document is rejected, so import cannot update that Job. Notification and delivery settings in the document are removed and are not sent. Unknown fields and an unsupported document version are rejected. A document larger than 1 MiB is rejected. A browser request from another site is rejected. A PAT is not required for this browser request. The signed-in session is.
The document contains source and destination ids. It must not contain a PAT, a password, or a connection string. Do not put the document in a URL.
This handoff is manual. Enciva does not store the draft on a shareable address, and it does not open the editor from the MCP client. A draft can become stale if a connection changes before import. The import check reports that. The external client never turns its token into a saved or running pipeline.