diff --git a/frontend/src/pages/AgentConnect.jsx b/frontend/src/pages/AgentConnect.jsx index 83ef206..318f623 100644 --- a/frontend/src/pages/AgentConnect.jsx +++ b/frontend/src/pages/AgentConnect.jsx @@ -39,6 +39,17 @@ function CodeBlock({ children, copyText }) { ) } +const AI_PROVIDERS = [ + { name: 'OpenRouter', desc: '300+ models, one key. 26 free models.', url: 'https://openrouter.ai/keys', free: true }, + { name: 'Groq', desc: 'Ultra-fast Llama inference.', url: 'https://console.groq.com/keys', free: true }, + { name: 'Hugging Face', desc: 'Thousands of open-source models.', url: 'https://huggingface.co/settings/tokens', free: true }, + { name: 'Ollama', desc: 'Run LLMs locally. No key needed.', url: 'https://ollama.com/', free: true }, + { name: 'Google Gemini', desc: 'Gemini 2.0 Flash, 2.5 Pro.', url: 'https://aistudio.google.com/apikey', free: true }, + { name: 'OpenAI', desc: 'GPT-4o, GPT-4o-mini.', url: 'https://platform.openai.com/api-keys', free: false }, + { name: 'Anthropic Claude', desc: 'Claude Sonnet 4.6, Opus 4.8.', url: 'https://console.anthropic.com/', free: false }, + { name: 'Custom', desc: 'Any OpenAI-compatible endpoint.', url: '', free: false }, +] + export default function AgentConnect() { const [config, setConfig] = useState(null) const [loading, setLoading] = useState(true) @@ -67,30 +78,89 @@ export default function AgentConnect() { } }, null, 2) + const cursorConfig = JSON.stringify({ + "mcpServers": { + "diligence": { + "url": config.mcp_url, + ...(config.api_token ? { "headers": { "Authorization": `Bearer ${config.api_token}` } } : {}) + } + } + }, null, 2) + return (
- ← Back to Integrations + ← Back to Integrations

- Connect Your AI Agent + Connect AI

- Use any MCP-compatible AI to log workouts, track food, and manage your fitness. + Two ways to use AI with Diligence: the built-in chat, or an external agent.

- {/* Connection Details */} + {/* === OPTION 1: Built-in AI Coach === */}
-
Connection
+
Option 1 — Built-in AI Coach
+

+ Get an API key from any provider below, paste it into{' '} + + Settings → Integrations + , then open the Coach tab. One key is all you need. +

+
+ {AI_PROVIDERS.map(p => ( +
+
+
+ {p.name} + {p.free && ( + FREE + )} +
+
{p.desc}
+
+ {p.url && ( + + Get key → + + )} +
+ ))} +
+ +

+ After getting a key: Settings → Integrations → AI Coaching → paste your key → open the Coach tab. +

+
+ + {/* === OPTION 2: External AI Agents (MCP) === */} +
+
Option 2 — External AI Agent (MCP)
+

+ Connect an MCP-compatible AI tool to control Diligence from outside the app. + The agent can log workouts, track food, check progress, and manage rewards. +

+ + {/* Connection Details */}
MCP Endpoint @@ -145,18 +215,9 @@ export default function AgentConnect() { API token is set but only visible to admin users.
)} - -
- {config.tools_count} tools available - | - {config.deployment === 'local' ? 'Local (SQLite)' : 'Docker (PostgreSQL)'} -
- {/* Claude Desktop Setup */} + {/* Claude Desktop */}
Claude Desktop

@@ -166,15 +227,18 @@ export default function AgentConnect() { {claudeDesktopConfig}

- On macOS: + macOS: ~/Library/Application Support/Claude/claude_desktop_config.json +
+ Windows: + %APPDATA%\Claude\claude_desktop_config.json

- {/* Claude Code Setup */} + {/* Claude Code */}
-
Claude Code
+
Claude Code (CLI)

Add the MCP server from your terminal:

@@ -183,6 +247,27 @@ export default function AgentConnect() {
+ {/* Cursor */} +
+
Cursor
+

+ Add to .cursor/mcp.json in your project: +

+ + {cursorConfig} + +
+ + {/* Windsurf / Other */} +
+
Windsurf / Other MCP Tools
+

+ Any MCP-compatible tool can connect using the endpoint and token above. + Use the same JSON format as Cursor — add a server named "diligence" + pointing to the MCP endpoint URL. +

+
+ {/* What your agent can do */}
What Your Agent Can Do
@@ -208,6 +293,9 @@ export default function AgentConnect() {
))}
+
+ {config.tools_count} tools available · {config.deployment === 'local' ? 'Local (SQLite)' : 'Docker (PostgreSQL)'} +
) diff --git a/frontend/src/pages/Settings.jsx b/frontend/src/pages/Settings.jsx index a8cf89f..2c37f6a 100644 --- a/frontend/src/pages/Settings.jsx +++ b/frontend/src/pages/Settings.jsx @@ -212,6 +212,59 @@ export default function Settings() { + {/* Help & Support */} +
+
Help & Support
+
window.open('https://github.com/DiligenceWorks/Diligence/issues', '_blank')} + style={{ + display: 'flex', alignItems: 'center', justifyContent: 'space-between', + padding: '14px 0', borderBottom: '1px solid var(--divider)', cursor: 'pointer', + }} + > +
+ 🐛 +
+
Report a Bug
+
Open an issue on GitHub
+
+
+ +
+
window.open('https://github.com/DiligenceWorks/Diligence/discussions', '_blank')} + style={{ + display: 'flex', alignItems: 'center', justifyContent: 'space-between', + padding: '14px 0', borderBottom: '1px solid var(--divider)', cursor: 'pointer', + }} + > +
+ 💬 +
+
Ask a Question
+
GitHub Discussions
+
+
+ +
+
window.open('https://github.com/DiligenceWorks/Diligence', '_blank')} + style={{ + display: 'flex', alignItems: 'center', justifyContent: 'space-between', + padding: '14px 0', cursor: 'pointer', + }} + > +
+ +
+
Star on GitHub
+
DiligenceWorks/Diligence
+
+
+ +
+
+