MCP server¶
Enciva exposes a stateless Model Context Protocol endpoint so an external client can discover saved connections and build an unsaved pipeline draft.
The MCP server does not call an AI provider, and it does not require one to be configured in Enciva. The external client supplies the reasoning. Enciva checks the structured draft with the same authoring rules used by the built-in assistant. The two features do not call each other.
Any client that can speak the transport on this page can use the endpoint. Cursor is one verified example. The page does not claim that every MCP client can connect.
Endpoint and transport¶
The transport is Streamable HTTP on the existing Enciva server. There is no separate process, port, or reverse proxy.
The server is stateless:
- It does not create an MCP session.
- It ignores
Mcp-Session-Id. A session id cannot authenticate a request or cross a user boundary. GETandDELETEreceive405 Method Not AllowedwithAllow: POST.- A successful
POSTreturns one JSON-RPC message as a shorttext/event-streambody.
Clients must send:
Authorization: Bearer <personal-access-token>
Content-Type: application/json
Accept: application/json, text/event-stream
MCP-Protocol-Version, when sent, must be a version the server negotiated. Omit it on initialize, or send a negotiated version afterward.
If an Origin header is present, it must match the request host or the installation's public origin. Browser requests from another site are rejected. Requests with no Origin header are accepted.
The official Go MCP SDK 1.8.0 rejects a non-loopback Host when the connection's local address is loopback. Enciva's reverse proxy forwards to 127.0.0.1, so that check applies to public traffic. The host of ENCIVA_PUBLIC_URL is accepted. Loopback names (localhost, 127.0.0.1, and [::1]) stay accepted for local development, including when ENCIVA_PUBLIC_URL is unset. Any other Host is rejected. The proxy must preserve the original Host (ProxyPreserveHost On on Apache). X-Forwarded-Host is not consulted.
There is no cross-origin browser access for this endpoint.
The request body is limited to 1 MiB. A tool result is limited to 256 KiB. At most eight MCP requests run at once, and one token can hold at most two of those slots. Each request is canceled after 30 seconds, and when the client disconnects. Schema inspection for one owned source revision is reused for 30 seconds, is not run twice concurrently, and is discarded when that source is updated.
Authentication¶
Use a Personal Access Token:
A browser session cookie is not accepted. A missing, expired, revoked, or malformed token receives HTTP 401. A token without Jobs → Compose (pipelines:compose) receives HTTP 403 and does not reach tool calls.
Create the token in Account → API Tokens. The value is shown once. Do not put it in a URL, a draft file, or a tool argument.
The checkboxes in that form use the labels below. Jobs → Compose is required before any MCP method runs. It does not allow the token to create, update, delete, enable, run, or reset a Job, and it does not change sources or destinations.
| Tool | Additional permission |
|---|---|
list_sources, describe_source, sample_source, validate_prepare |
Sources → Read |
list_destinations, describe_destination |
Destinations → Read |
list_operations, describe_operation |
Workspaces → Read |
list_prepare_operations, create_pipeline_draft, validate_pipeline |
Jobs → Compose only |
create_pipeline_draft and validate_pipeline still hide saved connection names, types, and schema details unless the matching read permission is present. A compose-only token cannot learn whether an id exists by comparing a real id with a missing one.
A practical authoring token checks only:
- Jobs → Compose
- Sources → Read
- Destinations → Read
- Workspaces → Read
That set cannot write connections, save a Job, or run one. Importing the draft into the browser uses your signed-in session, which is separate from this token.
Cursor configuration¶
This configuration was verified with Cursor. Replace the host and the token. Keep the token in Cursor's secret storage rather than in a shared file when you can.
{
"mcpServers": {
"enciva": {
"url": "https://<host>/api/v1/mcp",
"headers": {
"Authorization": "Bearer <personal-access-token>"
}
}
}
}
The same URL, method, and headers are what any other Streamable HTTP client sends. A Go client that disables the standalone SSE stream matches this server, because GET is not offered:
client := mcp.NewClient(&mcp.Implementation{Name: "example", Version: "0"}, nil)
session, err := client.Connect(ctx, &mcp.StreamableClientTransport{
Endpoint: "https://<host>/api/v1/mcp",
DisableStandaloneSSE: true,
HTTPClient: &http.Client{
Transport: roundTripperThatSetsBearer("$ENCIVA_TOKEN"),
},
}, nil)
A client that cannot send Authorization: Bearer, cannot use Streamable HTTP without a session, or can only call the endpoint from another website's browser page will not work with this server.
Claude Desktop¶
Claude Desktop is not a verified client for this endpoint. This repository's MCP tests use the Go SDK over Streamable HTTP. They do not launch Claude Desktop, and there is no recorded session against the Enciva server.
Do not copy the Cursor block into Claude Desktop and treat it as tested. A future check has to show that Claude Desktop can POST to /api/v1/mcp with a bearer token, send Accept: application/json, text/event-stream, and continue without a standalone SSE GET. Until that check exists, use Cursor or another client that already meets the transport rules above.
Where to go next¶
- Tools reference — arguments and results for each tool
- Pipeline authoring — drafts, validation, and importing into the canvas
- Source preparation — sampling a raw source and checking a Prepare plan
Troubleshooting¶
| Response | Meaning |
|---|---|
| HTTP 401 | The bearer token is missing, malformed, expired, or revoked. |
| HTTP 403 with a scope name | The token is valid and does not have the named scope. Jobs → Compose is required before any MCP method. |
HTTP 403 Forbidden origin |
The request sent an Origin that matches neither the request host nor the installation public origin. |
HTTP 403 This request is not allowed |
The browser import came from another site. |
HTTP 403 MCP requires a personal access token |
A browser session cookie was sent without a PAT. |
| HTTP 405 | The client used GET or DELETE. This server accepts POST only. |
HTTP 400 mentioning Accept |
Accept must include both application/json and text/event-stream. |
| HTTP 415 | Content-Type must be application/json. |
| HTTP 400 mentioning protocol version | MCP-Protocol-Version is present and is not a version this server negotiates. |
| HTTP 413 | The request is larger than 1 MiB. |
| HTTP 429 | The server or this token is already using its concurrent request slots. |
| HTTP 202 with an empty body | The server accepted a JSON-RPC notification, such as notifications/initialized. Notifications do not have a result. |
A tool error with isError: true means the token, the arguments, or the draft was rejected. It does not mean a Job was saved or run.
Security boundaries¶
The MCP server does not:
- save, update, delete, enable, or run a Job
- turn on a schedule
- change sources or destinations
- deliver data
- execute SQL, Python, or shell
- read an arbitrary filesystem path
- fetch a URL supplied in the draft
- read AI provider credentials or call an AI provider
- open a browser draft-transfer link
Tool results do not include passwords, API keys, access tokens, connection strings, raw source URLs, signed URL parameters, or execution logs. sample_source returns a bounded excerpt of file content for a source the token owner already saved. Repeated description of the same source is cached briefly and deduplicated. Requests are logged with the user id, the RPC method, the tool name, the status, the request size, and the duration. Arguments, credentials, and source data are not logged.
A token sees only its owner's connections. Another user's id is not distinguishable from a missing id in a way that reveals that user's name, type, or URL.
Known limitations¶
- SQL, Python, shell, synchronization, arbitrary URLs, and filesystem paths cannot be authored through these tools.
- There is no standalone SSE stream.
GETreturns 405. - The external client cannot open the editor or save the Job. A person imports the document and clicks Save changes when they want to keep it. Enciva does not publish a draft URL.
- Import does not keep notification or delivery configuration from the document.