Skip to content

Feature Request: list_logs tool for the MCP Server #340

@sburgos

Description

@sburgos

Summary

The Nightwatch MCP server currently exposes tools for managing issues (list_issues, get_issue, update_issue, add_issue_comment), along with application and environment metadata.

However, there is currently no way to query application logs through MCP, even though Nightwatch already captures structured logs generated through Laravel’s logging system.

Exposing logs via MCP would allow AI tools and developer assistants to access one of the most fundamental debugging primitives: application logs.


Current Limitation

While Nightwatch collects application logs generated through Laravel's logging system, those logs are currently only accessible through the Nightwatch dashboard.

The MCP server does not provide a way to query logs programmatically, which prevents AI assistants and developer tools from accessing this information during debugging workflows.


Why This Matters

The MCP server effectively turns Nightwatch into a structured observability interface for AI development tools.

For this interface to be complete, AI assistants should be able to access the same primitives developers rely on when debugging production systems:

  • Exceptions
  • Executions / requests
  • Application logs

Nightwatch MCP already exposes exceptions and application metadata, but without logs an AI assistant cannot reconstruct the full execution context of an issue or behavior.

Exposing logs would allow AI tools to perform more effective debugging, monitoring, and investigation directly from the development environment.


Example AI Workflows

Investigating a production error

User:

Why is the checkout endpoint returning 500 in production?

Possible AI workflow:

  1. list_issues
  2. get_issue
  3. query_logs for related messages

The AI can correlate exceptions with surrounding application logs.


Checking system health

User:

Show me error logs from the last 24 hours


Investigating application behavior

User:

Show logs containing "payment retry"


Debugging a scheduled task

User:

What happened during the last subscription renewal job?

The AI can inspect logs associated with the job execution.


Proposed Tool

Tool: query_logs

Parameters:

  • application_id (required): Application UUID
  • environment_id (optional): Filter by environment
  • level (optional): Filter by log level (debug, info, warning, error, critical)
  • message (optional): Text search within log messages
  • execution_id (optional): Filter logs associated with a specific request, job, command, or scheduled task execution
  • from (optional): Start datetime for the time range
  • to (optional): End datetime for the time range
  • limit (optional): Number of log entries to return (default: 50)

Expected Impact

Adding log querying to the Nightwatch MCP server would:

  • Enable complete AI-assisted debugging workflows
  • Remove the need to context-switch to the Nightwatch dashboard
  • Allow AI tools to correlate exceptions, executions, and logs
  • Improve production observability for AI-driven development environments

I'd be happy to help test this capability or provide feedback on the API design if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions