You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: Bulk Import Tools modal wiring and backend implementation
- Add modal UI in admin.html with bulk import button and dialog
- Implement modal open/close/ESC functionality in admin.js
- Add POST /admin/tools/import endpoint with rate limiting
- Support both JSON textarea and file upload inputs
- Validate JSON structure and enforce 200 tool limit
- Return detailed success/failure information per tool
- Include loading states and comprehensive error handling
Refs IBM#737
Signed-off-by: Mihai Criveti <[email protected]>
* fix: Remove duplicate admin_import_tools function and fix HTML formatting
- Remove duplicate admin_import_tools function definition
- Fix HTML placeholder attribute to use double quotes
- Add missing closing div tag
- Fix flake8 blank line issues
Signed-off-by: Mihai Criveti <[email protected]>
* feat: Complete bulk import backend with file upload support and enhanced docs
- Add file upload support to admin_import_tools endpoint
- Fix response format to match frontend expectations
- Add UI usage documentation with modal instructions
- Update API docs to show all three input methods
- Enhance bulk import guide with UI and API examples
Backend improvements:
- Support tools_file form field for JSON file uploads
- Proper file content parsing with error handling
- Response includes imported/failed counts and details
- Frontend-compatible response format for UI display
Signed-off-by: Mihai Criveti <[email protected]>
* Bulk import
Signed-off-by: Mihai Criveti <[email protected]>
* fix: Remove conflicting inline script and fix bulk import functionality
- Remove conflicting inline JavaScript that was preventing form submission
- Fix indentation in setupBulkImportModal function
- Ensure bulk import modal uses proper admin.js implementation
- Restore proper form submission handling for bulk import
This fixes the issue where bulk import appeared to do nothing.
Signed-off-by: Mihai Criveti <[email protected]>
* fix: Integrate bulk import setup with main initialization
- Add setupBulkImportModal() to main initialization sequence
- Remove duplicate DOMContentLoaded listener
- Ensure bulk import doesn't interfere with other tab functionality
Signed-off-by: Mihai Criveti <[email protected]>
* fix: JavaScript formatting issues in bulk import modal
- Fix multiline querySelector formatting
- Fix multiline Error constructor formatting
- Ensure prettier compliance for web linting
Signed-off-by: Mihai Criveti <[email protected]>
* debug: Temporarily disable bulk import setup to test tabs
Signed-off-by: Mihai Criveti <[email protected]>
* fix: Remove duplicate setupFormValidation call and delay bulk import setup
- Remove duplicate setupFormValidation() call that could cause conflicts
- Use setTimeout to delay bulk import modal setup after other initialization
- Add better null safety to form element queries
- This should fix tab switching issues
Signed-off-by: Mihai Criveti <[email protected]>
* fix: Restore proper initialization sequence for tab functionality
- Remove setTimeout delay for bulk import setup
- Keep bulk import setup in main initialization but with error handling
- Ensure tab navigation isn't affected by bulk import modal setup
Signed-off-by: Mihai Criveti <[email protected]>
* fix: Correct HTML structure and restore tab navigation
- Move bulk import modal to correct location after tools panel
- Remove extra closing div that was breaking HTML structure
- Ensure proper page-level modal placement
- Restore tab navigation functionality for all tabs
This fixes the broken Global Resources, Prompts, Gateways, Roots, and Metrics tabs.
Signed-off-by: Mihai Criveti <[email protected]>
* feat: Add configurable bulk import settings
Configuration additions:
- MCPGATEWAY_BULK_IMPORT_MAX_TOOLS (default: 200)
- MCPGATEWAY_BULK_IMPORT_RATE_LIMIT (default: 10)
Implementation:
- config.py: Add new settings with defaults
- admin.py: Use configurable rate limit and batch size
- .env.example: Document all bulk import environment variables
- admin.html: Use dynamic max tools value in UI text
- CLAUDE.md: Document configuration options for developers
- docs: Update bulk import guide with configuration details
This makes bulk import fully configurable for different deployment scenarios.
Signed-off-by: Mihai Criveti <[email protected]>
* Update docs
Signed-off-by: Mihai Criveti <[email protected]>
---------
Signed-off-by: Mihai Criveti <[email protected]>
Co-authored-by: Mihai Criveti <[email protected]>
Copy file name to clipboardExpand all lines: docs/docs/manage/bulk-import.md
+61-6Lines changed: 61 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,34 +2,89 @@
2
2
3
3
The MCP Gateway provides a bulk import endpoint for efficiently loading multiple tools in a single request, perfect for migrations, environment setup, and team onboarding.
4
4
5
-
!!! info "Feature Flag Required"
6
-
This feature is controlled by the `MCPGATEWAY_BULK_IMPORT_ENABLED` environment variable.
7
-
Default: `true` (enabled). Set to `false` to disable this endpoint.
5
+
!!! info "Configuration Options"
6
+
This feature is controlled by several environment variables:
7
+
8
+
- `MCPGATEWAY_BULK_IMPORT_ENABLED=true` - Enable/disable the endpoint (default: true)
9
+
- `MCPGATEWAY_BULK_IMPORT_MAX_TOOLS=200` - Maximum tools per batch (default: 200)
10
+
- `MCPGATEWAY_BULK_IMPORT_RATE_LIMIT=10` - Requests per minute limit (default: 10)
8
11
9
12
---
10
13
11
14
## 🚀 Overview
12
15
13
-
The `/admin/tools/import` endpoint allows you to register multiple tools at once, providing:
16
+
The bulk import feature allows you to register multiple tools at once through both the Admin UI and API, providing:
14
17
15
18
-**Per-item validation** - One invalid tool won't fail the entire batch
16
19
-**Detailed reporting** - Know exactly which tools succeeded or failed
17
20
-**Rate limiting** - Protected against abuse (10 requests/minute)
18
21
-**Batch size limits** - Maximum 200 tools per request
19
-
-**Multiple input formats** - JSON payload or form data
22
+
-**Multiple input formats** - JSON payload, form data, or file upload
23
+
-**User-friendly UI** - Modal dialog with drag-and-drop file support
24
+
25
+
---
26
+
27
+
## 🎨 Admin UI Usage
28
+
29
+
### Accessing the Bulk Import Modal
30
+
31
+
1.**Navigate to Admin UI** - Open your gateway's admin interface at `http://localhost:4444/admin`
32
+
2.**Go to Tools Tab** - Click on the "Tools" tab in the main navigation
33
+
3.**Open Bulk Import** - Click the "+ Bulk Import Tools" button next to "Add New Tool"
34
+
35
+
### Using the Modal
36
+
37
+
The bulk import modal provides two ways to input tool data:
38
+
39
+
#### Option 1: JSON Textarea
40
+
1.**Paste JSON directly** into the text area
41
+
2.**Validate format** - The modal will check JSON syntax before submission
42
+
3.**Click Import Tools** to process
43
+
44
+
#### Option 2: File Upload
45
+
1.**Prepare a JSON file** with your tools array
46
+
2.**Click "Choose File"** and select your `.json` file
47
+
3.**Click Import Tools** to process
48
+
49
+
### UI Features
50
+
51
+
-**Real-time validation** - JSON syntax checking before submission
52
+
-**Loading indicators** - Progress spinner during import
53
+
-**Detailed results** - Success/failure counts with error details
54
+
-**Auto-refresh** - Page reloads automatically after successful import
55
+
-**Modal controls** - Close with button, backdrop click, or ESC key
0 commit comments