Spyglass AI MCP Server
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Spyglass AI MCP Server What are the slowest endpoints in the last hour?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Spyglass AI MCP Server
The Spyglass AI MCP server provides a simple interface for LLMs to query the Spyglass AI agent. The agent analyzes your telemetry data and provides intelligent insights about application performance, errors, and bottlenecks.
To install the MCP server for Cursor click the button below. It should open Cursor and prompt you to add your API Key.
Alternatively, add the following to your ~/.cursor/mcp.json file (create it if you need to) and substitute your Spyglass API Key. Then restart Cursor to apply the change.
{
"mcpServers": {
"spyglass-ai": {
"command": "uvx",
"args": ["spyglass-mcp"],
"env": {
"SPYGLASS_API_KEY": "your-key-here"
}
}
}
}Note that you need to have uv installed first, see the docs for that here
Available Tools
call_spyglass_agent
Calls the Spyglass AI agent with a natural language query about your telemetry data.
Parameters:
query(string, required): Natural language query about your application's telemetry data
Example queries:
"What are the slowest endpoints in the last hour?"
"Show me all errors in the checkout service"
"Which services have the highest error rate?"
"What's causing high latency in my API?"
"How many requests has my app had in the last day?"
Returns:
Natural language analysis of the telemetry data
Related MCP server: Datadog MCP Server
Configuration
Environment Variables
Variable | Required | Default | Description |
| Yes | N/A | API Key for authentication with Spyglass agent |
| No |
| Agent endpoint URL (useful for local testing) |
Command Line Arguments
Argument | Required | Default | Description |
| No |
| Spyglass agent endpoint URL |
| No |
| Transport type (stdio or http) |
| No |
| Port for HTTP transport |
Example: Using with an MCP Client
import asyncio
from fastmcp import Client
client = Client("http://localhost:8000/mcp")
async def analyze():
async with client:
result = await client.call_tool("call_spyglass_agent", {
"query": "What are the slowest endpoints?"
})
print(result)
asyncio.run(analyze())Logging
The MCP server logs to both stderr (captured by Cursor) and a file for debugging:
Log file location:
~/.spyglass/logs/mcp-server-YYYYMMDD.logView logs in real-time:
tail -f ~/.spyglass/logs/mcp-server-$(date +%Y%m%d).logThe logs include:
Server startup and configuration
Incoming queries and responses
API call details (with truncated tokens for security)
Error messages and stack traces
Development
Prerequisites
Python 3.11 or higher
uv package manager
Setup
Clone the repository and navigate to the project directory:
cd spyglass-mcpInstall dependencies:
uv syncThis will create a virtual environment and install all required dependencies.
Copy the example environment file and configure your API key:
cp env.example .env
# Edit .env and add your SPYGLASS_API_KEYRunning Locally
Run the MCP server in stdio mode (default):
uv run spyglass-mcpRun with a custom endpoint (useful for testing against a local agent):
uv run spyglass-mcp --endpoint http://localhost:8080Run in HTTP transport mode:
uv run spyglass-mcp --transport http --port 8000Running Tests
Run all tests:
uv run pytestRun tests with verbose output:
uv run pytest -vRun a specific test file:
uv run pytest tests/test_mcp_server.pyRun tests with coverage:
uv run pytest --cov=spyglass_mcp --cov-report=term-missingBuilding
Build the package for distribution:
uv buildThis will create wheel and source distribution files in the dist/ directory.
Project Structure
spyglass-mcp/
├── .github/
│ └── workflows/
│ └── publish.yaml
├── src/
│ └── spyglass_mcp/
│ ├── __init__.py
│ └── main.py
├── tests/
│ ├── __init__.py
│ ├── conftest.py
│ └── test_mcp_server.py
├── CHANGELOG.md
├── env.example
├── LICENSE
├── pyproject.toml
├── README.md
└── uv.lockAvailable Tools
1 toolcall_spyglass_agentA
Call the Spyglass AI agent with a natural language query about your telemetry data.
Args: query: Natural language query about telemetry data (e.g., "What are the slowest endpoints?")
Returns: Analysis result from the Spyglass AI agent
Inputs: query (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of ambiguity between tools.
The single tool name 'call_spyglass_agent' follows a clear verb_noun pattern, which is consistent and descriptive.
A single tool for telemetry data analysis feels thin; typical telemetry servers offer multiple operations (e.g., list, get, query).
The tool only allows querying via an AI agent, with no tools for data exploration, configuration, or management, leaving significant gaps in the expected functionality.
Maintenance
Related MCP Connectors
Query your app's logs, metrics and incidents from your AI assistant.
Open-source agent that observes and fixes your application. Query logs, traces, metrics, incidents.
Manage uptime monitors and incidents and search logs, metrics and traces from an AI assistant.
LLM Orchestration Agent (Opentelemetry Api)
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Datadog's observability platform via natural language, covering metrics, logs, APM, monitors, dashboards, incidents, and infrastructure.2,048 npm1MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to access full Datadog observability, including log search, APM trace filtering, smart sampling, and cross-correlation between logs, traces, and metrics.232,048 npm6Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to query Datadog metrics, logs, monitors, security signals, and billing data through natural language.MIT
- AlicenseAqualityCmaintenanceEnables AI agents to query OriginChain's telemetry agent for log patterns, semantic incident analysis, distributed traces, service graphs, and read-only SQL queries over telemetry data.104 npmMIT