"use client"; import { OpenCodeMcpLogo } from "@midday/app-store/logos"; import { Icons } from "@midday/ui/icons"; import { Input } from "@midday/ui/input"; import Link from "next/link"; import { useMemo, useState } from "react"; import { highlight } from "sugar-high"; function CodeBlock({ code }: { code: string }) { const [copied, setCopied] = useState(false); const handleCopy = async () => { try { await navigator.clipboard.writeText(code); setCopied(true); setTimeout(() => setCopied(false), 2000); } catch (err) { console.error("Failed to copy:", err); } }; const codeHTML = highlight(code); return (
          
        
); } type Tab = "curl" | "npm" | "bun" | "brew"; const installCommands: Record = { curl: "curl -fsSL https://opencode.ai/install | bash", npm: "npm i -g opencode-ai", bun: "bun add -g opencode-ai", brew: "brew install anomalyco/tap/opencode", }; export function MCPOpenCode() { const [apiKey, setApiKey] = useState(""); const [activeTab, setActiveTab] = useState("curl"); const mcpConfig = useMemo(() => { const key = apiKey || "YOUR_API_KEY"; return JSON.stringify( { mcpServers: { midday: { url: "https://api.midday.ai/mcp", headers: { Authorization: `Bearer ${key}`, }, }, }, }, null, 2, ); }, [apiKey]); return (
{/* Hero Section */}
{/* Back Link */} All clients {/* Logo and Title */}

MCP Server

OpenCode

{/* Description */}

Track time while you code

Start a timer for a client project, log hours, and check your tracked time—all from your terminal. Just ask "start timer for Acme Corp" or "how many hours did I work this week?"

{/* Use Cases */}

What you can do

  • "Start timer for [customer name]"
  • "Stop timer and log 2 hours of backend work"
  • "How many hours did I track this week?"
  • "Show unbilled time for Acme Corp"
{/* Install OpenCode */}

Install OpenCode

{(["curl", "npm", "bun", "brew"] as Tab[]).map((tab) => ( ))}

Desktop app and IDE extensions also available at{" "} opencode.ai/download

{/* Divider */}
{/* API Key Input */}
setApiKey(e.target.value)} className="font-mono text-sm" />

Don't have an API key?{" "} Create one in Settings → Developer

{/* MCP Configuration */}

MCP Configuration

Add to your OpenCode MCP config file:

{/* Steps */}

Setup steps

  1. 1 Install OpenCode using one of the commands above
  2. 2 Get an API key from{" "} Settings → Developer
  3. 3 Add the MCP configuration above to your OpenCode settings
  4. 4 Restart OpenCode and ask about your Midday data
); }