Documentation forLoggly

Configure an AI Client to use the Loggly MCP server

Once you have your Loggly MCP server running, you can configure your AI client to connect to it. See for more information of setting up your server.

Create a separate folder for your AI tool configuration. Do not place the configuration folder inside the MCP server directory. Keeping the configuration separate helps reduce the risk of exposing credentials to the AI tool

Claude Code

You can configure Claude Code to provide the Loggly credentials, token, and subdomain through environment variables or through the MCP configuration.

Method 1: Use environment variables

This is the recommended method because the authentication token is not stored in the MCP configuration.

  1. Create a new folder for your Claude project.
  2. Copy the provided .mcp.json file into the folder.
  3. Set the following environment variables:

    export PRODUCT_DOMAIN=product export SERVER_TOKEN=YOUR_TOKEN

    Replace YOUR_TOKEN with your Loggly reading API token.

  4. Launch Claude Code.
  5. Run /mcp.
  6. Verify that the Loggly MCP server is shown as connected.
  7. Try one of the Sample prompts.

Method 2: Store the token in the MCP configuration

If Method 1 does not work, you can provide the token when adding the MCP server.

  1. Create a new folder for your Claude project.
  2. Set your server token:

    export SERVER_TOKEN=YOUR_TOKEN
  3. Add the MCP server:

    claude mcp add --transport http --scope project \ -H "X-Server-Token: ${SERVER_TOKEN}" -H "X-Product-Domain: product" -- log-mcp-staging-server http://mcp01-staging.loggly.net:8000/mcp
  4. Launch Claude Code.
  5. Run /mcp.
  6. Verify that the Loggly MCP server is shown as connected.
  7. Try one of the Sample prompts.

GitHub Copilot in VS Code

You can configure GitHub Copilot to prompt for your Loggly credentials or store the authentication token in the MCP configuration.

Method 1: Prompt for the authentication token

This method is recommended because the authentication token is not stored in the configuration file.

  1. Create a new folder.
  2. Create a .vscode folder inside it.
  3. Copy the provided mcp1.json file into the .vscode folder.
  4. Rename mcp1.json to mcp.json.
  5. Open the folder in VS Code.
  6. Start a GitHub Copilot Chat session.
  7. When prompted, enter your Loggly product domain and authentication token.
  8. Try one of the Sample prompts.

Method 2: Store the token in the configuration

If Method 1 does not work, you can provide the authentication token in mcp.json.

  1. Create a new folder.
  2. Create a .vscode folder inside it.
  3. Copy the provided mcp.json file into the .vscode folder.
  4. Replace YOUR_TOKEN with your Loggly reading API token.
  5. Enter the required authentication details.
  6. Open the folder in VS Code.
  7. Start a GitHub Copilot Chat session.
  8. Try one of the Sample prompts.

Cursor

  1. Create an mcp.json file in your .cursor folder.
  2. Set the following environment variables:

    SERVER_TOKEN=<your_loggly_reading_api_token> PRODUCT_DOMAIN
  3. Add the following configuration to mcp.json:

    { "mcpServers": { "loggly-mcp-server": { "type": "streamable-http", "url": "http://localhost:8000/mcp", "headers": { "X-Server-Token": "${env}", "X-Product-Domain": "${env}" } } } }
  4. Start Cursor and verify that the Loggly MCP server is available.
  5. Try one of the Sample prompts.

Replace http://localhost:8000/mcp with the URL of your MCP server if you are connecting to a remote deployment.

ChatGPT

The ChatGPT configuration steps may vary depending on your ChatGPT version, plan, and application.

Configure a custom MCP connector

  1. Open Settings in ChatGPT.
  2. Enable Developer Mode if required by your ChatGPT version.
  3. Open the section for Apps, Connectors, or MCP/developer applications.
  4. Create a new custom connector or app.
  5. Enter a name for the MCP server, such as loggly-mcp-server.
  6. Select Streamable HTTP.
  7. Enter the URL of your Loggly MCP server.
  8. If required, configure the following headers:

    • X-Server-Token — Your Loggly reading API token.
    • X-Product-Domain — Your Loggly product domain.
  9. Save the connector.
  10. Start a new chat and enable the Loggly connector.
  11. Try one of the Sample prompts.

The exact menus and labels may vary between ChatGPT versions and plans. Local stdio-based MCP servers are not supported by ChatGPT; use a remotely accessible MCP server.

Sample prompts

After successfully connecting your AI client, you can use natural-language prompts to query and analyze your Loggly logs.

Basic searches

  • Show me today's logs.
  • Show me recent errors.
  • Show me 10 latest warnings.
  • What fields are available?

Service and error investigation

  • Show me errors from auth service in the last 3 hours.
  • Are there any database connection errors in the last week?
  • What are Syslog errors from web-01.example.com?
  • What are the errors related to the com.example.PaymentService class?

Performance analysis

  • Which requests took more than 2 seconds in the last week?
  • Show me all logs from API Gateway for today.

Start with simple prompts to verify the connection, then use more specific queries to investigate your logs.