MCP Setup for AI Agents
NoLag provides a 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.
Quick Start
- Create a project in the NoLag Portal
- Generate a project-level API key (format:
nl_live_yourKeyId.yourSecret) - Add the NoLag MCP server to your AI client's configuration (see below)
- Ask your AI agent to "list my NoLag apps" or "create an agent actor" to verify
Claude Desktop
Add this to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"nolag": {
"url": "https://api.nolag.app/mcp/sse",
"headers": {
"Authorization": "Bearer nl_live_yourKeyId.yourSecret"
}
}
}
}Replace nl_live_yourKeyId.yourSecret with your actual API key.
Cursor
Add this to your Cursor MCP configuration:
{
"mcpServers": {
"nolag": {
"url": "https://api.nolag.app/mcp/sse",
"headers": {
"Authorization": "Bearer nl_live_yourKeyId.yourSecret"
}
}
}
}Custom MCP Clients (HTTP)
NoLag supports both SSE transport (GET /mcp/sse) and plain HTTP (POST /mcp) for MCP. Use SSE for streaming clients; use HTTP for simple request/response integrations.
# Initialize session
curl -X POST https://api.nolag.app/mcp \
-H "Authorization: Bearer nl_live_yourKeyId.yourSecret" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "1",
"method": "initialize",
"params": {}
}'
# List available tools
curl -X POST https://api.nolag.app/mcp \
-H "Authorization: Bearer nl_live_yourKeyId.yourSecret" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "2",
"method": "tools/list",
"params": {}
}'
# Create an agent actor
curl -X POST https://api.nolag.app/mcp \
-H "Authorization: Bearer nl_live_yourKeyId.yourSecret" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "3",
"method": "tools/call",
"params": {
"name": "nolag_create_agent",
"arguments": {
"name": "my-first-agent",
"capabilities": ["drafting", "research"]
}
}
}'Transports
| Transport | Endpoint | Use Case |
|---|---|---|
| SSE (recommended) | GET /mcp/sse | Claude Desktop, Cursor, streaming MCP clients |
| HTTP | POST /mcp | Simple integrations, scripts, testing |
Available Tools
The NoLag MCP server exposes 28 tools for managing your real-time infrastructure:
App Management
| Tool | Description |
|---|---|
nolag_list_apps | List all apps in your project |
nolag_create_app | Create a new app (optionally from a blueprint) |
nolag_get_app | Get details about a specific app |
nolag_update_app | Update an app's name or description |
nolag_delete_app | Soft-delete an app |
Room Management
| Tool | Description |
|---|---|
nolag_list_rooms | List all rooms in an app |
nolag_create_room | Create a new dynamic room |
nolag_get_room | Get room details |
nolag_update_room | Update a room |
nolag_delete_room | Delete a dynamic room |
Actor Management
| Tool | Description |
|---|---|
nolag_list_actors | List all actors in your project |
nolag_create_actor | Create a new actor (device, user, service, agent, etc.) |
nolag_get_actor | Get actor details |
nolag_update_actor | Update an actor |
nolag_delete_actor | Delete an actor |
Agent-Specific
| Tool | Description |
|---|---|
nolag_create_agent | Create an AI agent actor with persistent sessions and capability tags |
nolag_create_orchestrator | Create an orchestrator actor for coordinating agents |
nolag_create_agents_app | Create an app from the Agents blueprint |
nolag_dispatch_task | Publish a task envelope to a room's tasks topic |
nolag_list_agent_events | Query the agent event stream with severity/category filters |
nolag_get_blackboard_state | Read the current shared state for a room |
Messaging
| Tool | Description |
|---|---|
nolag_publish | Publish a message to a room/topic |
nolag_get_messages | Get recent messages from a room/topic |
Webhooks
| Tool | Description |
|---|---|
nolag_configure_webhooks | Configure hydration and trigger webhooks for an app |
nolag_get_webhook_config | Get current webhook configuration |
nolag_list_webhook_dlq | List failed webhook requests |
nolag_retry_webhook_dlq | Retry a failed webhook |
Code Generation
| Tool | Description |
|---|---|
nolag_generate_code | Generate SDK client code for a specific use case |
Authentication
All MCP requests require a project-level API key in the Authorization header. Organization-level and system keys are not supported for MCP.
Authorization: Bearer nl_live_yourKeyId.yourSecretAgent Workflow Example
Here's a typical workflow using MCP to set up a multi-agent system:
- Create an agents app:
nolag_create_agents_appwith name "my-workflow" - Create an orchestrator:
nolag_create_orchestratorwith name "dispatcher" - Create worker agents:
nolag_create_agentwith capabilities like "drafting", "research" - Dispatch tasks:
nolag_dispatch_taskto send work to connected agents - Monitor:
nolag_list_agent_eventsto see what agents are doing - Check state:
nolag_get_blackboard_stateto see shared agent state
Each agent connects using the @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.