Fix: Improve LLM connectivity, add logging, increase timeout, update docs
This commit is contained in:
@@ -27,6 +27,7 @@ cp .env.example .env
|
||||
| OPENAPI_URL | http://localhost:8080/v1 | LLM API endpoint |
|
||||
| OPENAPI_API_KEY | (empty) | LLM API key |
|
||||
| MODEL_NAME | gpt-4o | LLM model to use |
|
||||
| LLM_TIMEOUT | 120 | LLM call timeout in seconds |
|
||||
| CHUNK_SIZE | 4000 | Characters per chunk |
|
||||
| OVERLAP | 200 | Characters of overlap between chunks |
|
||||
| TARGET_INTERMEDIATE_SUMMARY_LENGTH | 150 | Words per chunk summary |
|
||||
@@ -59,6 +60,40 @@ pip install -r requirements.txt
|
||||
python mcp_summary_server.py
|
||||
```
|
||||
|
||||
## Connecting to OpenWebUI
|
||||
|
||||
### In OpenWebUI Admin Settings
|
||||
|
||||
1. Go to **Admin Settings → External Tools**
|
||||
2. Click **+ (Add Server)**
|
||||
3. Set **Type** to **MCP (Streamable HTTP)**
|
||||
4. Enter your **Server URL**
|
||||
5. Set **Authentication**:
|
||||
- **None** if no API key is configured
|
||||
- **Bearer** if API_KEY is set (provide the key)
|
||||
6. Save
|
||||
|
||||
### Docker Networking
|
||||
|
||||
If running both OpenWebUI and MCP Summary in Docker:
|
||||
|
||||
```bash
|
||||
# Use host.docker.internal to reach host machine
|
||||
docker run -p 8080:8080 \
|
||||
-e OPENAPI_URL=http://host.docker.internal:3000/v1 \
|
||||
-e OPENAPI_API_KEY=your-key \
|
||||
mcp-summary
|
||||
```
|
||||
|
||||
If both containers are on the same Docker network, use the container name directly:
|
||||
|
||||
```bash
|
||||
docker run --network mynetwork -p 8080:8080 \
|
||||
-e OPENAPI_URL=http://openwebui-container:8080/v1 \
|
||||
-e OPENAPI_API_KEY=your-key \
|
||||
mcp-summary
|
||||
```
|
||||
|
||||
## MCP Tool
|
||||
|
||||
### summarize_document
|
||||
@@ -78,3 +113,25 @@ Summarizes a document, automatically handling chunking for long text.
|
||||
"chunks": 1 // number of chunks used
|
||||
}
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "Failed to connect to MCP server"
|
||||
|
||||
1. **Check authentication**: Ensure you haven't selected `Bearer` without a key. Switch to `None` if no token is needed.
|
||||
2. **Check network connectivity**: Ensure OpenWebUI can reach the MCP server URL
|
||||
3. **Check LLM connectivity**: Ensure the MCP server can reach the LLM at OPENAPI_URL
|
||||
4. **Check timeouts**: Increase LLM_TIMEOUT if summarization takes too long
|
||||
|
||||
### Infinite loading screen
|
||||
|
||||
This may occur if you configured the server as OpenAPI instead of MCP. Fix by:
|
||||
|
||||
1. Opening Admin Settings → External Tools
|
||||
2. Disabling/deleting the problematic connection
|
||||
3. Re-adding with **Type** set to **MCP (Streamable HTTP)**
|
||||
|
||||
### Slow initialization
|
||||
|
||||
If the server takes longer than 10 seconds to initialize:
|
||||
- Increase `MCP_INITIALIZE_TIMEOUT` in OpenWebUI (default: 10 seconds)
|
||||
|
||||
Reference in New Issue
Block a user