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.
- Create a new folder for your Claude project.
- Copy the provided
.mcp.jsonfile into the folder. -
Set the following environment variables:
export PRODUCT_DOMAIN=product export SERVER_TOKEN=YOUR_TOKENReplace
YOUR_TOKENwith your Loggly reading API token. - Launch Claude Code.
- Run
/mcp. - Verify that the Loggly MCP server is shown as connected.
- 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.
- Create a new folder for your Claude project.
-
Set your server token:
export SERVER_TOKEN=YOUR_TOKEN -
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 - Launch Claude Code.
- Run
/mcp. - Verify that the Loggly MCP server is shown as connected.
- 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.
- Create a new folder.
- Create a
.vscodefolder inside it. - Copy the provided
mcp1.jsonfile into the.vscodefolder. - Rename
mcp1.jsontomcp.json. - Open the folder in VS Code.
- Start a GitHub Copilot Chat session.
- When prompted, enter your Loggly product domain and authentication token.
- 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.
- Create a new folder.
- Create a
.vscodefolder inside it. - Copy the provided
mcp.jsonfile into the.vscodefolder. - Replace
YOUR_TOKENwith your Loggly reading API token. - Enter the required authentication details.
- Open the folder in VS Code.
- Start a GitHub Copilot Chat session.
- Try one of the Sample prompts.
Cursor
- Create an
mcp.jsonfile in your.cursorfolder. -
Set the following environment variables:
SERVER_TOKEN=<your_loggly_reading_api_token> PRODUCT_DOMAIN -
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}" } } } } - Start Cursor and verify that the Loggly MCP server is available.
- 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
- Open Settings in ChatGPT.
- Enable Developer Mode if required by your ChatGPT version.
- Open the section for Apps, Connectors, or MCP/developer applications.
- Create a new custom connector or app.
- Enter a name for the MCP server, such as
loggly-mcp-server. - Select Streamable HTTP.
- Enter the URL of your Loggly MCP server.
-
If required, configure the following headers:
X-Server-Token— Your Loggly reading API token.X-Product-Domain— Your Loggly product domain.
- Save the connector.
- Start a new chat and enable the Loggly connector.
- 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.PaymentServiceclass?
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.