Weave MCP Server + Client Linked Traces:

by zbirenbaum

262 downloads Not rated yet
GitHub

About

# Weave MCP Server + Client Linked Traces: This repo is taken from the example in Arize-ai/phoenix and adapted to export to wandb/weave. Note: There is a race condition which sometimes causes the tool to fail to run at the OpenAI call step. This bug was also present in the original and was not introduced by weave. ##…

Explore

- End-to-end tracing across MCP client and server
- Automatic OpenTelemetry context propagation via openinference-instrumentation-mcp
- Exports traces to wandb/Weave
- Supports multi-language MCP components
- Connects AI models to external data sources

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Weave MCP Server + Client Linked Traces:
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

When properly instrumented, trace context is automatically propagated across the MCP client-server boundary, allowing you to:

- Track requests from client to server in a single trace
- Observe latency at different stages of the request lifecycle
- Debug issues that span across service boundaries

First run cp .env.example .env
Follow the instructions and set the relevant keys in your new env file.

- uv: uv sync
- pip: pip install -r requirements.txt

1. Navigate to this directory:

   cd tutorials/mcp/tracing_between_mcp_client_and_server

2. Install the required dependencies:

   pip install -r requirements.txt

1. Run Phoenix locally, or connect to an instance online

2. Update your .env file with OPENAI_API_KEY, and your PHOENIX_COLLECTOR_ENDPOINT. If you're using an online Phoenix instance or have auth enabled, also set your PHOENIX_API_KEY.

3. Run the MCP client. The client code will spin up the server at run time in a separate process.

   python client.py

4. Ask questions of the agent.

5. View the traces in Phoenix:
mcp-traces

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "weave mcp server + client linked traces:": {
            "weave-mcp-server-client-trace": {
                "command": "python",
                "args": [
                    "client.py"
                ]
            }
        }
    }
}

McpServers

{
    "weave-mcp-server-client-trace": {
        "command": "python",
        "args": [
            "client.py"
        ]
    }
}
This repo is taken from the example in Arize-ai/phoenix and adapted to export to wandb/weave. Note: There is a race condition which sometimes causes the tool to fail to run at the OpenAI call step. This bug was also present in the original and was not introduced by weave.

Set up your environment:

First run cp .env.example .env
Follow the instructions and set the relevant keys in your new env file.

Install Dependencies:

- uv: uv sync
- pip: pip install -r requirements.txt

Run the client and export traces

- uv: uv run client.py
- python: python client.py

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.