Skip to main content
The LangSmith Tool Server is a standalone MCP framework for building and deploying tools with built-in authentication and authorization. Use the Tool Server when you want to:
If you’re using Fleet, you don’t need to interact with the Tool Server directly. Fleet provides built-in tools and supports remote MCP servers without requiring Tool Server setup.However, you can configure the associated tool server instance as an MCP server, which will allow you to use your custom MCP servers in your agent.
Download the PyPI package to get started.

Create a custom toolkit

Install the LangSmith Tool Server and LangChain CLI:
Create a new toolkit:
This creates a toolkit with the following structure:
Define your tools using the @tool decorator. For more on tool schemas, return values, error handling, and ToolRuntime, see the Tools guide.
Run the server:
Your tool server will start on http://localhost:8000.

Call tools via MCP protocol

Below is an example that lists available tools and calls the add tool:

Use 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 your toolkit.toml:
All tools from connected MCP servers are exposed through your server’s /mcp endpoint. MCP tools are prefixed with their server name to avoid conflicts (e.g., weather_get_forecast, math_add).

Authenticate

OAuth for third-party APIs

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 the auth_provider in your tool decorator:
Tools with auth_provider must:
  • Have context: Context as the first parameter
  • Specify at least one scope
  • Use context.token to make authenticated API calls

Custom request authentication

Custom authentication allows you to validate requests and integrate with your identity provider. Define an authentication handler in your auth.py file:
The handler runs on every request and must return a dict with identity (and optionally permissions).