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 (
- 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.
+ Get an API key from any provider below, paste it into{' '} + + Settings → Integrations + , then open the Coach tab. One key is all you need. +
++ After getting a key: Settings → Integrations → AI Coaching → paste your key → open the Coach tab. +
++ 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 */}@@ -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
Add the MCP server from your terminal:
@@ -183,6 +247,27 @@ export default function AgentConnect() {
+ Add to .cursor/mcp.json in your project:
+
+ 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. +
+