[{"data":1,"prerenderedAt":361},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fai\u002Fmcp-server":3,"github-stars":358},{"id":4,"title":5,"body":6,"description":349,"extension":350,"meta":351,"navigation":352,"order":99,"path":353,"section":354,"seo":355,"stem":356,"__hash__":357},"docs\u002Fdocs\u002Fai\u002Fmcp-server.md","MCP server",{"type":7,"value":8,"toc":343},"minimark",[9,13,17,25,30,33,62,65,69,75,85,88,153,167,171,174,303,306,310,324,330,339],[10,11,5],"h1",{"id":12},"mcp-server",[14,15,16],"p",{},"Every Clerq instance is also a Model Context Protocol (MCP) server. It exposes\n43 tools spanning clients, projects, tasks, time tracking, invoicing,\nexpenses and team management, so an AI assistant like Claude can operate your\nback office on your behalf - using a scoped OAuth token, never your password.",[14,18,19,20,24],{},"The server is part of the app itself. If your instance is running, the MCP\nendpoint is live at ",[21,22,23],"code",{},"\u002Fapi\u002Fmcp"," - there is nothing extra to deploy.",[26,27,29],"h2",{"id":28},"how-access-works","How access works",[14,31,32],{},"The instance acts as an OAuth 2.1 authorization server, so connecting an\nassistant is a standard authorization flow:",[34,35,36,48,51,54],"ol",{},[37,38,39,40,43,44,47],"li",{},"The assistant discovers the endpoints from\n",[21,41,42],{},"\u002F.well-known\u002Foauth-protected-resource"," and\n",[21,45,46],{},"\u002F.well-known\u002Foauth-authorization-server",".",[37,49,50],{},"It registers itself dynamically - no client ID to copy by hand.",[37,52,53],{},"You are sent to your instance's sign-in page, then to a consent screen\nwhere you approve the connection.",[37,55,56,57,61],{},"The assistant receives a bearer token scoped to ",[58,59,60],"strong",{},"your active business",".\nEvery tool call runs as you, against that one business, and respects the\nsame permissions the web app enforces.",[14,63,64],{},"Because the token is scoped per business and the tools go through the same\nchecks as the UI, an assistant can never see or change data outside the\nbusiness you connected.",[26,66,68],{"id":67},"connect-an-assistant","Connect an assistant",[14,70,71,72,74],{},"Point your MCP client at the ",[21,73,23],{}," URL of your instance. In Claude, add\nit as a custom connector:",[76,77,83],"pre",{"className":78,"code":80,"language":81,"meta":82},[79],"language-text","https:\u002F\u002Fclerq.example.com\u002Fapi\u002Fmcp\n","text","",[21,84,80],{"__ignoreMap":82},[14,86,87],{},"Claude registers itself, walks you through sign-in and consent, and the tools\nbecome available. Other MCP clients take a URL the same way:",[76,89,93],{"className":90,"code":91,"language":92,"meta":82,"style":82},"language-json shiki shiki-themes github-dark","{\n  \"mcpServers\": {\n    \"clerq\": {\n      \"url\": \"https:\u002F\u002Fclerq.example.com\u002Fapi\u002Fmcp\"\n    }\n  }\n}\n","json",[21,94,95,104,114,122,135,141,147],{"__ignoreMap":82},[96,97,100],"span",{"class":98,"line":99},"line",1,[96,101,103],{"class":102},"s95oV","{\n",[96,105,107,111],{"class":98,"line":106},2,[96,108,110],{"class":109},"sDLfK","  \"mcpServers\"",[96,112,113],{"class":102},": {\n",[96,115,117,120],{"class":98,"line":116},3,[96,118,119],{"class":109},"    \"clerq\"",[96,121,113],{"class":102},[96,123,125,128,131],{"class":98,"line":124},4,[96,126,127],{"class":109},"      \"url\"",[96,129,130],{"class":102},": ",[96,132,134],{"class":133},"sU2Wk","\"https:\u002F\u002Fclerq.example.com\u002Fapi\u002Fmcp\"\n",[96,136,138],{"class":98,"line":137},5,[96,139,140],{"class":102},"    }\n",[96,142,144],{"class":98,"line":143},6,[96,145,146],{"class":102},"  }\n",[96,148,150],{"class":98,"line":149},7,[96,151,152],{"class":102},"}\n",[154,155,156],"blockquote",{},[14,157,158,159,162,163,166],{},"On a local instance the URL is ",[21,160,161],{},"http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fmcp",". If you set a\ncustom ",[21,164,165],{},"APP_PORT"," or run behind a proxy, use that public address instead.",[26,168,170],{"id":169},"the-tools","The tools",[14,172,173],{},"The 43 tools cover the back office end to end. A representative sample:",[175,176,177,200,220,240,263,280,294],"ul",{},[37,178,179,182,183,186,187,186,190,193,194,186,197],{},[58,180,181],{},"Clients"," - ",[21,184,185],{},"list_clients",", ",[21,188,189],{},"create_client",[21,191,192],{},"update_client",",\n",[21,195,196],{},"add_client_note",[21,198,199],{},"archive_client",[37,201,202,182,205,186,208,186,211,193,214,186,217],{},[58,203,204],{},"Projects and tasks",[21,206,207],{},"list_projects",[21,209,210],{},"create_project",[21,212,213],{},"list_tasks",[21,215,216],{},"create_task",[21,218,219],{},"set_task_status",[37,221,222,182,225,186,228,186,231,186,234,193,237],{},[58,223,224],{},"Time",[21,226,227],{},"start_timer",[21,229,230],{},"stop_timer",[21,232,233],{},"log_time",[21,235,236],{},"get_running_timer",[21,238,239],{},"list_task_time",[37,241,242,182,245,186,248,193,251,186,254,186,257,193,260],{},[58,243,244],{},"Invoicing",[21,246,247],{},"create_draft_invoice",[21,249,250],{},"generate_invoice_from_time",[21,252,253],{},"add_invoice_line",[21,255,256],{},"issue_invoice",[21,258,259],{},"mark_invoice_paid",[21,261,262],{},"get_invoice_pdf_link",[37,264,265,182,268,186,271,186,274,193,277],{},[58,266,267],{},"Expenses",[21,269,270],{},"list_expenses",[21,272,273],{},"create_expense",[21,275,276],{},"mark_expense_paid",[21,278,279],{},"delete_expense",[37,281,282,182,285,186,288,186,291],{},[58,283,284],{},"Team",[21,286,287],{},"list_team_members",[21,289,290],{},"invite_team_member",[21,292,293],{},"revoke_invitation",[37,295,296,182,299,302],{},[58,297,298],{},"Connectivity",[21,300,301],{},"whoami"," confirms which business the token is bound to",[14,304,305],{},"Money is always handled in minor units (cents), and dates as ISO 8601, so the\nassistant cannot fumble a rounding or timezone detail.",[26,307,309],{"id":308},"example","Example",[14,311,312,313,317,318,320,321,323],{},"Ask your assistant something like ",[314,315,316],"em",{},"\"Draft an invoice to Northwind for this\nmonth's unbilled time, one line per task\""," and it chains the right tools:\n",[21,319,247],{}," to open a draft, then ",[21,322,250],{}," to\nfill it from the unbilled, billable hours. It hands back a draft for you to\nreview - issuing it (which assigns the permanent number) stays a deliberate,\nseparate step.",[14,325,326,327,329],{},"You can also get a shareable PDF without a browser login:\n",[21,328,262],{}," returns a signed URL that is valid for 15 minutes.",[154,331,332],{},[14,333,334,335,338],{},"The assistant only ever holds a scoped bearer token for the business you\napproved. Revoke its access by rotating ",[21,336,337],{},"BETTER_AUTH_SECRET",", which\ninvalidates outstanding tokens and signed links.",[340,341,342],"style",{},"html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":82,"searchDepth":116,"depth":116,"links":344},[345,346,347,348],{"id":28,"depth":106,"text":29},{"id":67,"depth":106,"text":68},{"id":169,"depth":106,"text":170},{"id":308,"depth":106,"text":309},"Clerq ships an OAuth-secured Model Context Protocol server with 43 tools, so an AI assistant can run your back office with scoped, per-business access.","md",{},true,"\u002Fdocs\u002Fai\u002Fmcp-server","AI",{"title":5,"description":349},"docs\u002Fai\u002Fmcp-server","KrGkG6fBkL0oC22WW_7Gc1jKrIHs19fwKzVi9gdPrSA",{"stars":359,"repo":360},0,"PunterDigital\u002Fclerq",1781535397768]