connect_to_qLABSCO SUMMARY
Query interruption is the reason this exists, and Windows outside WSL loses it.
An assistant writing q will eventually produce an infinite loop, and without SIGINT there is no way out except killing the session. That capability depends on the server being able to reach the q process, which is why the author pushes Windows users into WSL for both. The Qython translation tools are open-source proof of concept covering about 5% of the language — treat their output as a draft, not a result.
What it is
A q/kdb+ bridge built for development and debugging rather than production access. One persistent connection, sequential execution, and a timeout model that switches long queries to async so the conversation stays responsive. It can also send SIGINT to the q process to cancel a query the model should not have run.
What you get
connect_to_qwith flexible fallback — a full connection string, a port number, a hostname, or nothing at all, filled in fromQ_DEFAULT_HOSTquery_qexecutes with the async switch: fast queries return immediately, slow ones move to async and can be auto-interruptedget_current_task_statusandget_current_task_resultfollow an async query;interrupt_current_querysends SIGINT to cancel oneset_timeout_switch_to_async,set_timeout_interrupt_q,set_timeout_connectionandget_timeout_settingstune all of that at runtime- Two experimental alpha tools:
translate_qython_to_qconverts Python-like syntax to q, andtranslate_q_to_qythongoes the other way using q's own parser — verify their output before use
Requirements
Python 3.8+, a running q/kdb+ server, and either uv or pip. The lightest path is claude mcp add qmcp "uv run qmcp/server.py"; a full install is pip install qmcp then claude mcp add qmcp qmcp. Q_DEFAULT_HOST accepts host, host:port, or host:port:user:passwd. On Windows, run both the server and the q session inside WSL — outside it, SIGINT-based interruption is disabled, and it is also disabled when the server and q session sit on opposite sides of the WSL/Windows divide.
Setup effort
One command — qmcp
USE CASES
Exploring a kdb+ database in conversation
Connect to a port and run queries without switching to a q console.
Escaping a query that will not finish
Send an interrupt rather than restarting the q session.
Running something genuinely slow
Let it switch to async, then check status and collect the result when it lands.
Tuning how patient it should be
Adjust the async switch and interrupt timeouts for the work in front of you.
Reading unfamiliar q
Translate an expression into Python-like syntax to understand it, then check the result against the original.
11 tools
Listed in project docs. Your client may show a different list.
query_qset_timeout_switch_to_asyncset_timeout_interrupt_qset_timeout_connectionget_timeout_settingsget_current_task_statusget_current_task_resultinterrupt_current_querytranslate_qython_to_qtranslate_q_to_qythonBEFORE YOU INSTALL
What to know first
Tools you get
11 tools named in the project's documentation.
Requires
- qmcp on PATH
- Python 3.8+
- Flask development servers
INSTALLATION
Connect your client
Server setup
qmcpMCP Clients
Claude Code
claude mcp add qmcp qmcpClaude Desktop
{
"mcpServers": {
"qmcp": {
"command": "qmcp"
}
}
}