MCP for LLMs

Enable AI assistants to build real-time applications with NoLag using the Model Context Protocol (MCP).

What is MCP?

The Model Context Protocol (MCP) is a standard that allows AI assistants to interact with external tools and APIs. NoLag's MCP server gives LLMs the ability to create, manage, and interact with real-time messaging infrastructure.

Why MCP for NoLag?

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

  • Create projects and apps - Set up NoLag infrastructure conversationally
  • Configure topics - Define messaging channels and access control
  • Generate code - Create client code with proper SDK usage
  • Debug issues - Inspect messages, connections, and errors
  • Monitor activity - View real-time metrics and status

Quick Start

1. Install the MCP Server

# Install globally
npm install -g @nolag/mcp-server

# Or use npx
npx @nolag/mcp-server

2. Configure Your AI Assistant

Add the NoLag MCP server to your AI assistant's configuration:

{
  "mcpServers": {
    "nolag": {
      "command": "npx",
      "args": ["@nolag/mcp-server"],
      "env": {
        "NOLAG_API_KEY": "your-api-key"
      }
    }
  }
}

3. Start Building

Ask your AI assistant to help you build real-time features:

"Create a new NoLag project for a chat application with rooms for general discussion and support. Set up the topics and generate the client code."

The AI assistant will use NoLag MCP tools to create the project, configure topics, and generate working code.

Available Tools

NoLag MCP provides these tools for AI assistants:

ToolDescription
nolag_create_projectCreate a new NoLag project
nolag_create_appCreate an app within a project
nolag_create_topicDefine a new topic with ACL
nolag_list_topicsList all topics in an app
nolag_publishPublish a message to a topic
nolag_subscribeSubscribe and read messages
nolag_get_presenceGet online users for a topic
nolag_generate_codeGenerate SDK client code
nolag_get_metricsView connection and message stats

Example Prompts

Here are example prompts you can use with your AI assistant:

Creating Infrastructure

"Set up a NoLag project for my e-commerce site. I need topics for order updates, inventory changes, and customer notifications."

Generating Code

"Generate TypeScript code to subscribe to my order-updates topic and display notifications in a React component."

Debugging

"Check if there are any active connections to my chat-room topic and show me the recent messages."

Monitoring

"Show me the message throughput and connection count for my production app over the last hour."

Security

NoLag MCP follows security best practices:

  • API Key Scoping - Use project-specific keys with minimal permissions
  • Read-Only Mode - Configure MCP for read-only access when appropriate
  • Audit Logging - All MCP actions are logged for review
  • Rate Limiting - Prevents abuse and runaway operations

Next Steps