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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b1be4f56a21528c1a0e66817b0abc38b686e29bedcc13744767bf72baec002e
|
|
| MD5 |
6cf8ef9f8a3d7f244d4a323174549d80
|
|
| BLAKE2b-256 |
1672668c62e1ec634ea3af4a6c6a79e50dd567b466f3437547d143f505398b80
|
Provenance
The following attestation bundles were made for dash_langsmith-0.3.0.tar.gz:
Publisher:
publish.yml on ndrezn/dash-langsmith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dash_langsmith-0.3.0.tar.gz -
Subject digest:
0b1be4f56a21528c1a0e66817b0abc38b686e29bedcc13744767bf72baec002e - Sigstore transparency entry: 2207173226
- Sigstore integration time:
-
Permalink:
ndrezn/dash-langsmith@f2fd8917a5194b8a2c4e0125856433bbf45236d3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ndrezn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f2fd8917a5194b8a2c4e0125856433bbf45236d3 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
589fec6c489a3a9499ace6bf71c5fcff22a82e0b87dd6db00ca66c7206a79a4f
|
|
| MD5 |
1285a7a0317a48ea3e1dc67d9b9daa9d
|
|
| BLAKE2b-256 |
1a7161709e377f694290993b4dfb9b48248cc719d6342a4ad13d29c0f9de4e18
|
Provenance
The following attestation bundles were made for dash_langsmith-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on ndrezn/dash-langsmith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dash_langsmith-0.3.0-py3-none-any.whl -
Subject digest:
589fec6c489a3a9499ace6bf71c5fcff22a82e0b87dd6db00ca66c7206a79a4f - Sigstore transparency entry: 2207173232
- Sigstore integration time:
-
Permalink:
ndrezn/dash-langsmith@f2fd8917a5194b8a2c4e0125856433bbf45236d3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ndrezn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f2fd8917a5194b8a2c4e0125856433bbf45236d3 -
Trigger Event:
workflow_dispatch
-
Statement type: