Foglight MCP Server

The Foglight MCP Server enables integration between Foglight and AI-powered development tools through the Model Context Protocol (MCP). This allows developers and administrators to interact with Foglight monitoring data directly from VS Code using GitHub Copilot or other MCP-compatible clients.

This section covers the following key areas:

Overview

This section explains what MCP (Model Context Protocol) is and what the Foglight MCP Server provides. It is written for readers who are already familiar with Foglight concepts (FMS, agents, alarms, PI/Performance Investigation, Top SQL), but are new to MCP.

What is MCP?

MCP (Model Context Protocol) is an open protocol that lets an AI client (for example, an assistant built into an IDE or chat tool) call tools exposed by a server.

In practice, MCP provides:

  • A standard way for an AI client to discover what tools are available
  • A standard way to call those tools with parameters
  • A standard way to return results back to the AI client (usually as structured JSON)

Think of MCP as a “connector” layer between an AI assistant and operational systems like Foglight.

Why Use MCP with Foglight?

Foglight already contains rich monitoring and performance data. MCP makes that data easier to use in interactive workflows where you want to:

  • Ask questions in natural language (for example: “What are the top SQL statements by impact?”)
  • Retrieve supporting evidence quickly (alarms, Top SQL, PI breakdown)
  • Drill down iteratively without manually switching between many screens

MCP does not replace the Foglight UI. It provides a programmatic interface that AI clients can use to help you navigate Foglight data faster.

What Does the Foglight MCP Server Provide?

The Foglight MCP Server is an MCP server that exposes Foglight data through a set of tools.

Typical capability areas include:

CapabilityDescription
AlarmsGet current and historical alarms, and summary statistics
Agents and infrastructureList monitored agents and agent managers
Database Performance Investigation (PI)Instance list, highlights, resource breakdown, top queries
TopSQL (cross-database)Top statements across domains ranked by impact and other metrics
Topology / GraphQLExecute GraphQL queries for advanced topology/metric access

Exact tool names and parameters depend on the server build and deployment configuration, but the usage pattern is consistent.

Tool Categories

Alarms

Use these when you want to answer “What is wrong right now?” or “What happened last week?”

Examples of questions you can ask:

  • “Show me current critical alarms.”
  • “Do we have any active alarms for this target?”
  • “What are the longest-running alarms right now?”
  • “Show alarms created in the last hour.”
  • “Give me an alarm summary grouped by agent.”

Agents and Agent Managers (FglAM)

Use these when you want to understand what Foglight is monitoring and whether collection infrastructure looks healthy.

Examples of questions you can ask:

  • “List monitored agents (active vs inactive).”
  • “Show agents for domain MSSQL (or POSTGRES, ORACLE).”
  • “Which agent managers are disconnected?”
  • “How many agents are connected to each agent manager?”
  • “Is this agent active?”

Performance Investigation (PI)

Use these when you want to diagnose database performance.

Examples of questions you can ask:

  • “Show PI highlights for this database instance.”
  • “Where is this database instance spending time (CPU vs Lock vs I/O)?”
  • “Show top SQL by I/O on this database instance.”
  • “Show top SQL by Lock on this database instance.”
  • “Show blocking history for this database instance.”
  • “Show top users or top databases by workload on this database instance.”

TopSQL (Cross-Database)

Use this when you want the most impactful statements across all monitored databases.

Examples of questions you can ask:

  • “Show top SQL across all databases by impact.”
  • “Show top SQL for domain MSSQL.”
  • “Show top SQL for this target.”
  • “Get full SQL text for the top statement (if available).”

Topology / GraphQL

Use GraphQL when you need access to Foglight topology properties/metrics not covered by the higher-level tools.

GraphQL queries require correct Foglight topology field names. Many deployments use a workflow like: search schema for the right fields, generate a GraphQL query, then execute the query.

Examples of questions you can ask:

  • “Show CPU utilization for this host.”
  • “Show DBSS wait statistics for this database instance.”
  • “Find the topology property/metric name for ‘cpu’ in the SQL Server domain.”

Before You Start

Authentication

  • Foglight MCP Server tools are intended for read-only retrieval of monitoring and performance data.
  • Authentication is based on OAuth2. You need to authenticate to Foglight Cloud to get access.
  • The server should be accessed according to your organization’s security policies.

Prerequisites

Before you start, ensure you have the following:

RequirementDescription
Visual Studio CodeInstall Visual Studio Code
Foglight MCP endpointAccess to your Foglight MCP endpoint: https://<FOGLIGHT_MCP_ENDPOINT>/mcp
Foglight Cloud accountA Foglight Cloud account with permission to access Foglight Server

Adding the MCP Server to VS Code

To add the MCP server to VS Code:

  1. In your workspace, create or open the file .vscode/mcp.json.
  2. Add a server entry that points to your Foglight MCP endpoint:
{
  "servers": {
    "foglight-mcp-sso": {
      "type": "http",
      "url": "https://<FOGLIGHT_MCP_ENDPOINT>/mcp"
    }
  }
}

Do not add any extra credential prompts unless instructed for your environment. Keep the URL exactly as provided for your environment.

Signing In

When you use a Foglight MCP tool for the first time, VS Code opens an interactive sign-in flow automatically.

To sign in:

  1. In VS Code, try a Foglight MCP tool call (for example, “show current alarms”).
  2. If you are prompted to sign in, complete the browser sign-in.
  3. If prompted to provide a client ID, enter foglight-mcp.
  4. If asked to provide an OAuth client secret, leave blank.
  5. Run the tool call again after sign-in completes.

Validating the Connection

To validate that the MCP server is working correctly, try one of these simple read-only checks in your AI client:

  • “Show current alarms”
  • “List monitored agents”
  • “Show top SQL across all databases by impact”

If SSO is working, you should receive results after signing in.

Troubleshooting

This section provides solutions for common issues when connecting to the Foglight MCP Server.

401 Unauthorized Error

Cause

This error typically occurs when:

  • You are not signed in via SSO for this endpoint
  • Your account is not authorized for Foglight MCP
  • The endpoint URL is incorrect (missing /mcp or wrong host)

Resolution

  1. Open https://<FOGLIGHT_MCP_ENDPOINT>/mcp in a browser and confirm you can sign in.
  2. If the browser sign-in works but VS Code still fails, contact your support channel for Foglight MCP access.

403 Forbidden Error

Cause

Your user or group is not allowed to access Foglight MCP.

Resolution

Request access to the Foglight MCP application/role in your IdP.

Tools Return Empty Results

Cause

This issue typically occurs when:

  • There is no data for the requested timeframe
  • The requested domain/instance is not being monitored or PI is not enabled

Resolution

  1. Try a broader query (for example, “top SQL across all domains”).
  2. Confirm the target is monitored in Foglight.

Current Limitations

The following capabilities are not currently supported by the MCP Server:

  • Ability to retrieve details from ad-hoc queries run by Foglight (such as show current sessions)
  • PI (Performance Investigator) information for:
    • Oracle databases
    • MySQL databases
    • SQL Server Analysis Services (SSAS) domains

These limitations may be addressed in future releases.

Frequently Asked Questions

Does MCP mean Foglight data is sent to a public AI service?

Not necessarily. MCP describes how an AI client calls tools. Where the AI model runs and what data is shared depends on your deployment and the client configuration.

Should I use GraphQL for everything?

Usually no. Prefer the higher-level tools (Alarms, PI, TopSQL) for common operations. Use GraphQL for advanced/custom data retrieval.

What if a tool returns an ID or compressed SQL text?

That is expected in some workflows. Use the returned IDs to call the next tool in the chain. Use the decompress tool when a response provides compressed/encoded SQL text.