fix: Auto-select free port for I/Q MCP server#169
Conversation
|
Have you looked into the other ports used as well? I/Q has a port for its MCP server, the ML repl has a port, and repl.py also offers direct MCP access to the I/R REPL outside of I/Q. By default, the ports 9148,9147,9146 are used IIRC. |
I haven't, no. I mainly wanted to be able to open both a local and a remote Isabelle instance, both with functional I/Q and assistants. I'll point Kiro at it and see if it makes sense to combine these |
|
I rebased your PR top #179 in this branch so we can see which port was chosen in the Isabelle GUI. I don't seem to be able to force-push here. Can you check and update your PR if you agree? |
hanno-becker
left a comment
There was a problem hiding this comment.
LGTM! The other ports in use by the various I/Q and I/R components have been generalized elsewhere.
Scan ports starting from 8765 to avoid conflicts when multiple Isabelle/jEdit sessions run concurrently. The actual bound port is published via a JVM system property so the Isabelle Assistant in the same process connects to the correct instance. - IQPlugin: scan ports 8765–8864, set/clear system property iq.mcp.port - IQMcpClient: read port from system property, deduplicate socket creation
d973d76 to
57c6b4c
Compare
Description of changes:
Scan ports starting from 8765 to avoid conflicts when multiple Isabelle/jEdit sessions run concurrently. The actual bound port is published via a JVM system property so the Isabelle Assistant in the same process connects to the correct instance.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.