86 lines
3.5 KiB
Markdown
86 lines
3.5 KiB
Markdown
# eMCPy – MCP server inside Emby
|
||
|
||
**English** | [Deutsch](README.de.md)
|
||
|
||
eMCPy is a plugin for **Emby Server** that runs an **MCP server** (Model Context
|
||
Protocol) inside Emby itself. AI agents can read the library, playback and server
|
||
administration through MCP, without a separate API bridge or Emby API token.
|
||
|
||
## Features
|
||
|
||
- 49 tools: search, item details, media streams, codec inventory, library stats
|
||
and browsing, paginated series inventory (`detail="compact"` for comparisons)
|
||
- Image, language, metadata and age-rating checks, provider episode comparison
|
||
- Scheduled tasks (list, run, cancel), activity log, redacted server log,
|
||
plugins, devices, storage, Live TV (read only)
|
||
- Write tools are **off by default**, start as a preview and need `confirm=true`
|
||
- Optional self-update from this repository's `releases/latest.json` (SHA-256 checked)
|
||
|
||
Tool reference (German): [advanced tools](docs/advanced-tools.md),
|
||
[admin and Live TV](docs/admin-livetv.md), [series inventory](docs/series-inventory.md).
|
||
|
||
## Requirements
|
||
|
||
- Emby Server 4.9 (tested with 4.9.5.0, Docker)
|
||
- To build: .NET 6 SDK
|
||
|
||
## Installation
|
||
|
||
1. Take `releases/<version>/eMCPy.dll` and check it against `SHA256SUMS`
|
||
(or build it, see Development).
|
||
2. Stop Emby, copy **only** `eMCPy.dll` into Emby's `plugins/` folder
|
||
(Unraid Docker usually `/mnt/user/appdata/Emby/plugins/`), start Emby.
|
||
3. Open **Dashboard → Plugins → eMCPy** and set an API key.
|
||
4. The MCP endpoint is `http://<emby-host>:8097/mcp`. In Docker, map port 8097
|
||
in the container template; Emby itself only publishes 8096/8920.
|
||
|
||
Release notes per version: [releases/](releases/).
|
||
|
||
## Configuration
|
||
|
||
All settings are on the plugin page in the Emby dashboard.
|
||
|
||
| Setting | Default | Meaning |
|
||
|---|---|---|
|
||
| MCP server enabled | on | starts the HTTP listener |
|
||
| Port / listen address | `8097` / `0.0.0.0` | where the listener binds |
|
||
| API key | empty | sent as `X-Api-Key` or `Authorization: Bearer …` |
|
||
| Write tools | off | allows changing actions (still preview + `confirm=true`) |
|
||
| Allowed origins | empty | extra browser origins (e.g. your dashboard domain) |
|
||
| Allowed tasks | empty | task keys `emby_run_task` may start; restart/update/backup are blocked otherwise |
|
||
| Automatic updates | on | daily check, see [self-update](docs/self-update.md) |
|
||
|
||
## Usage
|
||
|
||
Add the endpoint to your MCP client as a streamable HTTP server with the API key
|
||
as header, e.g.:
|
||
|
||
```json
|
||
{ "mcpServers": { "emby": { "url": "http://emby.local:8097/mcp", "headers": { "X-Api-Key": "<api-key>" } } } }
|
||
```
|
||
|
||
## Security
|
||
|
||
- Meant for the local network only. Always set an API key; without one on all
|
||
interfaces the plugin logs a warning.
|
||
- Browser requests are accepted only from localhost, private IPs, the Emby server
|
||
URL and the allowed origins (protection against DNS rebinding).
|
||
- Tokens and keys are never returned; the server log is redacted.
|
||
- Self-update trusts the repository: whoever can push to it can run code on your
|
||
Emby server. Turn auto-install off if you do not want that.
|
||
|
||
## Development
|
||
|
||
```sh
|
||
dotnet run --project tests/eMCPy.Tests # offline tests
|
||
dotnet publish src/eMCPy/eMCPy.csproj -c Release -o dist # build the DLL
|
||
scripts/make-release.sh "release note" # tests, build, releases/<v>/, latest.json
|
||
```
|
||
|
||
`scripts/verify-live-*.php` are read-only acceptance checks to run on the Emby
|
||
host after an install. Background notes (German): [docs/DETAILS.md](docs/DETAILS.md).
|
||
|
||
## License
|
||
|
||
MIT, see [LICENSE](LICENSE). Not affiliated with Emby LLC.
|