refactor: Umbenennung eMPCby -> eMCPy (Namespace, Assembly, Plugin-Name, Docs)
This commit is contained in:
1 parent
542381a740
commit
3968bfea6f
8 files changed
+30
-30
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# eMPCby – emby MCP
|
||||
# eMCPy – emby MCP
|
||||
|
||||
**eMPCby** ist ein Plugin für **Emby Server**, das einen **MCP-Server** (Model Context Protocol) direkt in den Emby-Server einbettet. AI-Agenten (Claude, Hermes, …) können so über MCP auf die Emby-Bibliothek, das Playback und die Server-Administration zugreifen – ohne separate API-Brücke.
|
||||
**eMCPy** ist ein Plugin für **Emby Server**, das einen **MCP-Server** (Model Context Protocol) direkt in den Emby-Server einbettet. AI-Agenten (Claude, Hermes, …) können so über MCP auf die Emby-Bibliothek, das Playback und die Server-Administration zugreifen – ohne separate API-Brücke.
|
||||
|
||||
## Status
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
AI-Agent (MCP-Client)
|
||||
│ MCP (JSON-RPC 2.0, HTTP)
|
||||
▼
|
||||
eMPCby-Plugin (läuft IN Emby Server)
|
||||
eMCPy-Plugin (läuft IN Emby Server)
|
||||
│ direkte DI-Abhängigkeiten (kein HTTP-Roundtrip)
|
||||
▼
|
||||
Emby-Server (Bibliothek, Playback, User, Tasks, …)
|
||||
|
||||
@@ -17,7 +17,7 @@ using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
|
||||
namespace eMPCby
|
||||
namespace eMCPy
|
||||
{
|
||||
public class Plugin : BasePlugin<PluginConfiguration>
|
||||
{
|
||||
@@ -27,11 +27,11 @@ namespace eMPCby
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public override string Name => "eMPCby – emby MCP";
|
||||
public override string Name => "eMCPy – emby MCP";
|
||||
public override string Description => "MCP-Server (Model Context Protocol) für AI-Agenten.";
|
||||
|
||||
/// <summary>Feste GUID – NIE ändern (Emby identifiziert das Plugin daran).</summary>
|
||||
public override string Id => "eMPCbyEmbyMcp"; // GUID-Format empfohlen
|
||||
public override string Id => "eMCPyEmbyMcp"; // GUID-Format empfohlen
|
||||
|
||||
public static Plugin Instance { get; private set; }
|
||||
}
|
||||
@@ -42,7 +42,7 @@ namespace eMPCby
|
||||
```csharp
|
||||
using MediaBrowser.Model.Plugins;
|
||||
|
||||
namespace eMPCby
|
||||
namespace eMCPy
|
||||
{
|
||||
public class PluginConfiguration : BasePluginConfiguration
|
||||
{
|
||||
@@ -59,7 +59,7 @@ namespace eMPCby
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Model.Plugins;
|
||||
|
||||
namespace eMPCby
|
||||
namespace eMCPy
|
||||
{
|
||||
public class PluginEntryPoint : IServerEntryPoint
|
||||
{
|
||||
@@ -93,7 +93,7 @@ Emby scannt die Plugin-Assembly und registriert automatisch alle Typen mit diese
|
||||
|
||||
| Interface | Zweck |
|
||||
|---|---|
|
||||
| `IServerEntryPoint` | Init/Start/Dispose beim Serverlebenszyklus – **Kern für eMPCby** |
|
||||
| `IServerEntryPoint` | Init/Start/Dispose beim Serverlebenszyklus – **Kern für eMCPy** |
|
||||
| `IRestfulService` | Eigene REST-Endpunkte (`/emby/<route>/...`) |
|
||||
| `IScheduledTask` | Task im Dashboard (manuell + Trigger) |
|
||||
| `IPluginConfigurationPage` | HTML-Config-Seite im Dashboard |
|
||||
@@ -104,7 +104,7 @@ Kein manuelles Wiring nötig – Interface implementieren reicht.
|
||||
|
||||
## 4. Dependency Injection
|
||||
|
||||
Konstruktoren von EntryPoints/Services können beliebige Emby-Dienste anfordern. Für eMPCby relevant:
|
||||
Konstruktoren von EntryPoints/Services können beliebige Emby-Dienste anfordern. Für eMCPy relevant:
|
||||
|
||||
- `IServerManager` – Version, Status, Health
|
||||
- `IMediaLibraryManager` – Bibliotheken, Scan-Trigger
|
||||
@@ -116,9 +116,9 @@ Konstruktoren von EntryPoints/Services können beliebige Emby-Dienste anfordern.
|
||||
|
||||
## 5. Build & Deploy (Unraid/Docker)
|
||||
|
||||
- Build: `dotnet build -c Release` → `bin/Release/netstandard2.0/eMPCby.dll`
|
||||
- Build: `dotnet build -c Release` → `bin/Release/netstandard2.0/eMCPy.dll`
|
||||
- Deploy: DLL nach `/mnt/user/appdata/Emby/plugins/` (Container-Pfad `/emby/plugins/`), Emby-Container neu starten.
|
||||
- Verifikation: Dashboard → Plugins → „eMPCby“ sichtbar; `plugins/configurations/<Id>/` wird angelegt.
|
||||
- Verifikation: Dashboard → Plugins → „eMCPy“ sichtbar; `plugins/configurations/<Id>/` wird angelegt.
|
||||
- Debugging: Emby-Logs unter `/mnt/user/appdata/Emby/logs/embyserver.txt`.
|
||||
|
||||
## 6. MCP-Protokoll (Kurzreferenz)
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
|
||||
namespace eMPCby.Mcp
|
||||
namespace eMCPy.Mcp
|
||||
{
|
||||
/// <summary>
|
||||
/// Eigenständiger HTTP-Listener (Muster: WatchParty ExternalWebServer), der das
|
||||
@@ -42,13 +42,13 @@ namespace eMPCby.Mcp
|
||||
try
|
||||
{
|
||||
_listener.Start();
|
||||
_logger.Info("[eMPCby] MCP-Server lauscht auf http://{0}:{1}/mcp", _listenAddress, _port);
|
||||
_logger.Info("[eMCPy] MCP-Server lauscht auf http://{0}:{1}/mcp", _listenAddress, _port);
|
||||
Task.Run(() => ListenAsync(_cts.Token));
|
||||
return $"Lauscht auf {_listenAddress}:{_port}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("[eMPCby] MCP-Server konnte nicht starten", ex);
|
||||
_logger.ErrorException("[eMCPy] MCP-Server konnte nicht starten", ex);
|
||||
return "Fehler: " + ex.Message;
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ namespace eMPCby.Mcp
|
||||
_cts.Cancel();
|
||||
_listener.Stop();
|
||||
_listener.Close();
|
||||
_logger.Info("[eMPCby] MCP-Server gestoppt.");
|
||||
_logger.Info("[eMCPy] MCP-Server gestoppt.");
|
||||
}
|
||||
|
||||
private async Task ListenAsync(CancellationToken ct)
|
||||
@@ -129,7 +129,7 @@ namespace eMPCby.Mcp
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("[eMPCby] Fehler bei MCP-Request", ex);
|
||||
_logger.ErrorException("[eMCPy] Fehler bei MCP-Request", ex);
|
||||
try
|
||||
{
|
||||
ctx.Response.StatusCode = 500;
|
||||
@@ -7,7 +7,7 @@ using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
|
||||
namespace eMPCby.Mcp
|
||||
namespace eMCPy.Mcp
|
||||
{
|
||||
/// <summary>
|
||||
/// MCP-Tool-Registry: parst JSON-RPC 2.0 Requests (initialize, tools/list, tools/call)
|
||||
@@ -60,7 +60,7 @@ namespace eMPCby.Mcp
|
||||
return RpcResult(id, new
|
||||
{
|
||||
protocolVersion = "2024-11-05",
|
||||
serverInfo = new { name = "eMPCby", version = "1.0.0" },
|
||||
serverInfo = new { name = "eMCPy", version = "1.0.0" },
|
||||
capabilities = new { tools = new { listChanged = false } }
|
||||
});
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace eMPCby.Mcp
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("[eMPCby] Tool-Fehler: " + name, ex);
|
||||
_logger.ErrorException("[eMCPy] Tool-Fehler: " + name, ex);
|
||||
return RpcResult(id, new
|
||||
{
|
||||
content = new[] { new { type = "text", text = "Fehler: " + ex.Message } },
|
||||
@@ -190,7 +190,7 @@ namespace eMPCby.Mcp
|
||||
return new
|
||||
{
|
||||
server = "Emby",
|
||||
plugin = "eMPCby",
|
||||
plugin = "eMCPy",
|
||||
mcpEnabled = cfg?.EnableMcpServer ?? false,
|
||||
mcpPort = cfg?.McpPort ?? 0,
|
||||
userCount = Users?.GetUserCount(new MediaBrowser.Model.Querying.UserQuery()) ?? 0
|
||||
@@ -6,9 +6,9 @@ using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using eMPCby.Mcp;
|
||||
using eMCPy.Mcp;
|
||||
|
||||
namespace eMPCby
|
||||
namespace eMCPy
|
||||
{
|
||||
public class Plugin : BasePlugin<PluginConfiguration>, IServerEntryPoint
|
||||
{
|
||||
@@ -32,7 +32,7 @@ namespace eMPCby
|
||||
_jsonSerializer = jsonSerializer;
|
||||
}
|
||||
|
||||
public override string Name => "eMPCby";
|
||||
public override string Name => "eMCPy";
|
||||
|
||||
public override string Description =>
|
||||
"MCP-Server (Model Context Protocol) für Emby – Emby-Funktionen als MCP-Tools für AI-Agenten.";
|
||||
@@ -45,13 +45,13 @@ namespace eMPCby
|
||||
var cfg = Configuration;
|
||||
if (!cfg.EnableMcpServer)
|
||||
{
|
||||
_logger.Info("[eMPCby] MCP-Server ist deaktiviert.");
|
||||
_logger.Info("[eMCPy] MCP-Server ist deaktiviert.");
|
||||
return;
|
||||
}
|
||||
|
||||
_mcpServer = new McpHttpServer(_logger, _jsonSerializer, cfg.McpPort, cfg.ListenAddress, cfg.ApiKey);
|
||||
var status = _mcpServer.Start();
|
||||
_logger.Info("[eMPCby] MCP-Server Status: {0}", status);
|
||||
_logger.Info("[eMCPy] MCP-Server Status: {0}", status);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
@@ -1,6 +1,6 @@
|
||||
using MediaBrowser.Model.Plugins;
|
||||
|
||||
namespace eMPCby
|
||||
namespace eMCPy
|
||||
{
|
||||
public class PluginConfiguration : BasePluginConfiguration
|
||||
{
|
||||
@@ -2,7 +2,7 @@ using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Session;
|
||||
|
||||
namespace eMPCby
|
||||
namespace eMCPy
|
||||
{
|
||||
/// <summary>
|
||||
/// Zweites IServerEntryPoint: Emby injiziert die Dienste per Konstruktor und
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>eMPCby</AssemblyName>
|
||||
<RootNamespace>eMPCby</RootNamespace>
|
||||
<AssemblyName>eMCPy</AssemblyName>
|
||||
<RootNamespace>eMCPy</RootNamespace>
|
||||
<AssemblyVersion>1.0.0</AssemblyVersion>
|
||||
<FileVersion>1.0.0</FileVersion>
|
||||
<GenerateDocumentationFile>false</GenerateDocumentationFile>
|
||||
Reference in new issue
Block a user