Repository navigation
On-device Agent Skills + DuckDuckGo web search (MCP, StreamableHTTP) for Edge Gallery #1540
palontologist
started this conversation in
Skills
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Two community examples for Google AI Edge Gallery (on-device): a text-only coding Agent Skill, and a working DuckDuckGo web search via MCP (StreamableHTTP). Shared per the Skills/Discussions process (code PRs aren’t currently accepted).
1)
code-assist— text-only Agent Skill (no server)Concise, practical coding help using the model already loaded in Gallery (Gemma 4). No
run_js, no local server/bridge required.SKILL.mdonly, pushed @fbfd827)SKILL.md(e.g./sdcard/Download/code-assist).127.0.0.1:8765server was unnecessary for Gallery and failed when that server/model wasn’t ready (Failed to fetch/model_not_loaded) or when the old skill was cached. Delete/re-import the text-only version if you see tool/JS errors.2)
web-search-ddg— DuckDuckGo web search (MCP, working)Adds real tool use to Gallery: a
web_searchMCP tool (DuckDuckGo). What worked (verified): MCP connected in Edge Gallery,tools/listshowedweb_search, and tool calls returned results (DDG backend can be flaky per query; retry/rephrase).8d2d6f6) —server.py(stdio MCP,ddgs),server_http.py,requirements.txt. Companion guidance skill: https://github.com/palontologist/mobile-1b-agent/tree/main/gallery-skills/web-search-ddgddgsresults:http://127.0.0.1/.../mcp, so expose an HTTPS tunnel to host:8000and addhttps://<tunnel>/mcpin Gallery. Example (quick tunnel):npx -y cloudflared tunnel --url http://localhost:8000→ use the printedhttps://<id>.trycloudflare.com/mcp(temporary). Also works withngrok http 8000(authtoken) or a named cloudflared tunnel.https://<tunnel>/mcp→ enable onlyweb_search→ new chat, Gemma-4-E4B recommended → approve tool calls. Test: “Use web search: latest news about the Apple iPhone. Cite sources.”ddgsis unofficial/scraping (no API key) — can rate-limit or return empty; rephrase/retry or use a keyed provider (Brave/Tavily) behind an MCP server for reliability.3) On-device (Android) variant —
phone.web_search+ MCP/mcpFor an all-on-device path,
palontologist/phone-assistant(com.ai.edge.agent, @d3bd338) addsphone.web_search(DuckDuckGo Instant Answer API, keyless, on-device; limited vs full organic results) and a minimal MCP StreamableHTTP JSON-RPC endpoint atPOST http://127.0.0.1:8765/mcp(tools:phone.web_search,phone.code_assistwhen model loaded,phone.*). Verifiedinitialize/tools/list/tools/call. However, Gallery’s cleartext-to-localhost policy blockedhttp://127.0.0.1:8765/mcp; to use it from Gallery you’ll need an HTTPS-reachable path (e.g., tunneladb forward tcp:8765 tcp:8765→ host →https://.../mcp) or a Gallery policy-compatible setup.Safety/notes
All reactions