Axiom MCP server

Integrates with Axiom for executing APL queries and listing datasets, enabling log analysis, anomaly detection, and data-driven decision making.
Back to servers
Provider
Max Jikharev
Release date
Jan 25, 2025
Language
TypeScript
Package
Stats
1.1K downloads
1 star

This MCP Server for Axiom is a JavaScript port of the official Axiom MCP server that helps AI agents query data using Axiom Processing Language (APL). It's packaged as an npm module for easy integration with Node.js environments.

Installation

Using npx (Recommended)

You can run the MCP server directly using npx by adding the following configuration to your MCP configuration file:

{
  "axiom": {
    "command": "npx",
    "args": ["-y", "mcp-server-axiom"],
    "env": {
      "AXIOM_TOKEN": "<AXIOM_TOKEN_HERE>",
      "AXIOM_URL": "https://api.axiom.co",
      "AXIOM_ORG_ID": "<AXIOM_ORG_ID_HERE>"
    }
  }
}

Global Installation

You can also install the package globally:

npm install -g mcp-server-axiom

Configuration

Environment Variables

The server can be configured using these environment variables:

  • AXIOM_TOKEN (required): Your Axiom API token
  • AXIOM_ORG_ID (required): Your Axiom organization ID
  • AXIOM_URL (optional): Custom Axiom API URL (defaults to https://api.axiom.co)
  • AXIOM_QUERY_RATE (optional): Queries per second limit (default: 1)
  • AXIOM_QUERY_BURST (optional): Query burst capacity (default: 1)
  • AXIOM_DATASETS_RATE (optional): Dataset list operations per second (default: 1)
  • AXIOM_DATASETS_BURST (optional): Dataset list burst capacity (default: 1)
  • PORT (optional): Server port (default: 3000)

Running the Server

Using Environment Variables

export AXIOM_TOKEN=your_token
export AXIOM_ORG_ID=your_org_id
mcp-server-axiom

Using a Configuration File

Create a config.json file:

{
  "token": "your_token",
  "url": "https://custom.axiom.co",
  "orgId": "your_org_id",
  "queryRate": 2,
  "queryBurst": 5,
  "datasetsRate": 1,
  "datasetsBurst": 2
}

Then run:

mcp-server-axiom config.json

Available API Endpoints

The server exposes the following endpoints:

  • GET /: Server implementation information
  • GET /tools: List of available tools
  • POST /tools/:name/call: Execute a specific tool

Available Tools

The server provides two main tools:

  • queryApl: Execute APL queries against your Axiom data
  • listDatasets: Retrieve the list of available datasets

Usage Examples

Querying Data with APL

You can execute APL queries using the queryApl tool:

curl -X POST http://localhost:3000/tools/queryApl/call \
  -H "Content-Type: application/json" \
  -d '{
    "arguments": {
      "query": "['logs'] | where ['severity'] == \"error\" | limit 10"
    }
  }'

Listing Available Datasets

To retrieve all available datasets:

curl -X POST http://localhost:3000/tools/listDatasets/call \
  -H "Content-Type: application/json" \
  -d '{
    "arguments": {}
  }'

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