Skip to main content

Automatic LangSmith tracing for Dash MCP tool calls

Project description

dash-langsmith

Automatic LangSmith tracing for Dash MCP tool calls.

Every time an AI agent calls a tool on your Dash MCP server, a run is recorded in LangSmith — latency, inputs, outputs, and errors included. No code changes to your app required.

Install

pip install dash-langsmith

Usage

Set your API key and run your app normally.

export LANGSMITH_API_KEY=your-key
export LANGSMITH_PROJECT=my-dash-app  # optional
python app.py

That's it. The dash_hooks entry point registers the tracing middleware automatically at startup.

How it works

dash-langsmith uses Dash's plugin hooks system. On startup, hooks.setup wraps app.server.wsgi_app with a lightweight WSGI middleware that intercepts POST requests to /_mcp. When a tools/call JSON-RPC message arrives, it creates a LangSmith run before dispatching to Dash and patches it with the response on the way out.

Only tools/call requests are traced. Layout, resource, and tools/list requests pass through untouched.

Optional: richer traces with @mcp_traced

For explicit per-tool control — custom names, docstrings, per-tool project routing — use the @mcp_traced decorator instead of @mcp_enabled:

from dash_langsmith import mcp_traced

@mcp_traced(name="get_inventory", expose_docstring=True, project_name="my-dash-app")
def get_inventory(category: str) -> dict:
    """Return inventory levels for a product category."""
    ...

Configuration

Environment variable Default Description
LANGSMITH_API_KEY Required
LANGSMITH_PROJECT LangSmith project (falls back to LANGCHAIN_PROJECT)
DASH_MCP_PATH /_mcp Override if you set a custom mcp_path

Requirements

  • Dash ≥ 4.3.0 (MCP support)
  • langsmith ≥ 0.1.0

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

dash_langsmith-0.3.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

dash_langsmith-0.3.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file dash_langsmith-0.3.0.tar.gz.

File metadata

  • Download URL: dash_langsmith-0.3.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for dash_langsmith-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0b1be4f56a21528c1a0e66817b0abc38b686e29bedcc13744767bf72baec002e
MD5 6cf8ef9f8a3d7f244d4a323174549d80
BLAKE2b-256 1672668c62e1ec634ea3af4a6c6a79e50dd567b466f3437547d143f505398b80

See more details on using hashes here.

Provenance

The following attestation bundles were made for dash_langsmith-0.3.0.tar.gz:

Publisher: publish.yml on ndrezn/dash-langsmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dash_langsmith-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: dash_langsmith-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for dash_langsmith-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 589fec6c489a3a9499ace6bf71c5fcff22a82e0b87dd6db00ca66c7206a79a4f
MD5 1285a7a0317a48ea3e1dc67d9b9daa9d
BLAKE2b-256 1a7161709e377f694290993b4dfb9b48248cc719d6342a4ad13d29c0f9de4e18

See more details on using hashes here.

Provenance

The following attestation bundles were made for dash_langsmith-0.3.0-py3-none-any.whl:

Publisher: publish.yml on ndrezn/dash-langsmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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