Skip to content

Conversation

diversity-co-uk
Copy link

Hi,

(Many thanks for this simple but effective project.)

Previously the script installed from the pyproject.toml pointed to a missing method of main.py

[project.scripts]
ollama-mcp-bridge = "main:cli_app" <-- old

[project.scripts]
ollama-mcp-bridge = "main:main" <-- new

The script needs to point to a method that invokes typer.run, so I added a main() used both as the entry point for the script, and used by main itelf.

if name == "main":
typer.run(main)

To confirm the presence of a working script, a simple test has been added to test_unit.py

@jonigl
Copy link
Owner

jonigl commented Jun 16, 2025

Hey @diversity-co-uk thanks so much for taking the time to fix the tool, I really appreciate it! 🙌

I gave it a try myself and was able to reproduce the same error:

❯ ollama-mcp-bridge                                                                        
Traceback (most recent call last):
  File "/Users/jlowenstern/.local/bin/ollama-mcp-bridge", line 4, in <module>
    from main import cli_app
ImportError: cannot import name 'cli_app' from 'main' (/Users/jlowenstern/.local/share/uv/tools/ollama-mcp-bridge/lib/python3.10/site-packages/main.py)

Last Friday, I was actually trying to get this working for @nyomen (see jonigl/mcp-client-for-ollama#22) and didn’t even get as far as installing it 🥲

Thanks again! I’ll approve this PR and get it merged.

Copy link
Owner

@jonigl jonigl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@jonigl jonigl merged commit 8dbb024 into jonigl:main Jun 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants