Skip to content

Alexeyisme/CursorOllamaBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cursor ↔ Ollama Bridge

Expose your local Ollama to Cursor via a simple ngrok tunnel.

Quick Start

  1. Make the launcher executable (one-time):

    chmod +x scripts/start-tunnel.sh app/CursorOllamaLauncher.command
  2. Start the bridge:

    • Double‑click app/CursorOllamaLauncher.command, or
    • Run ./scripts/start-tunnel.sh

    The script prints a URL like https://<random>.ngrok-free.app/v1 and lists your local Ollama models.

  3. Configure Cursor:

    • Settings → Models → API Keys → Override OpenAI Base URL: paste the printed URL (when auth is enabled, use the variant that includes user:password@)
    • Settings → Models → API Keys → OpenAI API Key: any dummy value (e.g. 123) — or leave blank if you pasted a URL with embedded credentials
    • Settings → Models → Models: add any of the listed local models

Optional: Basic Auth

Set NGROK_BASIC_AUTH=user:password in your .env to require HTTP Basic Auth before requests reach Ollama. The launcher already loads .env, and the tunnel script forwards the credential to ngrok:

NGROK_BASIC_AUTH=cursor:supersecret ./scripts/start-tunnel.sh
  • Cursor → Settings → Models → API Keys → Override OpenAI Base URL: use the printed URL containing user:password@….
  • Cursor → Settings → Models → API Keys → OpenAI API Key: leave empty (Cursor will send the embedded credentials).
  • Copy env.example to .env for a ready-to-edit template.
  • ngrok must run with its local API enabled (default) so the script can obtain the public URL.
  • To confirm protection, curl the printed URL with -u user:password and expect a 200; try without credentials to see a 401.
  • If you skip this, the launcher prints a warning because the tunnel remains public.

Notes

  • Security: Basic Auth is optional; without NGROK_BASIC_AUTH the tunnel remains unauthenticated (the script warns you in that case). Stop the script to close access when you’re done.
  • Free ngrok URLs change each run; repeat the copy step when you restart.
  • Optional env: NGROK_AUTHTOKEN, OLLAMA_PORT, NGROK_REGION, NGROK_BASIC_AUTH are supported by the script.

About

Expose your local Ollama to Cursor via a simple ngrok tunnel

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages