Skip to content

feat: add tool_ids support for Open WebUI MCP tools#10

Open
ahadrez wants to merge 4 commits into
taylorwilsdon:mainfrom
ahadrez:main
Open

feat: add tool_ids support for Open WebUI MCP tools#10
ahadrez wants to merge 4 commits into
taylorwilsdon:mainfrom
ahadrez:main

Conversation

@ahadrez

@ahadrez ahadrez commented Feb 6, 2026

Copy link
Copy Markdown

Summary

  • Adds tool_ids URL query parameter support to the chat widget
  • When provided (comma-separated), tool IDs are included in the /api/chat/completions request body as tool_ids
  • This enables activation of Open WebUI tools (e.g. MCP servers) when the widget is embedded in external applications

Use Case

When embedding the widget in an application, you can now pass MCP tool IDs to enable tool usage:

/chat?api_key=xxx&model=default&endpoint=http://localhost:3000/api/chat/completions&tool_ids=server:mcp:gc-cost

The widget will include "tool_ids": ["server:mcp:gc-cost"] in the request body, activating the configured MCP tools in Open WebUI.

Changes

  • Added toolIds state variable (src/lib/ChatWidget.svelte)
  • Read tool_ids from URL query parameters (comma-separated parsing)
  • Conditionally include tool_ids array in the fetch request body when tool IDs are present

Test plan

  • Verify widget works without tool_ids param (backwards compatible, no change in behavior)
  • Verify widget includes tool_ids in request body when param is provided
  • Verify MCP tools are activated in Open WebUI when tool_ids is passed

🤖 Generated with Claude Code

Anes Hadrez and others added 4 commits February 6, 2026 17:31
Pass tool_ids as a URL query parameter (comma-separated) to include
Open WebUI tool IDs (e.g. MCP servers) in chat completion requests.
This enables MCP tool activation when the widget is embedded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The non-streaming /api/chat/completions endpoint doesn't execute
Open WebUI's MCP tool pipeline. Streaming mode enables tool context
injection and provides real-time response rendering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix conversation context bug: send full message history instead of only last message
- Add welcome screen with icon, title, subtitle, and 3 suggested prompts
- Add configurable title via 'title' URL param (defaults to 'GCP Cost Assistant')
- Add 'New chat' button to clear conversation
- Switch to Google Blue (#4285f4) color scheme
- Styled send button with blue background
- Better placeholder: 'Ask about GCP costs and pricing...'
- Chat bubble icon instead of layers icon

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reads 'prompts' query parameter as pipe-separated list of prompts.
Falls back to hardcoded defaults when not provided.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant