Quick start
Install the LangSmith Tool Server and LangChain CLI:@tool decorator:
http://localhost:8000.
Simple client example
Hereβs a simple example that lists available tools and calls theadd tool:
Adding OAuth authentication
For tools that need to access third-party APIs (like Google, GitHub, Slack, etc.), you can use OAuth authentication with Agent Auth. Before using OAuth in your tools, youβll need to configure an OAuth provider in your LangSmith workspace settings. See the Agent Auth documentation for setup instructions. Once configured, specify theauth_provider in your tool decorator:
auth_provider must:
- Have
context: Contextas the first parameter - Specify at least one scope
- Use
context.tokento make authenticated API calls
Using as an MCP gateway
The LangSmith Tool Server can act as an MCP gateway, aggregating tools from multiple MCP servers into a single endpoint. Configure MCP servers in yourtoolkit.toml:
/mcp endpoint. MCP tools are prefixed with their server name to avoid conflicts (e.g., weather.get_forecast, math.add).
Custom authentication
Custom authentication allows you to validate requests and integrate with your identity provider. Define an authentication handler in yourauth.py file:
identity (and optionally permissions).