MCP for LLMs

Enable AI assistants to manage NoLag infrastructure using the Model Context Protocol (MCP) over HTTP.

What is MCP?

The Model Context Protocol (MCP) is a standard that allows AI assistants to interact with external tools and APIs. NoLag exposes an MCP-compatible HTTP endpoint at POST /mcp on the NoLag API. There is no separate package to install -- just point your AI assistant at the endpoint with your project API key.

How It Works

The NoLag MCP endpoint speaks JSON-RPC 2.0 over HTTP. AI assistants like Claude send requests to https://api.nolag.app/v1/mcp authenticated with a project-level API key as a Bearer token. The endpoint supports three MCP methods:

  • initialize -- Returns server info and capabilities
  • tools/list -- Returns the list of available tools
  • tools/call -- Executes a tool and returns the result

Why MCP for NoLag?

With NoLag MCP, AI assistants can help developers manage real-time infrastructure by directly interacting with the NoLag platform:

  • Manage apps -- Create, update, list, and delete apps in your project
  • Manage rooms -- Create and configure dynamic rooms within apps
  • Manage actors -- Create actor tokens for devices, users, and servers
  • Inspect messages -- Read recent message history from rooms
  • Configure webhooks -- Set up hydration and trigger webhooks
  • Debug webhook failures -- Inspect the webhook Dead Letter Queue
  • Generate code -- Produce SDK client code for various languages and frameworks

Quick Start

1. Get a Project API Key

In the NoLag Portal, navigate to your project settings and create an API key. The MCP endpoint requires a project-level key (not organization-level).

2. Configure Your AI Assistant

Add the NoLag MCP server to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "nolag": {
      "type": "streamable-http",
      "url": "https://api.nolag.app/v1/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_PROJECT_API_KEY"
      }
    }
  }
}

For Claude Code (CLI), add it to your project settings:

{
  "mcpServers": {
    "nolag": {
      "type": "streamable-http",
      "url": "https://api.nolag.app/v1/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_PROJECT_API_KEY"
      }
    }
  }
}

3. Test the Connection

You can verify the endpoint is reachable with a simple curl request:

curl -X POST https://api.nolag.app/v1/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_PROJECT_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "initialize",
    "params": {}
  }'

4. Start Building

Ask your AI assistant to help you manage your NoLag infrastructure:

"List all apps in my NoLag project, then create a new app called 'chat-service' with a room for general discussion. Create a 'device' actor token so I can connect from my frontend."

The AI assistant will use NoLag MCP tools to list apps, create the app, create a room, and generate an actor token.

Available Tools

NoLag MCP provides these tools for AI assistants:

CategoryTools
App Managementnolag_list_apps, nolag_create_app, nolag_get_app, nolag_update_app, nolag_delete_app
Room Managementnolag_list_rooms, nolag_create_room, nolag_get_room, nolag_update_room, nolag_delete_room
Actor Managementnolag_list_actors, nolag_create_actor, nolag_get_actor, nolag_update_actor, nolag_delete_actor
Messagingnolag_get_messages
Webhooksnolag_configure_webhooks, nolag_get_webhook_config, nolag_list_webhook_dlq
Code Generationnolag_generate_code

Note: The nolag_publish and nolag_retry_webhook_dlq tools are defined in the tool list but do not have backend handlers yet. Calling them will return an "Unknown tool" error.

Authentication

All MCP requests require a project-level API key passed as a Bearer token in the Authorization header. The API key determines which project the tools operate on -- you do not need to pass a project ID to any tool.

  • Project-level keys only -- Organization-level and system keys are rejected
  • Scoped to project -- Tools automatically operate within the project associated with the API key

Next Steps