You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/langsmith/agent-builder-mcp-framework.mdx
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,3 +120,53 @@ Tools with `auth_provider` must:
120
120
- Have `context: Context` as the first parameter
121
121
- Specify at least one scope
122
122
- Use `context.token` to make authenticated API calls
123
+
124
+
## Using as an MCP gateway
125
+
126
+
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`:
127
+
128
+
```toml
129
+
[toolkit]
130
+
name = "my-toolkit"
131
+
tools = "./my_toolkit/__init__.py:TOOLS"
132
+
133
+
[[mcp_servers]]
134
+
name = "weather"
135
+
transport = "streamable_http"
136
+
url = "http://localhost:8001/mcp/"
137
+
138
+
[[mcp_servers]]
139
+
name = "math"
140
+
transport = "stdio"
141
+
command = "python"
142
+
args = ["-m", "mcp_server_math"]
143
+
```
144
+
145
+
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`).
146
+
147
+
## Custom authentication
148
+
149
+
Custom authentication allows you to validate requests and integrate with your identity provider. Define an authentication handler in your `auth.py` file:
0 commit comments