Sumo Logic MCP server

Integrates with the Sumo Logic API to perform log searches, enabling custom queries and analysis of log data for troubleshooting, monitoring, and generating insights from application logs.
Back to servers
Provider
Sam Wang
Release date
Feb 26, 2025
Language
TypeScript
Stats
2 stars

This MCP server integrates with Sumo Logic's API to perform log searches, allowing you to query your Sumo Logic logs with customizable time ranges. It provides a streamlined interface for retrieving log data through the Model Context Protocol.

Installation

Standard Setup

  1. Install dependencies:

    npm install
    
  2. Create a .env file with the required environment variables:

    ENDPOINT=https://api.au.sumologic.com/api/v1  # Sumo Logic API endpoint
    SUMO_API_ID=your_api_id                       # Sumo Logic API ID
    SUMO_API_KEY=your_api_key                     # Sumo Logic API Key
    
  3. Build the project:

    npm run build
    
  4. Start the server:

    npm start
    

Docker Setup

You can also run the MCP server using Docker:

  1. Build the Docker image:

    docker build -t mcp/sumologic .
    
  2. Run the container using one of these methods:

    Option A: Using environment variables directly:

    docker run -e ENDPOINT=your_endpoint -e SUMO_API_ID=your_api_id -e SUMO_API_KEY=your_api_key mcp/sumologic
    

    Option B: Using a .env file:

    docker run --env-file .env mcp/sumologic
    

Configuration

The server requires the following environment variables:

Usage

The server provides a search-sumologic tool that allows you to search Sumo Logic logs using custom queries.

Parameters

The search tool accepts the following parameters:

  • query (required): The Sumo Logic search query
  • from (optional): Start time in ISO 8601 format
  • to (optional): End time in ISO 8601 format

Example Query

Here's an example of how to use the search functionality:

const query = '_index=app_pro_fiat_cont | json auto | fields log_identifier';
const results = await search(sumoClient, query, {
  from: '2024-02-23T00:00:00Z',
  to: '2024-02-24T00:00:00Z',
});

Error Handling

The server includes comprehensive error handling:

  • API errors are caught and logged with details
  • Search job status is monitored throughout the process
  • Network and authentication issues are properly handled with informative error messages

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later