[{"data":1,"prerenderedAt":811},["ShallowReactive",2],{"docs:/docs/agents/mcp-setup":3},{"id":4,"title":5,"body":6,"description":803,"extension":804,"meta":805,"navigation":806,"path":807,"seo":808,"stem":809,"__hash__":810},"docs/docs/agents/mcp-setup.md","MCP Setup for AI Agents",{"type":7,"value":8,"toc":779},"minimark",[9,13,22,40,45,70,74,89,99,105,121,125,132,137,141,159,165,169,216,220,227,232,296,300,362,366,428,432,504,508,540,544,586,590,642,646,668,672,679,683,689,693,699,705,714,718,721,772],[10,11,5],"h1",{"id":12},"mcp-setup-for-ai-agents",[14,15,16,17,21],"p",{},"NoLag provides a ",[18,19,20],"strong",{},"Model Context Protocol (MCP)"," server that lets AI agents manage your real-time infrastructure directly. Connect Claude Desktop, Cursor, or any MCP-compatible client to create apps, rooms, actors, publish messages, and dispatch tasks - all through natural language.",[23,24,26],"callout",{"type":25},"info",[14,27,28,31,32,39],{},[18,29,30],{},"Prerequisites:"," You need a NoLag account with a project-level API key. Create one in the ",[33,34,38],"a",{"href":35,"rel":36},"https://portal.nolag.app",[37],"nofollow","Portal"," under Settings → API Keys.",[41,42,44],"h2",{"id":43},"quick-start","Quick Start",[46,47,48,56,64,67],"ol",{},[49,50,51,52],"li",{},"Create a project in the ",[33,53,55],{"href":35,"rel":54},[37],"NoLag Portal",[49,57,58,59,63],{},"Generate a project-level API key (format: ",[60,61,62],"code",{},"nl_live_yourKeyId.yourSecret",")",[49,65,66],{},"Add the NoLag MCP server to your AI client's configuration (see below)",[49,68,69],{},"Ask your AI agent to \"list my NoLag apps\" or \"create an agent actor\" to verify",[41,71,73],{"id":72},"claude-desktop-claude-code","Claude Desktop / Claude Code",[14,75,76,77,80,81,84,85,88],{},"Add this to your configuration file (",[60,78,79],{},"~/Library/Application Support/Claude/claude_desktop_config.json"," on macOS, ",[60,82,83],{},"%APPDATA%\\Claude\\claude_desktop_config.json"," on Windows for Claude Desktop, or ",[60,86,87],{},".mcp.json"," in your project root for Claude Code):",[90,91,97],"pre",{"className":92,"code":94,"language":95,"meta":96},[93],"language-text","{\n  \"mcpServers\": {\n    \"nolag\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"mcp-remote\",\n        \"https://api.nolag.app/mcp/sse?token=nl_live_yourKeyId.yourSecret\"\n      ]\n    }\n  }\n}\n","text","",[60,98,94],{"__ignoreMap":96},[14,100,101,102,104],{},"Replace ",[60,103,62],{}," with your actual API key.",[23,106,107],{"type":25},[14,108,109,112,113,116,117,120],{},[18,110,111],{},"Note:"," This uses ",[60,114,115],{},"mcp-remote"," to bridge the SSE transport to stdio. It will be installed automatically via ",[60,118,119],{},"npx"," on first run.",[41,122,124],{"id":123},"cursor","Cursor",[14,126,127,128,131],{},"Add this to your Cursor MCP configuration (",[60,129,130],{},".cursor/mcp.json","):",[90,133,135],{"className":134,"code":94,"language":95,"meta":96},[93],[60,136,94],{"__ignoreMap":96},[41,138,140],{"id":139},"custom-mcp-clients-http","Custom MCP Clients (HTTP)",[14,142,143,144,147,148,151,152,147,155,158],{},"NoLag supports both ",[18,145,146],{},"SSE transport"," (",[60,149,150],{},"GET /mcp/sse",") and ",[18,153,154],{},"plain HTTP",[60,156,157],{},"POST /mcp",") for MCP. Use SSE for streaming clients; use HTTP for simple request/response integrations.",[90,160,163],{"className":161,"code":162,"language":95,"meta":96},[93],"# Initialize session\ncurl -X POST https://api.nolag.app/mcp \\\n  -H \"Authorization: Bearer nl_live_yourKeyId.yourSecret\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"1\",\n    \"method\": \"initialize\",\n    \"params\": {}\n  }'\n\n# List available tools\ncurl -X POST https://api.nolag.app/mcp \\\n  -H \"Authorization: Bearer nl_live_yourKeyId.yourSecret\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"2\",\n    \"method\": \"tools/list\",\n    \"params\": {}\n  }'\n\n# Create an agent actor\ncurl -X POST https://api.nolag.app/mcp \\\n  -H \"Authorization: Bearer nl_live_yourKeyId.yourSecret\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"3\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"nolag_create_agent\",\n      \"arguments\": {\n        \"name\": \"my-first-agent\",\n        \"capabilities\": [\"drafting\", \"research\"]\n      }\n    }\n  }'\n",[60,164,162],{"__ignoreMap":96},[41,166,168],{"id":167},"transports","Transports",[170,171,172,188],"table",{},[173,174,175],"thead",{},[176,177,178,182,185],"tr",{},[179,180,181],"th",{},"Transport",[179,183,184],{},"Endpoint",[179,186,187],{},"Use Case",[189,190,191,204],"tbody",{},[176,192,193,197,201],{},[194,195,196],"td",{},"SSE via mcp-remote (recommended)",[194,198,199],{},[60,200,150],{},[194,202,203],{},"Claude Desktop, Claude Code, Cursor, and other MCP clients",[176,205,206,209,213],{},[194,207,208],{},"HTTP",[194,210,211],{},[60,212,157],{},[194,214,215],{},"Simple integrations, scripts, testing",[41,217,219],{"id":218},"available-tools","Available Tools",[14,221,222,223,226],{},"The NoLag MCP server exposes ",[18,224,225],{},"31 tools"," for managing your real-time infrastructure:",[228,229,231],"h3",{"id":230},"app-management","App Management",[170,233,234,244],{},[173,235,236],{},[176,237,238,241],{},[179,239,240],{},"Tool",[179,242,243],{},"Description",[189,245,246,256,266,276,286],{},[176,247,248,253],{},[194,249,250],{},[60,251,252],{},"nolag_list_apps",[194,254,255],{},"List all apps in your project",[176,257,258,263],{},[194,259,260],{},[60,261,262],{},"nolag_create_app",[194,264,265],{},"Create a new app (optionally from a blueprint)",[176,267,268,273],{},[194,269,270],{},[60,271,272],{},"nolag_get_app",[194,274,275],{},"Get details about a specific app",[176,277,278,283],{},[194,279,280],{},[60,281,282],{},"nolag_update_app",[194,284,285],{},"Update an app's name or description",[176,287,288,293],{},[194,289,290],{},[60,291,292],{},"nolag_delete_app",[194,294,295],{},"Soft-delete an app",[228,297,299],{"id":298},"room-management","Room Management",[170,301,302,310],{},[173,303,304],{},[176,305,306,308],{},[179,307,240],{},[179,309,243],{},[189,311,312,322,332,342,352],{},[176,313,314,319],{},[194,315,316],{},[60,317,318],{},"nolag_list_rooms",[194,320,321],{},"List all rooms in an app",[176,323,324,329],{},[194,325,326],{},[60,327,328],{},"nolag_create_room",[194,330,331],{},"Create a new dynamic room",[176,333,334,339],{},[194,335,336],{},[60,337,338],{},"nolag_get_room",[194,340,341],{},"Get room details",[176,343,344,349],{},[194,345,346],{},[60,347,348],{},"nolag_update_room",[194,350,351],{},"Update a room",[176,353,354,359],{},[194,355,356],{},[60,357,358],{},"nolag_delete_room",[194,360,361],{},"Delete a dynamic room",[228,363,365],{"id":364},"actor-management","Actor Management",[170,367,368,376],{},[173,369,370],{},[176,371,372,374],{},[179,373,240],{},[179,375,243],{},[189,377,378,388,398,408,418],{},[176,379,380,385],{},[194,381,382],{},[60,383,384],{},"nolag_list_actors",[194,386,387],{},"List all actors in your project",[176,389,390,395],{},[194,391,392],{},[60,393,394],{},"nolag_create_actor",[194,396,397],{},"Create a new actor (device, user, service, agent, etc.)",[176,399,400,405],{},[194,401,402],{},[60,403,404],{},"nolag_get_actor",[194,406,407],{},"Get actor details",[176,409,410,415],{},[194,411,412],{},[60,413,414],{},"nolag_update_actor",[194,416,417],{},"Update an actor",[176,419,420,425],{},[194,421,422],{},[60,423,424],{},"nolag_delete_actor",[194,426,427],{},"Delete an actor",[228,429,431],{"id":430},"agent-specific","Agent-Specific",[170,433,434,442],{},[173,435,436],{},[176,437,438,440],{},[179,439,240],{},[179,441,243],{},[189,443,444,454,464,474,484,494],{},[176,445,446,451],{},[194,447,448],{},[60,449,450],{},"nolag_create_agent",[194,452,453],{},"Create an AI agent actor with persistent sessions and capability tags",[176,455,456,461],{},[194,457,458],{},[60,459,460],{},"nolag_create_orchestrator",[194,462,463],{},"Create an orchestrator actor for coordinating agents",[176,465,466,471],{},[194,467,468],{},[60,469,470],{},"nolag_create_agents_app",[194,472,473],{},"Create an app from the Agents blueprint",[176,475,476,481],{},[194,477,478],{},[60,479,480],{},"nolag_dispatch_task",[194,482,483],{},"Publish a task envelope to a room's tasks topic",[176,485,486,491],{},[194,487,488],{},[60,489,490],{},"nolag_list_agent_events",[194,492,493],{},"Query the agent event stream with severity/category filters",[176,495,496,501],{},[194,497,498],{},[60,499,500],{},"nolag_get_blackboard_state",[194,502,503],{},"Read the current shared state for a room",[228,505,507],{"id":506},"messaging","Messaging",[170,509,510,518],{},[173,511,512],{},[176,513,514,516],{},[179,515,240],{},[179,517,243],{},[189,519,520,530],{},[176,521,522,527],{},[194,523,524],{},[60,525,526],{},"nolag_publish",[194,528,529],{},"Publish a message to a room/topic",[176,531,532,537],{},[194,533,534],{},[60,535,536],{},"nolag_get_messages",[194,538,539],{},"Get recent messages from a room/topic",[228,541,543],{"id":542},"scopes","Scopes",[170,545,546,554],{},[173,547,548],{},[176,549,550,552],{},[179,551,240],{},[179,553,243],{},[189,555,556,566,576],{},[176,557,558,563],{},[194,559,560],{},[60,561,562],{},"nolag_create_scope",[194,564,565],{},"Create an access scope for tenant isolation",[176,567,568,573],{},[194,569,570],{},[60,571,572],{},"nolag_list_scopes",[194,574,575],{},"List all access scopes in the project",[176,577,578,583],{},[194,579,580],{},[60,581,582],{},"nolag_set_actor_scope",[194,584,585],{},"Assign an actor to a scope or unscope them",[228,587,589],{"id":588},"webhooks","Webhooks",[170,591,592,600],{},[173,593,594],{},[176,595,596,598],{},[179,597,240],{},[179,599,243],{},[189,601,602,612,622,632],{},[176,603,604,609],{},[194,605,606],{},[60,607,608],{},"nolag_configure_webhooks",[194,610,611],{},"Configure hydration and trigger webhooks for an app",[176,613,614,619],{},[194,615,616],{},[60,617,618],{},"nolag_get_webhook_config",[194,620,621],{},"Get current webhook configuration",[176,623,624,629],{},[194,625,626],{},[60,627,628],{},"nolag_list_webhook_dlq",[194,630,631],{},"List failed webhook requests",[176,633,634,639],{},[194,635,636],{},[60,637,638],{},"nolag_retry_webhook_dlq",[194,640,641],{},"Retry a failed webhook",[228,643,645],{"id":644},"code-generation","Code Generation",[170,647,648,656],{},[173,649,650],{},[176,651,652,654],{},[179,653,240],{},[179,655,243],{},[189,657,658],{},[176,659,660,665],{},[194,661,662],{},[60,663,664],{},"nolag_generate_code",[194,666,667],{},"Generate SDK client code for a specific use case",[41,669,671],{"id":670},"authentication","Authentication",[14,673,674,675,678],{},"All MCP requests require a ",[18,676,677],{},"project-level API key",". Organization-level and system keys are not supported for MCP. There are two ways to authenticate:",[228,680,682],{"id":681},"option-1-authorization-header-recommended","Option 1: Authorization Header (recommended)",[90,684,687],{"className":685,"code":686,"language":95,"meta":96},[93],"Authorization: Bearer nl_live_yourKeyId.yourSecret\n",[60,688,686],{"__ignoreMap":96},[228,690,692],{"id":691},"option-2-query-parameter","Option 2: Query Parameter",[14,694,695,696,698],{},"For MCP clients that use ",[60,697,115],{}," or don't support custom headers, pass the token as a query parameter. This is the recommended approach for Claude Desktop, Claude Code, and Cursor:",[90,700,703],{"className":701,"code":702,"language":95,"meta":96},[93],"https://api.nolag.app/mcp/sse?token=nl_live_yourKeyId.yourSecret\n",[60,704,702],{"__ignoreMap":96},[23,706,708],{"type":707},"warning",[14,709,710,713],{},[18,711,712],{},"Security:"," Your API key grants full project access. Never expose it in client-side code or public repositories.",[41,715,717],{"id":716},"agent-workflow-example","Agent Workflow Example",[14,719,720],{},"Here's a typical workflow using MCP to set up a multi-agent system:",[46,722,723,732,740,748,756,764],{},[49,724,725,728,729,731],{},[18,726,727],{},"Create an agents app:"," ",[60,730,470],{}," with name \"my-workflow\"",[49,733,734,728,737,739],{},[18,735,736],{},"Create an orchestrator:",[60,738,460],{}," with name \"dispatcher\"",[49,741,742,728,745,747],{},[18,743,744],{},"Create worker agents:",[60,746,450],{}," with capabilities like \"drafting\", \"research\"",[49,749,750,728,753,755],{},[18,751,752],{},"Dispatch tasks:",[60,754,480],{}," to send work to connected agents",[49,757,758,728,761,763],{},[18,759,760],{},"Monitor:",[60,762,490],{}," to see what agents are doing",[49,765,766,728,769,771],{},[18,767,768],{},"Check state:",[60,770,500],{}," to see shared agent state",[14,773,774,775,778],{},"Each agent connects using the ",[60,776,777],{},"@nolag/agents"," SDK with its access token (returned by the create tools above). The MCP service manages infrastructure; agents use the SDK for real-time coordination.",{"title":96,"searchDepth":780,"depth":780,"links":781},2,[782,783,784,785,786,787,798,802],{"id":43,"depth":780,"text":44},{"id":72,"depth":780,"text":73},{"id":123,"depth":780,"text":124},{"id":139,"depth":780,"text":140},{"id":167,"depth":780,"text":168},{"id":218,"depth":780,"text":219,"children":788},[789,791,792,793,794,795,796,797],{"id":230,"depth":790,"text":231},3,{"id":298,"depth":790,"text":299},{"id":364,"depth":790,"text":365},{"id":430,"depth":790,"text":431},{"id":506,"depth":790,"text":507},{"id":542,"depth":790,"text":543},{"id":588,"depth":790,"text":589},{"id":644,"depth":790,"text":645},{"id":670,"depth":780,"text":671,"children":799},[800,801],{"id":681,"depth":790,"text":682},{"id":691,"depth":790,"text":692},{"id":716,"depth":780,"text":717},"How to connect Claude Desktop, Cursor, or any MCP client to NoLag for AI agent infrastructure management.","md",{},true,"/docs/agents/mcp-setup",{"title":5,"description":803},"docs/agents/mcp-setup","1u3peenQOr-Fbfu759xytJ1AMo9cmSdL1VVojqDkk6A",1788160342326]