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
Release files for dash-langsmith 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dash_langsmith-0.3.0.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dash_langsmith-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / dash_langsmith-0.3.0.tar.gz
| Download URL | dash_langsmith-0.3.0.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b1be4f56a21528c1a0e66817b0abc38b686e29bedcc13744767bf72baec002e
|
|
BLAKE2b-256 checksum How to use checksums |
1672668c62e1ec634ea3af4a6c6a79e50dd567b466f3437547d143f505398b80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.
Transparency logRelease files / dash_langsmith-0.3.0-py3-none-any.whl
| Download URL | dash_langsmith-0.3.0-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
589fec6c489a3a9499ace6bf71c5fcff22a82e0b87dd6db00ca66c7206a79a4f
|
|
BLAKE2b-256 checksum How to use checksums |
1a7161709e377f694290993b4dfb9b48248cc719d6342a4ad13d29c0f9de4e18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.
Transparency log