# AppSignal MCP
A Model Context Protocol (MCP) server for AppSignal monitoring API integration. This server allows AI assistants to directly query and fetch error and performance data from AppSignal through the MCP protocol.
## Features
- Fetch details about specific error or performance samples
- Search for errors, performance samples, or both with flexible filters
- Integration with AppSignal's Error and Performance Monitoring APIs
## Prerequisites
- [Bun](https://bun.sh/) runtime
- AppSignal account and API token
- Application ID from your AppSignal dashboard
## Installation
```bash
# Clone the repository
git clone https://github.com/pauldub/appsignal-mcp.git
cd appsignal-mcp
# Install dependencies
bun install
```
## Configuration
Create a `.env` file in the root directory with your AppSignal credentials:
```env
# Server configuration
PORT=3000
LOG_LEVEL=info
# AppSignal configuration
APPSIGNAL_API_TOKEN=your-api-token
```
## Usage
### Starting the Server
```bash
# Run the server
bun start
# Development mode with auto-reload
bun dev
# Run tests
bun test
# Build a standalone executable
bun run build
```
### CLI Options
```bash
appsignal-mcp --appsignal-api-token your-token
```
Available options:
- `--appsignal-api-token <token>` - AppSignal API token
- `--log-level <level>` - Logging level (debug, info, warn, error)
- `--port <port>` - Server port number
## MCP Tools
### 1. get_sample
Gets details about a specific sample by ID (error or performance).
**Parameters:**
- `sampleId` (string, required): The AppSignal sample ID
- `appId` (string, required): The AppSignal application ID
### 2. search_samples
Searches for samples in an application with optional filters.
**Parameters:**
- `appId` (string, required): The AppSignal application ID
- `sample_type` (string, optional): Type of samples to search - "all", "errors", or "performance" (defaults to "errors")
- `exception` (string, optional): Filter by exception name (e.g., "NoMethodError") - only applicable for error samples
- `action_id` (string, optional): Filter by action name (e.g., "BlogPostsController-hash-show")
- `since` (string/number, optional): Start timestamp in UTC (timestamp or ISO format)
- `before` (string/number, optional): End timestamp in UTC (timestamp or ISO format)
- `limit` (number, optional): Maximum number of samples to return (defaults to 10)
- `count_only` (boolean, optional): Only return the count, not the samples
## Claude Integration
To use this MCP server with Claude, create a `.mcp.json` file in your Claude Code workspace:
```json
{
"mcpServers": {
"appsignal-mcp": {
"type": "stdio",
"command": "bun",
"args": [
"run",
"start"
],
"env": {
"APPSIGNAL_API_TOKEN": "your-api-token"
}
}
}
}
```
## License
MIT