MartinKlefas/papertrail-mcp-server
If you are the rightful owner of papertrail-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Papertrail MCP Agent for Cursor is a tool that integrates Papertrail logs with Cursor's agent using the `mcp.server.fastmcp` library, ensuring maximum compatibility and efficiency.
Papertrail MCP Agent for Cursor
This MCP tool exposes Papertrail logs to Cursor's agent using the mcp.server.fastmcp
library for maximum compatibility.
Endpoints
1. /tools/get_logs_by_time
Fetch logs based on a time range and optional system name or ID.
Payload:
{
"time_from": "1 hour ago",
"time_to": "30 minutes ago",
"system": "backend-server",
"query": "error"
}
2. /tools/list_groups
Lists all saved log groups (saved searches) available in Papertrail.
Response:
[
{ "id": 123, "name": "backend" },
{ "id": 456, "name": "frontend" }
]
3. /tools/logs_by_group_name
Fetch logs from a group by its human-readable name. This internally resolves the name to the group ID.
Payload:
{
"group_name": "backend",
"time_from": "1 hour ago",
"query": "exception"
}
Getting Started
- Clone this repo and create a virtual environment:
cd papertrail-mcp-server
python -m venv .venv
.venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set your Papertrail API token (in environment variables):
You can either:
- Add it to your system/user env vars, or
- Add this line to a
.env
file here for it to load in-code:
# Add to .env
PAPERTRAIL_API_TOKEN = "your-token-here"
- Update Cursor MCP Configuration:
In your project's .cursor/mcp.json
adjust the paths to reflect where you've cloned this repo.
The below is structured for windows:
{
"mcpServers": {
"papertrail-logs": {
"command": "**project path**\\**venv path**\\uv",
"args": [
"run",
"--directory", "**project path**",
"papertrail_agent.py"
]
}
}
}
The below will work on *nix systems:
{
"mcpServers": {
"papertrail-logs": {
"command": "**project path**/**venv path**/uv",
"args": [
"run",
"--directory", "**project path**",
"papertrail_agent.py"
]
}
}
}
⚠️ Make sure this file is located in your Cursor project root under .cursor/mcp.json
.
- Save & Accept prompt for new agent:
You should get a prompt in the bottom left to enable the agent, you'll likely be taken to the settings screen and it should show that there are 4 tools available:
- Use in Cursor (Agent mode):
Ask things like:
"Get logs from the
backend
group from 1 hour ago to now with keyworderror
"