Sponsored by Deepsite.site

Laravel Telescope MCP

Created By
lucianotonet8 months ago
Content

Latest Version on Packagist Downloads License

Laravel Telescope MCP

An extension for Laravel Telescope that exposes telemetry data via the Model Context Protocol (MCP) to AI assistants (e.g., Cursor, Claude, Copilot Chat). Ideal for developers who use Telescope to inspect application metrics and require quick, precise insights.

Overview

Telescope MCP translates natural-language queries into MCP operations, retrieves Telescope records, and returns concise responses. This enables developers to query logs, slow queries, HTTP requests, exceptions, jobs, and more using an AI interface.

Installation

Make sure you have Laravel Telescope properly installed and configured in your application before proceeding

  1. Add the package via Composer:

    composer require lucianotonet/laravel-telescope-mcp
    
  2. Publish the configuration (optional):

    php artisan vendor:publish --provider="LucianoTonet\TelescopeMcp\TelescopeMcpServiceProvider"
    
  3. Update your .env (optional):

    TELESCOPE_MCP_ENABLED=true
    TELESCOPE_MCP_PATH=telescope-mcp
    

    You can now verify the installation by accessing http://localhost:8000/telescope-mcp/manifest.json in your browser

Connecting an AI Client

For Cursor (example):

  1. Open Cursor command palette (Cmd/Ctrl+Shift+P).

  2. Run View: Open MCP Settings.

  3. Add this configuration:

    {
      "mcpServers": {
        "Laravel Telescope MCP": {
          "command": "npx",
          "args": [
            "-y", 
            "mcp-remote", 
            "http://localhost:8000/telescope-mcp",
            "--allow-http"
          ],
          "env": { "NODE_TLS_REJECT_UNAUTHORIZED": "0" }
        }
      }
    }
    

    Make sure the URL matches your .env configuration, combining APP_URL with TELESCOPE_MCP_PATH

  4. For HTTPS, you can omit --allow-http and NODE_TLS_REJECT_UNAUTHORIZED like this:

    {
      "mcpServers": {
        "Laravel Telescope MCP": {
          "command": "npx",
          "args": [
            "-y", 
            "mcp-remote", 
            "https://example.com/telescope-mcp"            
          ]
        }
      }
    }
    

Usage Examples

  • "Using your MCP tools, fetch the last 5 error logs."
  • "Identify SQL queries longer than 100ms in the past twenty minutes."
  • "Show all last failed jobs."
  • "Summarize HTTP requests with status >=500 since last hour."

The AI will parse the query, call the MCP endpoint, analyze results, and return a summary.

Available Tools

ToolDescriptionParameters
BatchesLists and analyzes batch operationsid, limit, status (pending/processing/finished/failed), name
CacheMonitors cache operationsid, limit, operation (hit/miss/set/forget), key
CommandsTracks Artisan command executionsid, limit, command, status (success/error)
DumpsRecords var_dump and dd() callsid, limit, file, line
EventsMonitors event dispatchesid, limit, name
ExceptionsTracks application errorsid, limit
GatesRecords authorization checksid, limit, ability, result (allowed/denied)
HTTP ClientMonitors outgoing HTTP requestsid, limit, method, status, url
JobsTracks queued job executionsid, limit, status (pending/processed/failed), queue
LogsRecords application logsid, limit, level, message
MailMonitors email operationsid, limit, to, subject
ModelsTracks Eloquent model operationsid, limit, action (created/updated/deleted), model
NotificationsRecords notification dispatchesid, limit, channel, status (sent/failed)
QueriesMonitors database queriesid, limit, slow (boolean)
RedisTracks Redis operationsid, limit, command
RequestsRecords incoming HTTP requestsid, limit, method, status, path
ScheduleMonitors scheduled task executionsid, limit
ViewsRecords view rendersid, limit
PruneRemoves old Telescope entrieshours

Configuration

  • Authentication: Protect the MCP endpoint using middleware (e.g., auth:sanctum, auth.basic).
  • Endpoint Path: Customize TELESCOPE_MCP_PATH or modify in config/telescope-mcp.php.
  • Logging: Enable or disable internal MCP logging.
  • Timeouts & Limits: Adjust request timeouts and payload limits as needed.

Advanced

See config/telescope-mcp.php for:

  • Custom middleware stacks
  • Operation-specific settings
  • Route and namespace overrides

Contributing

Contributions are welcome. Please submit issues or pull requests following our CONTRIBUTING.md guidelines.

License

Licensed under MIT. See LICENSE for details.

Server Config

{
  "mcpServers": {
    "Laravel Telescope MCP": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://localhost:8000/telescope-mcp",
        "--allow-http"
      ]
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
CursorThe AI Code Editor
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
WindsurfThe new purpose-built IDE to harness magic
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
DeepChatYour AI Partner on Desktop
ChatWiseThe second fastest AI chatbot™
Playwright McpPlaywright MCP server
Tavily Mcp
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Amap Maps高德地图官方 MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Serper MCP ServerA Serper MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。