Skip to content

Build your personal knowledge base with Trilium Notes

feat(llm): improve MCP settings card

Elian Doranacdc840f1746
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index a398f9036a..04ca75b6cf 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -2306,6 +2306,7 @@
"api_key": "API Key",
"api_key_placeholder": "Enter your API key",
"cancel": "Cancel",
+ "mcp_title": "MCP (Model Context Protocol)",
"mcp_enabled": "Enable MCP server",
"mcp_enabled_description": "Expose a Model Context Protocol (MCP) endpoint so that AI coding assistants (e.g. Claude Code, GitHub Copilot) can read and modify your notes. The endpoint is only accessible from localhost."
}
diff --git a/apps/client/src/widgets/type_widgets/options/llm.tsx b/apps/client/src/widgets/type_widgets/options/llm.tsx
index 34d22ee928..83793be0ac 100644
--- a/apps/client/src/widgets/type_widgets/options/llm.tsx
+++ b/apps/client/src/widgets/type_widgets/options/llm.tsx
@@ -2,7 +2,6 @@ import { useCallback, useMemo, useState } from "preact/hooks";
import { t } from "../../../services/i18n";
import Button from "../../react/Button";
import FormCheckbox from "../../react/FormCheckbox";
-import FormGroup from "../../react/FormGroup";
import OptionsSection from "./components/OptionsSection";
import AddProviderModal, { type LlmProviderConfig, PROVIDER_TYPES } from "./llm/AddProviderModal";
import ActionButton from "../../react/ActionButton";
@@ -35,34 +34,34 @@ export default function LlmSettings() {
}, [providers, setProviders]);
return (
- <OptionsSection title={t("llm.settings_title")}>
- <p>{t("llm.settings_description")}</p>
+ <>
+ <OptionsSection title={t("llm.settings_title")}>
+ <p className="form-text">{t("llm.settings_description")}</p>
- <Button
- size="small"
- icon="bx bx-plus"
- text={t("llm.add_provider")}
- onClick={() => setShowAddModal(true)}
- />
-
- <hr />
+ <Button
+ size="small"
+ icon="bx bx-plus"
+ text={t("llm.add_provider")}
+ onClick={() => setShowAddModal(true)}
+ />
- <h5>{t("llm.configured_providers")}</h5>
- <ProviderList
- providers={providers}
- onDelete={handleDeleteProvider}
- />
+ <hr />
- <AddProviderModal
- show={showAddModal}
- onHidden={() => setShowAddModal(false)}
- onSave={handleAddProvider}
- />
+ <h5>{t("llm.configured_providers")}</h5>
+ <ProviderList
+ providers={providers}
+ onDelete={handleDeleteProvider}
+ />
- <hr />
+ <AddProviderModal
+ show={showAddModal}
+ onHidden={() => setShowAddModal(false)}
+ onSave={handleAddProvider}
+ />
+ </OptionsSection>
<McpSettings />
- </OptionsSection>
+ </>
);
}
@@ -70,14 +69,15 @@ function McpSettings() {
const [mcpEnabled, setMcpEnabled] = useTriliumOptionBool("mcpEnabled");
return (
- <FormGroup name="mcpEnabled" description={t("llm.mcp_enabled_description")}>
+ <OptionsSection title={t("llm.mcp_title")}>
+ <p className="form-text">{t("llm.mcp_enabled_description")}</p>
<FormCheckbox
name="mcp-enabled"
label={t("llm.mcp_enabled")}
currentValue={mcpEnabled}
onChange={setMcpEnabled}
/>
- </FormGroup>
+ </OptionsSection>
);
}