Skip to main content

Zelinqa MCP

The official MCP adapter for goal-oriented question selection. The model handles the conversation; the SDK handles session IDs, pending decisions and state versions.

Python 3.11+ required. Release prerequisites are in PUBLISHING.md.

MCP host → zelinqa-mcp → Python SDK zelinqa → api.zelinqa.ai

Start

Run the published package:

uvx zelinqa-mcp

To run from source:

git clone https://github.com/Zelinqa/zelinqa-mcp.git
cd zelinqa-mcp
uv sync --group dev --locked
uv run zelinqa-mcp --version

Configure ZELINQA_API_KEY in the host's secret environment (runtime scope). Never paste keys into a chat, repository or report. Host examples are in examples/; replace local checkout paths where necessary.

Environment variable Purpose
ZELINQA_API_KEY Required runtime key, scoped to one published domain
ZELINQA_BASE_URL Default https://api.zelinqa.ai
ZELINQA_TIMEOUT_SECONDS Per-attempt timeout, default 30 seconds
ZELINQA_MAX_RETRIES Retry count, default 2
ZELINQA_SESSION_ID Optional host-owned session to resume after restart
ZELINQA_CONVERSATION Local name of that resumed session; default conversation

The supported transport is stdio, one isolated process per trusted host/user. HTTP hosting is disabled pending authentication and session isolation. Logs use stderr; stdout is reserved for MCP. Do not share one process across untrusted users.

Business tools (default)

Tool What it does
zelinqa_start Start or recover a named conversation and return its first or pending question
zelinqa_next_question Record the person's reply and return the next question; without a reply, redisplay the pending question without a new turn
zelinqa_add_context Add a context summary without asking a question
zelinqa_adjust Apply confirmed data, dimension statuses or an objective override without consuming a turn
zelinqa_status Refresh progress and the pending question
zelinqa_feedback Record an observed business result: success, partial or failure
zelinqa_forget Free the local handle; does not delete API data

The seven business tools use this loop: start, ask the returned question, then pass the person's reply to zelinqa_next_question. Repeat until stopped or the objective is achieved, then report the real business result with zelinqa_feedback.

Example tool sequence (the second call only redisplays the pending question):

{"tool":"zelinqa_start","arguments":{"conversation":"demo-42"}}
{"tool":"zelinqa_next_question","arguments":{"conversation":"demo-42"}}
{"tool":"zelinqa_next_question","arguments":{"conversation":"demo-42","user_text":"For my living room"}}

For a displayed choice use choice_labels: ["Contemporary"]. Use candidate_rank when asking a candidate other than rank 1. Session, decision and question IDs, as well as state versions, are not tool inputs. An open question requires the person's words in user_text. An outcome alone is accepted only for refused or asked_no_answer, for any question type. Closed and semi-open questions accept exact choice_labels; semi-open choices can also include free_text. assistant_text records the wording actually asked. Never invent an answer or outcome. A reply with no pending question is an error. Invalid local answers leave the pending question unchanged and can be corrected without an API call. Calling without reply fields only redisplays the pending question; candidate_rank defaults to 1.

When a CRM already knows an answer, use zelinqa_adjust instead of asking again. It accepts dimensions: [{"id":"configured_dimension_id","status":"excluded"}], data: [{"id":"configured_information_id","value":2500}], or objective: "not_achieved". Dimension statuses are achieved, not_achieved, and excluded; data also supports operation: "unset" and operation: "not_applicable" without a value. These are configured business IDs, not session or decision IDs. Use only verified information; adjust does not consume a turn and returns the usual business view. After a conflict, call status and reconcile before retrying. A question already pending is not recalculated by adjust; inspect the returned view and prefer adjusting before next_question.

Results include question text, ranks, choice labels, objective progress and counters. Next-decision results also include warnings, stop reason and degraded-mode reasons. The full target/ID maps are deliberately absent. A turn-limit warning is not proof of objective completion.

State, retries and memory

  • The registry holds at most 128 conversations. It never silently evicts one; use forget when finished. It stores current state, not a conversation transcript.
  • Calls mutating the same conversation must be sequential. A simultaneous call is rejected, not queued with a stale answer. Different conversations stay separate.
  • The SDK reuses one idempotency key across retries of a single HTTP mutation. Repeating a tool call manually is a new operation, not an automatic replay.
  • On a conflict or interrupted request, call zelinqa_status and reconcile with the pending question before answering again. Errors are not hidden.
  • Names are process-local. For restart persistence the host must retain the API session ID and inject the resume variables above outside the model.

zelinqa-mcp --advanced exposes the six low-level tools instead: create_session, resume_session, next, apply_events, get_session, submit_feedback (all prefixed zelinqa_). This mode intentionally exposes API identifiers and full state. Configuration management is not a MCP tool: use the SDK's separate configuration client/scopes.

Prompts, resource and skill

Item Purpose
Resource zelinqa://guide The same guide supplied as the server's instructions
Prompt zelinqa_integration_check User-selected integration test checklist
Skill zelinqa Short MCP workflow pointing to the guide as the reference

Reading these does not call the Zelinqa API or start a conversation. Copy the skills/zelinqa directory into your host's supported skills directory. No installation or credentials are granted by the skill itself.

Tests

uv run ruff check src tests
uv run ruff format --check src tests
uv run mypy src
uv run pytest
uv build
uv run twine check dist/*

CI runs functional tests over the in-memory MCP transport with a fake SDK, plus lint, types and packaging. Live tests are separate and opt-in: ZELINQA_LIVE=1 with ZELINQA_LIVE_RUNTIME_KEY, then uv run pytest -m live tests/live. Optional revoked/read-only keys exercise authorization failures. Use a dedicated synthetic Zelinqa: the live tests create sessions and feedback. Unit tests alone do not prove the deployed API or database persistence.

Apache-2.0. See SECURITY.md for vulnerability reporting.

Release files for zelinqa-mcp 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zelinqa-mcp 1.0.0
File Size Uploaded
zelinqa_mcp-1.0.0.tar.gz 28.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zelinqa-mcp 1.0.0
File Interpreter ABI Platform
zelinqa_mcp-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 58.6 kB

Release files / zelinqa_mcp-1.0.0.tar.gz

Download URL zelinqa_mcp-1.0.0.tar.gz
Size 28.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b36689c887a53c37cf15eff08401578e47502cf8f3f8d85fb363c111d8b78268
BLAKE2b-256 checksum
How to use checksums
ea4888396f006a1605b5770e4a62ae0665554007073d588df9839aa98fea4d30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

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 Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / zelinqa_mcp-1.0.0-py3-none-any.whl

Download URL zelinqa_mcp-1.0.0-py3-none-any.whl
Size 30.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92e6230e8bfd73794a1f37fe0cd42ffd1d3b2eab892da4cc13697601bd70eda6
BLAKE2b-256 checksum
How to use checksums
75841b571ffc0a09f5849f4db94739fb0cddcd2387dcb5bb02f171bd47a0c893
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

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 Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page