Skip to main content

OpenTelemetry instrumentation for MCP

Project description

MCP OpenTelemetry Integration

Overview

This integration provides support for using OpenTelemetry with the MCP framework. It enables tracing and monitoring of applications built with MCP.

Installation

  1. Install traceAI MCP
pip install traceAI-mcp traceAI-openai

Set Environment Variables

Set up your environment variables to authenticate with FutureAGI

import os

os.environ["FI_API_KEY"] = FI_API_KEY
os.environ["FI_SECRET_KEY"] = FI_SECRET_KEY
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY

Quickstart

Register Tracer Provider

Set up the trace provider to establish the observability pipeline. The trace provider:

from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType

trace_provider = register(
    project_type=ProjectType.OBSERVE,
    project_name="my-mcp-project"
)

Configure MCP Instrumentation

Set up your MCP Instrumentation with built-in observability.

from traceai_openai import OpenAIInstrumentor
from traceai_mcp import MCPInstrumentor

OpenAIInstrumentor().instrument(tracer_provider=trace_provider)
MCPInstrumentor().instrument(tracer_provider=tracer_provider)

Start your MCP server as usual. TraceAI will automatically trace all MCP requests which will be visible in the FutureAGI platform.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

traceai_mcp-0.1.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

traceai_mcp-0.1.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file traceai_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: traceai_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for traceai_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0565cc562d01ad04a97c79960d79870b3acb8c47e4b57b269391fa23dc565f17
MD5 1a9de065276983fe8f46041e28085f40
BLAKE2b-256 c5095a90350e171351d9b0e0cac28650f69cce6cea5a802acbfba0bc6e73649f

See more details on using hashes here.

File details

Details for the file traceai_mcp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: traceai_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for traceai_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ae8b3499add01489536512922fac114ff2a54c8dc01f47c569e0fe23f4bf15fc
MD5 cb945827ac8534e3b47f1142a6ba6265
BLAKE2b-256 b984b17d3898b0bc173ba7c4d971f6a16be60372d4a1a059f4304b4074942dab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page