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.0.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.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: traceai_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.13.0 Darwin/24.1.0

File hashes

Hashes for traceai_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d462c31a2c1693071ceecc04facdb0f971023e2197b2e29ba5692bc31e9d88d6
MD5 45f94d2bbbbeddfdf0797339d2c1d9a0
BLAKE2b-256 afb3f56a4842b646bcb637505db48c0db7cfb08a2a58243268f8ef645ac145fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: traceai_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.13.0 Darwin/24.1.0

File hashes

Hashes for traceai_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad71dc50dc96442fa6b29d485cd6dbf9f85a0c2ebfc0832f151a66e7cb489420
MD5 d8c733d55346326d4f9f7b4b5298b1bf
BLAKE2b-256 34412f88427f343a620b09c157318be3869fe42b687d8872b66db26001a4e744

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