[PR #733] [MERGED] feat(browser_mcp_agent): document and unblock local Ollama / OpenAI-compatible providers #13178

Closed
opened 2026-06-21 05:42:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Shubhamsaboo/awesome-llm-apps/pull/733
Author: @RyanAlberts
Created: 4/17/2026
Status: ✅ Merged
Merged: 4/19/2026
Merged by: @Shubhamsaboo

Base: main ← Head: feat/browser-mcp-agent-local-ollama


📝 Commits (1)

  • 664e65c feat(browser_mcp_agent): document and unblock local Ollama / OpenAI-compatible providers

📊 Changes

4 files changed (+68 additions, -9 deletions)

View changed files

📝 mcp_ai_agents/browser_mcp_agent/README.md (+38 -5)
📝 mcp_ai_agents/browser_mcp_agent/main.py (+13 -3)
📝 mcp_ai_agents/browser_mcp_agent/mcp_agent.config.yaml (+11 -0)
📝 mcp_ai_agents/browser_mcp_agent/mcp_agent.secrets.yaml.example (+6 -1)

📄 Description

Summary

Issue #329 (7 comments, unresolved) asked how to run browser_mcp_agent against a local Ollama instance. As @AndrewHoh (mcp-agent maintainer) noted in that thread, the framework already supports this — Ollama's /v1 endpoint is OpenAI-compatible, so no new dependency is required. The friction is:

  1. main.py has a hardcoded os.getenv(\"OPENAI_API_KEY\") gate that unconditionally rejects users who correctly configured credentials via mcp_agent.secrets.yaml — both OpenAI and Ollama users hit this spurious error.
  2. There is no Ollama example in mcp_agent.config.yaml / mcp_agent.secrets.yaml.example.
  3. The README tells users to export OPENAI_API_KEY=... in step 4 but the on-page UI text says "Enter your OpenAI API key in your mcp_agent.secrets.yaml file" — two contradictory setup paths.

This PR fixes all three with minimal code churn.

Changes

  • main.py: the env-var gate now accepts a present mcp_agent.secrets.yaml as valid credentials. Error message points users to both paths (env var or secrets file) and mentions Ollama.
  • mcp_agent.config.yaml: added a commented Ollama example block showing base_url: http://localhost:11434/v1 + default_model: llama3.2. OpenAI default is unchanged.
  • mcp_agent.secrets.yaml.example: added commented Ollama example noting Ollama ignores api_key.
  • README.md: new "Running with a local Ollama model" section; step 4 now clearly offers env var or secrets.yaml (pick one), which matches the on-page help text.

Test plan

  • main.py parses with `ast.parse`; no new imports
  • Unit-tested the credential-gate logic across 4 scenarios (env-only, secrets-only, both, neither) — all correct, including the previously-broken secrets-only path
  • YAML files parse with `yaml.safe_load`
  • Maintainer: spot-check `streamlit run main.py` with an OpenAI key (regression) and with local Ollama (`ollama pull llama3.2 && ollama serve`)

No functional change for existing OpenAI-env-var users.

Refs #329
Credit to @AndrewHoh for the framework-level pointer that made this a config + docs change rather than a code rewrite.

Made with Cursor


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Shubhamsaboo/awesome-llm-apps/pull/733 **Author:** [@RyanAlberts](https://github.com/RyanAlberts) **Created:** 4/17/2026 **Status:** ✅ Merged **Merged:** 4/19/2026 **Merged by:** [@Shubhamsaboo](https://github.com/Shubhamsaboo) **Base:** `main` ← **Head:** `feat/browser-mcp-agent-local-ollama` --- ### 📝 Commits (1) - [`664e65c`](https://github.com/Shubhamsaboo/awesome-llm-apps/commit/664e65c593f89dc6599ab93d849521c1f9078279) feat(browser_mcp_agent): document and unblock local Ollama / OpenAI-compatible providers ### 📊 Changes **4 files changed** (+68 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `mcp_ai_agents/browser_mcp_agent/README.md` (+38 -5) 📝 `mcp_ai_agents/browser_mcp_agent/main.py` (+13 -3) 📝 `mcp_ai_agents/browser_mcp_agent/mcp_agent.config.yaml` (+11 -0) 📝 `mcp_ai_agents/browser_mcp_agent/mcp_agent.secrets.yaml.example` (+6 -1) </details> ### 📄 Description ## Summary Issue [#329](https://github.com/Shubhamsaboo/awesome-llm-apps/issues/329) (7 comments, unresolved) asked how to run `browser_mcp_agent` against a local Ollama instance. As @AndrewHoh (mcp-agent maintainer) noted in that thread, the framework already supports this — Ollama's `/v1` endpoint is OpenAI-compatible, so no new dependency is required. The friction is: 1. `main.py` has a hardcoded `os.getenv(\"OPENAI_API_KEY\")` gate that unconditionally rejects users who correctly configured credentials via `mcp_agent.secrets.yaml` — both OpenAI **and** Ollama users hit this spurious error. 2. There is no Ollama example in `mcp_agent.config.yaml` / `mcp_agent.secrets.yaml.example`. 3. The README tells users to `export OPENAI_API_KEY=...` in step 4 but the on-page UI text says \"Enter your OpenAI API key in your mcp_agent.secrets.yaml file\" — two contradictory setup paths. This PR fixes all three with minimal code churn. ## Changes - `main.py`: the env-var gate now accepts a present `mcp_agent.secrets.yaml` as valid credentials. Error message points users to both paths (env var or secrets file) and mentions Ollama. - `mcp_agent.config.yaml`: added a commented Ollama example block showing `base_url: http://localhost:11434/v1` + `default_model: llama3.2`. OpenAI default is unchanged. - `mcp_agent.secrets.yaml.example`: added commented Ollama example noting Ollama ignores api_key. - `README.md`: new \"Running with a local Ollama model\" section; step 4 now clearly offers env var **or** secrets.yaml (pick one), which matches the on-page help text. ## Test plan - [x] `main.py` parses with \`ast.parse\`; no new imports - [x] Unit-tested the credential-gate logic across 4 scenarios (env-only, secrets-only, both, neither) — all correct, including the previously-broken secrets-only path - [x] YAML files parse with \`yaml.safe_load\` - [ ] Maintainer: spot-check \`streamlit run main.py\` with an OpenAI key (regression) and with local Ollama (\`ollama pull llama3.2 && ollama serve\`) No functional change for existing OpenAI-env-var users. Refs #329 Credit to @AndrewHoh for the framework-level pointer that made this a config + docs change rather than a code rewrite. Made with [Cursor](https://cursor.com) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-06-21 05:42:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/awesome-llm-apps#13178