mcp-o11y

mcp-o11y

An MCP server that demonstrates comprehensive observability with Sentry, OpenTelemetry, and Braintrust, providing tools for file, data, and HTTP operations along with real-time status and configuration resources.

Category
Visit Server

README

MCP Observability Server

A Model Context Protocol (MCP) server that demonstrates how to incorporate comprehensive observability into MCP servers using Sentry, OpenTelemetry, and Braintrust.

Features

šŸ”§ Tools

  • File Operations: Read files, write files, list directories
  • Data Processing: JSON manipulation, data transformation
  • HTTP Client: URL fetching, webhooks, health checks

šŸ“Š Resources

  • Server Status: Real-time server metrics and performance data
  • Configuration: Server and observability configuration details
  • Health Check: Service health monitoring endpoint

šŸ“ˆ Observability Stack

Sentry

  • Error tracking and performance monitoring
  • Automatic breadcrumb collection
  • User context and custom tags
  • Transaction performance tracking

OpenTelemetry

  • Distributed tracing with Jaeger export
  • Custom metrics with Prometheus export
  • Automatic instrumentation of Node.js libraries
  • Custom spans for tool executions

Braintrust

  • AI/ML model evaluation and logging
  • Tool execution tracking
  • Performance analytics
  • Experiment management

Quick Start

1. Installation

npm install

2. Configuration

Copy the example environment file:

cp .env.example .env

Edit .env with your configuration:

# Sentry (optional)
SENTRY_DSN=your_sentry_dsn_here
SENTRY_ENVIRONMENT=development

# Braintrust (optional) 
BRAINTRUST_API_KEY=your_braintrust_api_key_here
BRAINTRUST_PROJECT_NAME=mcp-observability

# OpenTelemetry (configured by default)
OTEL_SERVICE_NAME=mcp-observability-server
OTEL_EXPORTER_JAEGER_ENDPOINT=http://localhost:14268/api/traces

3. Build and Run

# Development mode
npm run dev

# Production mode
npm run build
npm start

Using with Claude Desktop

Add to your Claude Desktop MCP configuration:

{
  "mcpServers": {
    "observability-server": {
      "command": "node",
      "args": ["/path/to/mcp-observability-server/dist/index.js"]
    }
  }
}

Observability Setup

Sentry Setup

  1. Create a Sentry project at sentry.io
  2. Copy your DSN to the SENTRY_DSN environment variable
  3. The server will automatically track errors and performance

OpenTelemetry + Jaeger Setup

  1. Run Jaeger locally:
docker run -d --name jaeger \
  -p 16686:16686 \
  -p 14268:14268 \
  jaegertracing/all-in-one:latest
  1. Access Jaeger UI at http://localhost:16686
  2. Traces will be automatically exported

Braintrust Setup

  1. Sign up at braintrust.dev
  2. Get your API key and project name
  3. Set the environment variables
  4. Tool executions will be logged for analysis

Example Usage

Using Tools

// Read a file
{
  "tool": "read_file",
  "arguments": {
    "path": "/path/to/file.txt",
    "encoding": "utf8"
  }
}

// Process JSON data
{
  "tool": "process_json", 
  "arguments": {
    "data": "{\"users\": [{\"name\": \"Alice\"}, {\"name\": \"Bob\"}]}",
    "operation": "extract_keys",
    "path": "users"
  }
}

// Fetch URL
{
  "tool": "fetch_url",
  "arguments": {
    "url": "https://api.github.com/users/octocat",
    "method": "GET"
  }
}

Accessing Resources

// Get server status
{
  "resource": "status://server"
}

// Health check
{
  "resource": "status://health"
}

// Configuration
{
  "resource": "config://server"
}

Architecture

src/
ā”œā”€ā”€ observability/          # Observability integrations
│   ā”œā”€ā”€ sentry.ts          # Sentry error tracking
│   ā”œā”€ā”€ opentelemetry.ts   # OpenTelemetry tracing
│   ā”œā”€ā”€ braintrust.ts      # Braintrust logging
│   └── index.ts           # Unified observability wrapper
ā”œā”€ā”€ tools/                 # MCP tools
│   ā”œā”€ā”€ fileOperations.ts  # File I/O tools
│   ā”œā”€ā”€ dataProcessing.ts  # Data manipulation tools
│   ā”œā”€ā”€ httpClient.ts      # HTTP client tools
│   └── index.ts           # Tool registry
ā”œā”€ā”€ resources/             # MCP resources  
│   ā”œā”€ā”€ status.ts          # Server status resource
│   ā”œā”€ā”€ config.ts          # Configuration resource
│   └── index.ts           # Resource registry
└── index.ts               # Main server entry point

Key Observability Features

1. Automatic Tool Wrapping

All tools are automatically wrapped with the withObservability decorator that:

  • Creates OpenTelemetry spans
  • Starts Sentry transactions
  • Logs to Braintrust
  • Records performance metrics

2. Error Handling

  • Automatic error capture in Sentry with context
  • Error spans in OpenTelemetry traces
  • Failed execution logging in Braintrust

3. Performance Monitoring

  • Response time tracking
  • Memory usage monitoring
  • Request success/failure rates
  • Custom metrics via OpenTelemetry

4. Distributed Tracing

  • End-to-end request tracing
  • Tool execution spans
  • External API call tracing
  • Performance bottleneck identification

Development

# Type checking
npm run typecheck

# Linting  
npm run lint

# Testing
npm test

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured