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

Uploaded Python 3

File details

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

File metadata

  • Download URL: traceai_mcp-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d04316eca04c9f68ce1a6ae72f85614c679f707aa68b0d85af4cce430766bab5
MD5 3f8b51114e76e8aaa61a87351378bd18
BLAKE2b-256 841a35e0d93eef84e8766b9283763c768d3fcd8a5e83ea5841de3b485dd2eacb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: traceai_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac061f817a93bbdeaecbcbdbf7a797597a02edfe364983c85a717f041d9d4223
MD5 c093c430ea87ee80fd6d87038100b24f
BLAKE2b-256 2f4fa34f8047d3cd3b7e2fd32c7b4402d0ee81605adf81111c1fc5078b6f4a3f

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