Skip to content

Commit fb25318

Browse files
committed
feat(localrecall): add MCP
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent c4573c6 commit fb25318

3 files changed

Lines changed: 741 additions & 1 deletion

File tree

.github/workflows/image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
mcp: [duckduckgo, weather, memory, homeassistant, scripts]
20+
mcp: [duckduckgo, weather, memory, homeassistant, scripts, localrecall]
2121
permissions:
2222
packages: write
2323
contents: read

README.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,106 @@ mcp:
511511
}
512512
```
513513

514+
### 📚 LocalRecall Server
515+
516+
A knowledge base management server that provides tools to interact with LocalRecall's REST API for managing collections, searching content, and managing documents.
517+
518+
**Features:**
519+
- Search content in collections
520+
- Create and reset collections
521+
- Add documents to collections
522+
- List collections and files
523+
- Delete entries from collections
524+
- Configurable tool enablement for security
525+
526+
**Tools:**
527+
- `search` - Search content in a LocalRecall collection
528+
- `create_collection` - Create a new collection
529+
- `reset_collection` - Reset (clear) a collection
530+
- `add_document` - Add a document to a collection
531+
- `list_collections` - List all collections
532+
- `list_files` - List files in a collection
533+
- `delete_entry` - Delete an entry from a collection
534+
535+
**Configuration:**
536+
- `LOCALRECALL_URL` - Base URL for LocalRecall API (default: `http://localhost:8080`)
537+
- `LOCALRECALL_API_KEY` - Optional API key for authentication (sent as `Authorization: Bearer <key>`)
538+
- `LOCALRECALL_ENABLED_TOOLS` - Comma-separated list of tools to enable (default: all tools enabled). Valid values: `search`, `create_collection`, `reset_collection`, `add_document`, `list_collections`, `list_files`, `delete_entry`
539+
540+
**Search Input Format:**
541+
```json
542+
{
543+
"collection_name": "myCollection",
544+
"query": "search term",
545+
"max_results": 5
546+
}
547+
```
548+
549+
**Search Output Format:**
550+
```json
551+
{
552+
"query": "search term",
553+
"max_results": 5,
554+
"results": [
555+
{
556+
"content": "...",
557+
"metadata": {...}
558+
}
559+
],
560+
"count": 1
561+
}
562+
```
563+
564+
**Add Document Input Format:**
565+
```json
566+
{
567+
"collection_name": "myCollection",
568+
"file_path": "/path/to/file.txt",
569+
"filename": "file.txt"
570+
}
571+
```
572+
573+
Or with inline content:
574+
```json
575+
{
576+
"collection_name": "myCollection",
577+
"file_content": "Document content here",
578+
"filename": "document.txt"
579+
}
580+
```
581+
582+
**Docker Image:**
583+
```bash
584+
docker run -e LOCALRECALL_URL=http://localhost:8080 -e LOCALRECALL_API_KEY=your-key-here ghcr.io/mudler/mcps/localrecall:latest
585+
```
586+
587+
**Enable specific tools only:**
588+
```bash
589+
docker run -e LOCALRECALL_URL=http://localhost:8080 -e LOCALRECALL_ENABLED_TOOLS="search,list_collections,list_files" ghcr.io/mudler/mcps/localrecall:latest
590+
```
591+
592+
**LocalAI configuration (to add to the model config):**
593+
```yaml
594+
mcp:
595+
stdio: |
596+
{
597+
"mcpServers": {
598+
"localrecall": {
599+
"command": "docker",
600+
"env": {
601+
"LOCALRECALL_URL": "http://localhost:8080",
602+
"LOCALRECALL_API_KEY": "your-api-key",
603+
"LOCALRECALL_ENABLED_TOOLS": "search,list_collections,add_document"
604+
},
605+
"args": [
606+
"run", "-i", "--rm",
607+
"ghcr.io/mudler/mcps/localrecall:master"
608+
]
609+
}
610+
}
611+
}
612+
```
613+
514614
## Development
515615

516616
### Prerequisites
@@ -537,6 +637,7 @@ make MCP_SERVER=memory build
537637
make MCP_SERVER=shell build
538638
make MCP_SERVER=ssh build
539639
make MCP_SERVER=scripts build
640+
make MCP_SERVER=localrecall build
540641
541642
# Run tests and checks
542643
make ci-local
@@ -607,6 +708,9 @@ Docker images are automatically built and pushed to GitHub Container Registry:
607708
- `ghcr.io/mudler/mcps/scripts:latest` - Latest Script Runner server
608709
- `ghcr.io/mudler/mcps/scripts:v1.0.0` - Tagged versions
609710
- `ghcr.io/mudler/mcps/scripts:master` - Development versions
711+
- `ghcr.io/mudler/mcps/localrecall:latest` - Latest LocalRecall server
712+
- `ghcr.io/mudler/mcps/localrecall:v1.0.0` - Tagged versions
713+
- `ghcr.io/mudler/mcps/localrecall:master` - Development versions
610714

611715
## Contributing
612716

0 commit comments

Comments
 (0)