diff --git a/config/packages/mcp.yaml b/config/packages/mcp.yaml index 4c2a9ea9..cabcad1b 100644 --- a/config/packages/mcp.yaml +++ b/config/packages/mcp.yaml @@ -1,12 +1,4 @@ mcp: - app: "Part-DB" - version: "0.1.0" - description: "Part-DB is a inventory management database for electronic parts." - instructions: | - This server provides inventory information for your current user. It is mostly used for electronic parts, - but can be used for any kind of inventory. The stored objects are called parts. - If you miss some information from an search endpoint, try to retrieve more details using the ID of an entity. - client_transports: http: true stdio: false diff --git a/src/EventSubscriber/McpAccessSubscriber.php b/src/EventSubscriber/McpAccessSubscriber.php deleted file mode 100644 index c7cab6e2..00000000 --- a/src/EventSubscriber/McpAccessSubscriber.php +++ /dev/null @@ -1,60 +0,0 @@ -. - */ - -declare(strict_types=1); - -namespace App\EventSubscriber; - -use App\Settings\AISettings\McpSettings; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpKernel\Event\RequestEvent; -use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; -use Symfony\Component\HttpKernel\KernelEvents; - -readonly class McpAccessSubscriber implements EventSubscriberInterface -{ - public function __construct(private McpSettings $mcpSettings) - { - } - - public static function getSubscribedEvents(): array - { - return [ - KernelEvents::REQUEST => ['onKernelRequest', 10], - ]; - } - - public function onKernelRequest(RequestEvent $event): void - { - if (!$event->isMainRequest()) { - return; - } - - $path = $event->getRequest()->getPathInfo(); - - if (!str_starts_with($path, '/mcp')) { - return; - } - - if (!$this->mcpSettings->enabled) { - throw new ServiceUnavailableHttpException(null, 'The MCP endpoint is disabled. Enable it in the system settings.'); - } - } -} diff --git a/src/Settings/AISettings/AISettings.php b/src/Settings/AISettings/AISettings.php index 14544c04..732eb597 100644 --- a/src/Settings/AISettings/AISettings.php +++ b/src/Settings/AISettings/AISettings.php @@ -35,9 +35,6 @@ class AISettings { use SettingsTrait; - #[EmbeddedSettings] - public ?McpSettings $mcp = null; - #[EmbeddedSettings] public ?OpenRouterSettings $openRouter = null; diff --git a/src/Settings/AISettings/McpSettings.php b/src/Settings/AISettings/McpSettings.php deleted file mode 100644 index 929efa41..00000000 --- a/src/Settings/AISettings/McpSettings.php +++ /dev/null @@ -1,45 +0,0 @@ -. - */ - -declare(strict_types=1); - -namespace App\Settings\AISettings; - -use App\Settings\SettingsIcon; -use Jbtronics\SettingsBundle\Metadata\EnvVarMode; -use Jbtronics\SettingsBundle\Settings\Settings; -use Jbtronics\SettingsBundle\Settings\SettingsParameter; -use Jbtronics\SettingsBundle\Settings\SettingsTrait; -use Symfony\Component\Translation\TranslatableMessage as TM; - -#[Settings(label: new TM("settings.misc.mcp"))] -#[SettingsIcon("fa-robot")] -class McpSettings -{ - use SettingsTrait; - - #[SettingsParameter( - label: new TM("settings.misc.mcp.enabled"), - description: new TM("settings.misc.mcp.enabled.help"), - envVar: "bool:MCP_ENABLED", - envVarMode: EnvVarMode::OVERWRITE, - )] - public bool $enabled = false; -} diff --git a/translations/messages.de.xlf b/translations/messages.de.xlf index 8908dcaf..f736121a 100644 --- a/translations/messages.de.xlf +++ b/translations/messages.de.xlf @@ -1,6 +1,6 @@ - + attachment_type.caption @@ -10034,24 +10034,6 @@ Bitte beachten Sie, dass Sie sich nicht als deaktivierter Benutzer ausgeben kön Servereinstellungen - - - settings.misc.mcp - MCP (Model Context Protocol) Server - - - - - settings.misc.mcp.enabled - MCP-Endpunkt aktivieren - - - - - settings.misc.mcp.enabled.help - Aktiviert den MCP-Endpunkt (Model Context Protocol) unter /mcp, der es KI-Assistenten ermöglicht, mit Part-DB zu interagieren. - - settings.misc.kicad_eda diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf index 760b01e1..11dcbd8e 100644 --- a/translations/messages.en.xlf +++ b/translations/messages.en.xlf @@ -10035,24 +10035,6 @@ Please note, that you can not impersonate a disabled user. If you try you will g Server settings - - - settings.misc.mcp - MCP (Model Context Protocol) Server - - - - - settings.misc.mcp.enabled - Enable MCP endpoint - - - - - settings.misc.mcp.enabled.help - Enable the MCP (Model Context Protocol) endpoint at /mcp, which allows AI assistants to interact with Part-DB. - - settings.misc.kicad_eda