Zulip Chat Archive
Stream: Machine Learning for Theorem Proving
Topic: setting up leantool in roo-code
Jared green (Apr 21 2025 at 18:41):
is there a way to set up LeanTool in roo-code?
Jared green (Apr 21 2025 at 20:28):
where do i set the api key in the last step, and how do i get the base url to provide to roo-code?
GasStationManager (Apr 22 2025 at 01:09):
After installing and opening roo-code, there's a page "welcome to roo-code...", then "Express setup throgh a router"; scroll further down, look under "Bring your own API key", then in the list of providers select "OpenAI Compatible", then it will let you input the base url and your API key.
Jared green (Apr 22 2025 at 06:33):
i already installed roo-code. how do i get to that page?
GasStationManager (Apr 22 2025 at 08:28):
Click on the kangaroo on the left pane to open the roo pane. If that page doesn't appear, try the settings icon on the top of the roo pane.
Jared green (Apr 22 2025 at 14:44):
i got an api key from anthropic. what do i put in the other fields? my copy of LeanTool is at
C:\\Users\\jared\\AppData\\Roaming\\Roo-Code\\MCP\\LeanTool
GasStationManager (Apr 23 2025 at 05:32):
For roo code, LeanTool can be deployed two ways, as API proxy server or as MCP. If going with the proxy server route, the easiest would be to first try the demo server by following https://github.com/GasStationManager/LeanTool?tab=readme-ov-file#api-server-demo
Jared green (Apr 23 2025 at 06:11):
what do i do to run it as mcp? the site doesnt tell me.
GasStationManager (Apr 26 2025 at 01:36):
First set up your LLM normally in roo code; e.g. anthropic with your API key.
Then, set up leantool MCP server. For a quick start, you can use the demo/testing server at http://www.codeproofarena.com:8008/sse
(so no set up required at this step).
Then, set up roo code's connection to the MCP server. See https://docs.roocode.com/features/mcp/using-mcp-in-roo under "SSE". Basically fill in the server address in the config file provided, e.g.
{
"mcpServers": {
"remote-server": {
"url": "http://www.codeproofarena.com:8008/sse"
}
}
}
Jared green (Apr 28 2025 at 00:44):
what about a local mcp server connecting to a remote model
GasStationManager (Apr 28 2025 at 23:03):
Local MCP server: First install and set up LeanTool by following the steps at https://github.com/GasStationManager/LeanTool?tab=readme-ov-file#installation
(except the last step; you'll set up the LLM in roo code)
Then, to deploy the MCP server in SSE mode, run in the command line poetry run python leanmcp.py --sse --port 8008 and then put the URL http://localhost:8008/sse in roo code's mcp configuration, e.g.
{
"mcpServers": {
"remote-server": {
"url": "http://localhost:8008/sse"
}
}
}
Jared green (Apr 29 2025 at 14:38):
what would that line be if poetry was installed via pip?
Jared green (Apr 29 2025 at 14:43):
and do i have to do that every time i turn on my computer?
GasStationManager (Apr 29 2025 at 20:05):
Jared green said:
what would that line be if poetry was installed via pip?
I'm not too familiar with that myself. Going by the poetry documentation at https://python-poetry.org/docs/#installing-manually
if you installed poetry via pip into a venv as the doc suggested, then you can invoke poetry by $VENV_PATH/bin/poetry where $VENV_PATH is where you put the venv at.
Jared green (Apr 30 2025 at 18:25):
apparently just cd <path-to-leantool>; python -m poetry run python leanmcp.py --sse --port 8008
however im getting
PS C:\Users\jared\AppData\Roaming\Roo-Code\MCP\LeanTool> python -m poetry run python leanmcp.py --sse --port 8008
Traceback (most recent call last):
File "C:\Users\jared\AppData\Roaming\Roo-Code\MCP\LeanTool\leanmcp.py", line 1, in <module>
from mcp.server.fastmcp import FastMCP
ModuleNotFoundError: No module named 'mcp'
GasStationManager (Apr 30 2025 at 21:59):
poetry is the package manager that LeanTool uses to install its python dependencies. So in the LeanTool installation instructions https://github.com/GasStationManager/LeanTool?tab=readme-ov-file#installation
one of the steps is to do poetry install in the LeanTool directory. (This would read the config file pyproject.toml which tells poetry to install the mcp library among others.)
Did you go through those installation steps?
Jared green (May 01 2025 at 13:18):
yes
Jared green (May 01 2025 at 13:21):
the list of things it installed does not have mcp
Jared green (May 02 2025 at 02:10):
is the fact it didnt install mcp a windows only thing? i tried installing it separately but that didnt work.(i dont know the line for getting it in the same environment)
GasStationManager (May 03 2025 at 13:34):
I think the recommended way of installing poetry is to install poetry as a standalone, see https://python-poetry.org/docs/#installing-with-the-official-installer under "Windows (PowerShell)"
Then run poetry install in the LeanTool repo directory.
If sucessful, the mcp library and others will be installed in the virtual env created by poetry for this project. You can see it by e.g.
poetry run pip list
泡泡 (May 03 2025 at 16:47):
I'm encountering a problem while using Lean4 in combination with VS Code for theorem proving, and I'm now seeking help from everyone.
During the operation, I wrote Lean4 code following the regular steps and attempted to conduct theorem proving. However, the expected green checkmark symbol didn't appear, which means there was no feedback on the execution result. I have confirmed that the Lean4 extension in VS Code has been correctly installed, and all relevant dependencies have also been set up properly.
I have tried restarting VS Code, and even reinstalling the Lean4 extension and the related environment, but the problem still persists. Currently, I'm not sure whether there is a logical error in the code or there are some omissions in the environment configuration.
Patrick Massot (May 03 2025 at 17:30):
Please do not double post, especially in completely unrelated topics.
Jared green (May 03 2025 at 20:18):
from part of that list:
jsonschema-specifications 2025.4.1
markdown-it-py 3.0.0
MarkupSafe 3.0.2
mdurl 0.1.2
multidict 6.4.3
narwhals 1.37.1
numpy 2.2.5
packaging 24.2
apparently it also fails to install openai not sure what if anything i should do about that.
GasStationManager (May 04 2025 at 16:03):
That does sound like poetry install failed partway through. Try
poetry install in the LeanTool directory again; what errors does it give?
Jared green (May 05 2025 at 16:14):
- Installing openai (1.75.0): Failed
FileNotFoundError
[Errno 2] No such file or directory: 'C:\\Users\\jared\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\Local\\pypoetry\\Cache\\virtualenvs\\leantool-rAtt-6DR-py3.10\\Lib\\site-packages\\openai\\types\\beta\\realtime\\conversation_item_input_audio_transcription_completed_event.py'
at C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\pathlib.py:1119 in open
1115│ the built-in open() function does.
1116│ """
1117│ if "b" not in mode:
1118│ encoding = io.text_encoding(encoding)
→ 1119│ return self._accessor.open(self, mode, buffering, encoding, errors,
1120│ newline)
1121│
1122│ def read_bytes(self):
1123│ """
Cannot install openai.
Jared green (May 05 2025 at 16:23):
meanwhile i tried installing mcp separately before this and it still fails to find it.
Jared green (May 05 2025 at 16:30):
its currently on the commit from 5 days ago and everything else updated on saturday.
GasStationManager (May 06 2025 at 18:44):
I am not familiar with that error message. My best guess is that something strange has happened to the installation that it is best to start over. So,
- install poetry as a standalone. E.g. open PowerShell and follow the instruction from https://python-poetry.org/docs/#installing-with-the-official-installer under "Windows (PowerShell)"
- git clone the LeanTool repository and follow the installation steps from https://github.com/GasStationManager/LeanTool?tab=readme-ov-file#installation
- One issue that you might run into, which is possibly related to the errors you were encountering, is that one of our dependencies Pantograph has just switched to using uv as package manager in the latest version (0.3.1). I will need to figure out what need to be changed in our installation procedure to adapt to that; but meanwhile you could skip the Pantograph installation by removing the line corresponding to Pantograph in
pyproject.tomlof the LeanTool repo before runningpoetry install.
Jared green (May 07 2025 at 14:27):
it does not appear to be anything wrong with the installation process. i dont know why, but it just seems to be unable to install openai, and doesnt even try to install mcp.
Jared green (May 07 2025 at 14:49):
are there any technical limits on using the demo url provided?
Last updated: Dec 20 2025 at 21:32 UTC