[{"data":1,"prerenderedAt":286},["ShallowReactive",2],{"selaras-docs-navigation":3,"selaras-docs:\u002Fguide\u002Fconnect-an-agent":82},[4,26,43,65],{"title":5,"order":6,"icon":7,"collapse":8,"navBadges":7,"path":9,"stem":10,"children":11,"page":8},"Guide",1,null,false,"\u002Fguide","guide",[12,16,21],{"title":13,"path":14,"stem":15,"order":6,"icon":7,"collapse":8,"navBadges":7},"Getting started","\u002Fguide\u002Fgetting-started","guide\u002Fgetting-started",{"title":17,"path":18,"stem":19,"order":20,"icon":7,"collapse":8,"navBadges":7},"Connect an agent","\u002Fguide\u002Fconnect-an-agent","guide\u002Fconnect-an-agent",2,{"title":22,"path":23,"stem":24,"order":25,"icon":7,"collapse":8,"navBadges":7},"Organize and share","\u002Fguide\u002Fworkspace","guide\u002Fworkspace",3,{"title":27,"order":20,"icon":7,"collapse":8,"navBadges":7,"path":28,"stem":29,"children":30,"page":8},"Authoring","\u002Fauthoring","authoring",[31,35,39],{"title":32,"path":33,"stem":34,"order":6,"icon":7,"collapse":8,"navBadges":7},"Overview","\u002Fauthoring\u002Foverview","authoring\u002Foverview",{"title":36,"path":37,"stem":38,"order":20,"icon":7,"collapse":8,"navBadges":7},"Markdown","\u002Fauthoring\u002Fmarkdown","authoring\u002Fmarkdown",{"title":40,"path":41,"stem":42,"order":25,"icon":7,"collapse":8,"navBadges":7},"HTML and bundles","\u002Fauthoring\u002Fhtml","authoring\u002Fhtml",{"title":44,"order":25,"icon":7,"collapse":8,"navBadges":7,"path":45,"stem":46,"children":47,"page":8},"Deploy","\u002Fdeploy","deploy",[48,52,56,60],{"title":49,"path":50,"stem":51,"order":6,"icon":7,"collapse":8,"navBadges":7},"Docker","\u002Fdeploy\u002Fdocker","deploy\u002Fdocker",{"title":53,"path":54,"stem":55,"order":20,"icon":7,"collapse":8,"navBadges":7},"Cloudflare Workers","\u002Fdeploy\u002Fcloudflare","deploy\u002Fcloudflare",{"title":57,"path":58,"stem":59,"order":25,"icon":7,"collapse":8,"navBadges":7},"Turso and Vercel","\u002Fdeploy\u002Fturso","deploy\u002Fturso",{"title":61,"path":62,"stem":63,"order":64,"icon":7,"collapse":8,"navBadges":7},"Backup and restore","\u002Fdeploy\u002Fbackup","deploy\u002Fbackup",4,{"title":66,"order":64,"icon":7,"collapse":8,"navBadges":7,"path":67,"stem":68,"children":69,"page":8},"Reference","\u002Freference","reference",[70,74,78],{"title":71,"path":72,"stem":73,"order":6,"icon":7,"collapse":8,"navBadges":7},"MCP","\u002Freference\u002Fmcp","reference\u002Fmcp",{"title":75,"path":76,"stem":77,"order":20,"icon":7,"collapse":8,"navBadges":7},"REST API","\u002Freference\u002Frest-api","reference\u002Frest-api",{"title":79,"path":80,"stem":81,"order":25,"icon":7,"collapse":8,"navBadges":7},"Configuration","\u002Freference\u002Fconfiguration","reference\u002Fconfiguration",{"id":83,"title":17,"aside":84,"body":85,"collapse":8,"description":281,"editLink":84,"extension":282,"icon":7,"issueLink":84,"meta":283,"navBadges":7,"navigation":7,"order":20,"path":18,"prevNext":84,"seo":284,"stem":19,"toc":84,"__hash__":285},"docs\u002Fguide\u002Fconnect-an-agent.md",true,{"type":86,"value":87,"toc":274},"minimark",[88,92,96,107,112,119,127,138,142,149,153,160,179,183,233,242,250,254,270],[89,90,17],"h1",{"id":91},"connect-an-agent",[93,94,95],"p",{},"Serangkai is its own OAuth 2.1 authorization server, so MCP clients can connect\nin three ways. All of them end at the same Streamable HTTP endpoint:",[97,98,104],"pre",{"className":99,"code":101,"language":102,"meta":103},[100],"language-text","https:\u002F\u002F\u003Cyour-host>\u002Fapi\u002Fmcp\n","text","",[105,106,101],"code",{"__ignoreMap":103},[108,109,111],"h2",{"id":110},"browser-oauth","Browser OAuth",[93,113,114,115,118],{},"Recommended for interactive clients. A client that supports OAuth discovers the\nauthorization server from the endpoint's ",[105,116,117],{},"401"," response, opens your browser to\na consent screen, and you approve the requested scopes. No secret is pasted\ninto the client.",[93,120,121,122,126],{},"Authorization codes use PKCE (S256), and every grant is bound to the MCP\nresource. Approved grants are listed in ",[123,124,125],"strong",{},"Settings",", where you can rename or\ndisconnect any of them.",[93,128,129,130,133,134,137],{},"Every install of an app registers under the same name, such as \"Codex\". To tell\ntwo of them apart, change ",[123,131,132],{},"Connection name"," on the consent screen, for\nexample to \"Codex – work laptop\". The setup prompt also asks the agent to name\nitself with ",[105,135,136],{},"set_connection_name",", which never replaces a name you chose.",[108,139,141],{"id":140},"device-authorization","Device authorization",[93,143,144,145,148],{},"For SSH sessions, containers, or CI, where no browser callback is possible. The\nclient requests a device code and prints a short user code. Open\n",[105,146,147],{},"https:\u002F\u002F\u003Cyour-host>\u002Foauth\u002Fdevice",", sign in, enter the code, and approve. The\nclient polls until the grant is issued.",[108,150,152],{"id":151},"manual-api-token","Manual API token",[93,154,155,156,159],{},"Create a scoped token in ",[123,157,158],{},"Settings → API tokens"," and pass it as a bearer\nheader. For example, with Claude Code:",[97,161,165],{"className":162,"code":163,"language":164,"meta":103,"style":103},"language-sh shiki shiki-themes github-light github-dark","claude mcp add --transport http serangkai http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fmcp \\\n  --header \"Authorization: Bearer $SERANGKAI_API_TOKEN\" --scope user\n","sh",[105,166,167,174],{"__ignoreMap":103},[168,169,171],"span",{"class":170,"line":6},"line",[168,172,173],{},"claude mcp add --transport http serangkai http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fmcp \\\n",[168,175,176],{"class":170,"line":20},[168,177,178],{},"  --header \"Authorization: Bearer $SERANGKAI_API_TOKEN\" --scope user\n",[108,180,182],{"id":181},"scopes","Scopes",[184,185,186,199],"table",{},[187,188,189],"thead",{},[190,191,192,196],"tr",{},[193,194,195],"th",{},"Scope",[193,197,198],{},"Allows",[200,201,202,213,223],"tbody",{},[190,203,204,210],{},[205,206,207],"td",{},[105,208,209],{},"read",[205,211,212],{},"Discovery, listing, searching, and reading rangka and folders",[190,214,215,220],{},[205,216,217],{},[105,218,219],{},"write",[205,221,222],{},"Creating and updating rangka and folders",[190,224,225,230],{},[205,226,227],{},[105,228,229],{},"full",[205,231,232],{},"Everything, including managing other tokens. Only a manually minted token can hold it.",[93,234,235,236,238,239,241],{},"OAuth grants are capped at ",[105,237,209],{}," and ",[105,240,219],{},". Tokens are hashed at rest and\nrevocable at any time, and a read-only token can never mint share links.",[243,244,247],"s-callout",{"title":245,"type":246},"Sessions and tokens stay separate","note",[93,248,249],{},"A browser session never authorizes MCP, and a request that carries a bearer\ntoken never falls back to a session.",[108,251,253],{"id":252},"what-the-agent-sees","What the agent sees",[93,255,256,257,260,261,264,265,269],{},"Once connected, an agent should start with ",[105,258,259],{},"get_rangka_capabilities"," and the\n",[105,262,263],{},"serangkai:\u002F\u002Fguides\u002F*"," resources. They describe every supported format and\ncomponent, so the agent does not need access to this site or the repository.\nSee the ",[266,267,268],"a",{"href":72},"MCP reference"," for the full tool list.",[271,272,273],"style",{},"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);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":103,"searchDepth":25,"depth":25,"links":275},[276,277,278,279,280],{"id":110,"depth":20,"text":111},{"id":140,"depth":20,"text":141},{"id":151,"depth":20,"text":152},{"id":181,"depth":20,"text":182},{"id":252,"depth":20,"text":253},"Connect an MCP client with browser OAuth, device authorization, or a scoped API token.","md",{},{"title":17,"description":281},"IgfL49jwAVitxZEdMroU0WTC-eOhUyLMPpGXnc1zISc",1795580564389]