8000 GitHub - aliosmandev/pipelog · GitHub
[go: up one dir, main page]

Skip to content
aliosmandevPublic

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

pipelog

Pipe logs from your app to Claude. Simple MCP debug server.

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  Your Code  │────▶│   pipelog   │────▶│   Claude    │
│  fetch()    │     │   :3333     │     │  get_logs() │
└─────────────┘     └─────────────┘     └─────────────┘

Install

Option 1: Docker (Recommended)

# Clone and start with Docker
git clone https://github.com/aliosmandev/pipelog.git
cd pipelog
docker compose up -d

Server runs at http://localhost:3333 in the background.

# View logs
docker compose logs -f

# Stop
docker compose down

Option 2: Manual Install

git clone https://github.com/aliosmandev/pipelog.git
cd pipelog
pnpm install
pnpm build

Add to Claude Code

claude mcp add pipelog -- node /FULL/PATH/TO/pipelog/packages/server/dist/cli.js

Verify:

claude mcp list

Usage

1. Add Logs to Your Code

// Basic log
fetch('http://localhost:3333/log', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    level: 'info',
    source: 'api',
    message: 'User logged in'
  })
});

// Error log with data
fetch('http://localhost:3333/log', {
  method: 'POST',
  heade
81F1
rs: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    level: 'error',
    source: 'database',
    message: 'Query failed',
    data: { query: 'SELECT...', error: err.message }
  })
});

2. Run Your App

npm test
# or
node app.js

3. Claude Reads the Logs

Claude uses these MCP tools:

Tool Description
get_logs Get logs (filter by level, source)
get_errors Get only errors
get_summary Get summary stats
search_logs Search by text/regex
clear_logs Clear all logs

Example

You: "Debug why login isn't working"

Claude: *adds fetch logs to code*

You: *runs the test*

Claude: *reads errors with get_errors*
        "Found an error in token validation, fixing..."

Log Format

{
  level: 'debug' | 'info' | 'warn' | 'error',
  source: string,    // "api", "auth", "db"
  message: string,
  data?: object
}

HTTP API

# Send log
curl -X POST http://localhost:3333/log \
  -H "Content-Type: application/json" \
  -d '{"level":"error","source":"test","message":"Failed"}'

# Read logs
curl http://localhost:3333/logs
curl http://localhost:3333/logs?level=error

# Clear
curl -X DELETE http://localhost:3333/logs

Server Options

pipelog --help

  -p, --port <PORT>    Port (default: 3333)
  -s, --storage <TYPE> memory | file (default: memory)
  --max-logs <N>       Max log count (default: 10000)

Docker

# Start in background
docker compose up -d

# With custom port
docker compose up -d -e PORT=4000

# Rebuild after changes
docker compose up -d --build

# View container logs
docker compose logs -f pipelog

# Stop
docker compose down

# Stop and remove data
docker compose down -v

License

MIT

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0