The LangSmith Tool Server is our MCP Framework that powers the tools available in the LangSmith Agent Builder. This framework enables you to build and deploy custom tools that can be integrated with your agents. It provides a standardized way to create, deploy, and manage tools with built-in authentication and authorization. The PyPi package that defines the framework is available here.Documentation Index
Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-lschan-1765567880-b1c8e16.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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).
Using remote MCP servers
Agent Builder can discover and use tools from remote Model Context Protocol (MCP) servers. This lets you connect to external MCP servers and use their tools in your agents.Configuration
Configure remote MCP servers in your LangSmith workspace:- Navigate to your workspace settings in the LangSmith UI.
- Add your MCP server URL and any required headers (for example,
Authorization: Bearer {{MCP_TOKEN}}). - Agent Builder automatically discovers tools from the server and applies the configured headers when calling tools.
Use workspace secret placeholders like
{{MCP_TOKEN}} in headers. The platform resolves these from your workspace secrets at runtime.How it works
- Agent Builder discovers tools from remote MCP servers via the standard MCP protocol.
- Headers configured in your workspace are automatically attached when fetching tools or calling them.
- Tools from remote servers are available alongside built-in tools in Agent Builder.