Open WebUI MCP Server
An MCP (Model Context Protocol) server that exposes Open WebUI's admin APIs as tools, allowing AI assistants to manage users, groups, models, knowledge bases, and more.
Features
- User Management: List, get, update roles, delete users
- Group Management: Create, update, add/remove members, delete groups
- Model Management: Create custom models, update system prompts, manage parameters
- Knowledge Base Management: Create, list, delete knowledge bases
- Chat Management: List, view, delete chats
- Tool & Function Discovery: List available tools and functions
- Permission-Aware: All operations respect the logged-in user's permissions
Security
Important: This server passes through the user's authentication token to Open WebUI. This means:
- Admin operations require admin API keys
- Regular users can only access their own resources
- All permission checks are enforced by Open WebUI's API
Installation
Package not yet publicly published to pypi.org Use a local development version (see Development)
pip install openwebui-mcp-server
Or with uv:
uv pip install openwebui-mcp-server
Configuration
Set the required environment variable:
export WEBUI_URL=https://your-openwebui-instance.com
Optionally, set a default API key (can be overridden per-request):
export WEBUI_API_KEY=your-api-key
Usage
With Claude Desktop
Add to your Claude Desktop config (~/.config/claude/claude_desktop_config.json):
{
"mcpServers": {
"openwebui": {
"command": "openwebui-mcp",
"env": {
"WEBUI_URL": "https://your-openwebui-instance.com",
"WEBUI_API_KEY": "your-api-key"
}
}
}
}
With Open WebUI (via MCPO)
- Start the server in HTTP mode:
export WEBUI_URL=https://your-openwebui-instance.com
export MCP_TRANSPORT=http
export MCP_HTTP_PORT=8001
openwebui-mcp
- Add as MCP server in Open WebUI:
- Go to Admin Settings → External Tools
- Add new MCP server with URL:
http://localhost:8001/mcp
Programmatic Usage
from openwebui_mcp.client import OpenWebUIClient
client = OpenWebUIClient(
base_url="https://your-openwebui-instance.com",
api_key="your-api-key"
)
# List all users (admin only)
users = await client.list_users()
# Create a group
group = await client.create_group("Engineering", "Engineering team")
# Create a custom model
model = await client.create_model(
id="my-assistant",
name="My Assistant",
base_model_id="gpt-4",
meta={"system": "You are a helpful assistant."},
params={"temperature": 0.7}
)
Available Tools
User Management
| Tool | Description | Permission |
|---|---|---|
get_current_user |
Get authenticated user's profile | Any |
list_users |
List all users | Admin |
get_user |
Get specific user details | Admin |
update_user_role |
Change user role | Admin |
delete_user |
Delete a user | Admin |
Group Management
| Tool | Description | Permission |
|---|---|---|
list_groups |
List all groups | Any |
create_group |
Create a new group | Admin |
get_group |
Get group details | Any |
update_group |
Update group name/description | Admin |
add_user_to_group |
Add user to group | Admin |
remove_user_from_group |
Remove user from group | Admin |
delete_group |
Delete a group | Admin |
Model Management
| Tool | Description | Permission |
|---|---|---|
list_models |
List all models | Any |
get_model |
Get model configuration | Any |
create_model |
Create custom model | Admin |
update_model |
Update model settings | Admin |
delete_model |
Delete a model | Admin |
Knowledge Base Management
| Tool | Description | Permission |
|---|---|---|
list_knowledge_bases |
List knowledge bases | Any |
get_knowledge_base |
Get knowledge base details | Any |
create_knowledge_base |
Create knowledge base | Any |
delete_knowledge_base |
Delete knowledge base | Owner |
Chat Management
| Tool | Description | Permission |
|---|---|---|
list_chats |
List user's chats | Own |
get_chat |
Get chat messages | Own |
delete_chat |
Delete a chat | Own |
delete_all_chats |
Delete all chats | Own |
System
| Tool | Description | Permission |
|---|---|---|
list_tools |
List available tools | Any |
list_functions |
List functions/filters | Any |
get_system_config |
Get system config | Admin |
Development
# Clone the repo
git clone https://github.com/troylar/open-webui-mcp-server.git
cd open-webui-mcp-server
# Install dev dependencies and the package itself
pip install -e ".[dev]"
or using uv:
# Install dependencies (with optional dev dependencies)
uv lock && uv sync --extra="dev"
# Install the project as a package in editable mode (using optional dev dependencies)
uv pip install -e ".[dev]"
# Check your new executable
which openwebui-mcp
open-webui-mcp-server/.venv/bin/openwebui-mcp
Linter
# Run linter
ruff --config pyproject.toml check src/
# Fix linting issues
ruff --config pyproject.toml check --fix src/
Tests
# Run tests
pytest tests;
# or via `uv`
uv run pytest tests/ -v;
License
MIT License - see LICENSE for details.
Contributing
Contributions welcome! Please open an issue or PR on GitHub.
Consider for adoption
Related Projects
- Open WebUI - The web UI this server manages
- FastMCP - The MCP framework used
- MCPO - MCP to OpenAPI proxy
Metadata
Release files for openwebui-mcp-server 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| openwebui_mcp_server-0.2.0.tar.gz | 165.9 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openwebui_mcp_server-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 180.8 kB
Release files / openwebui_mcp_server-0.2.0.tar.gz
| Download URL | openwebui_mcp_server-0.2.0.tar.gz |
|---|---|
| Size | 165.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc0ec0a2657bce4b749030c56e2a61ef80d53eaf4aa2286b129875e2f4894303
|
|
BLAKE2b-256 checksum How to use checksums |
cafd9fd49a9ff3315e699006cc93f3ad622e5c74245c945b11b7f13e6895e5cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 21, 2026.
Transparency logRelease files / openwebui_mcp_server-0.2.0-py3-none-any.whl
| Download URL | openwebui_mcp_server-0.2.0-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d534ad6b31263ea1dc1889baf3601de05104e64dbe355af37d52ae70d9e328e6
|
|
BLAKE2b-256 checksum How to use checksums |
8c181953e690b7be596c3649cd0c289a02aa710b47fb6df3b08c4ac0a7c8ff7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 21, 2026.
Transparency logSecurity for openwebui-mcp-server 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for openwebui_mcp_server-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.