Skip to content

Commit 72fa531

Browse files
claudespicelukekim
authored andcommitted
docs: Document MCP streamable HTTP auth parameters
Adds `mcp_auth_token` and `mcp_headers` parameter coverage to the MCP Tools docs to match spiceai/spiceai#10927. Source: spiceai/spiceai#10927
1 parent 345d71d commit 72fa531

1 file changed

Lines changed: 38 additions & 1 deletion

File tree

  • website/docs/components/tools

website/docs/components/tools/mcp.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,34 @@ tools:
3838
from: mcp:http://example.com/v1/mcp
3939
```
4040
41+
### Example: Connecting to an Auth-Enabled MCP Server (Streamable HTTP)
42+
43+
Streamable HTTP MCP tools support sending an `Authorization: Bearer` token via `mcp_auth_token`, or arbitrary HTTP headers via `mcp_headers`. Both parameters resolve [secret references](../secret-stores/) before the MCP client is constructed.
44+
45+
Sending a bearer token:
46+
47+
```yaml
48+
tools:
49+
- name: remote_spice
50+
from: mcp:https://my-spice.example.com/v1/mcp
51+
params:
52+
# Sends: Authorization: Bearer <expanded secret value>
53+
mcp_auth_token: ${ secrets:MCP_SERVER_API_KEY }
54+
```
55+
56+
Sending a custom header (e.g., API key):
57+
58+
```yaml
59+
tools:
60+
- name: remote_spice
61+
from: mcp:https://my-spice.example.com/v1/mcp
62+
params:
63+
# Sends: X-API-Key: <expanded secret value>
64+
mcp_headers: 'X-API-Key: ${ secrets:MCP_SERVER_API_KEY }'
65+
```
66+
67+
If both `mcp_auth_token` and a custom `Authorization` header in `mcp_headers` are set, `mcp_auth_token` wins and a warning is logged.
68+
4169
## Using MCP Tools with Models
4270

4371
Once configured, MCP tools can be assigned to models via the `tools` parameter. For example:
@@ -87,7 +115,9 @@ The `from` field specifies the transport mechanism for the MCP tool:
87115

88116
### `params`
89117

90-
The `params` field provides additional configuration for MCP tools. For stdio-based tools, use `mcp_args` to specify command-line arguments.
118+
The `params` field provides additional configuration for MCP tools.
119+
120+
For stdio-based tools, use `mcp_args` to specify command-line arguments:
91121

92122
```yaml
93123
tools:
@@ -97,6 +127,13 @@ tools:
97127
mcp_args: -y @custom/tool
98128
```
99129

130+
For Streamable HTTP tools, the following auth parameters are supported:
131+
132+
- `mcp_auth_token` — Sends `Authorization: Bearer <token>` on every request to the MCP server.
133+
- `mcp_headers` — Sends additional HTTP headers using the same `Header: Value` comma- or semicolon-delimited format as the [HTTP data connector's `http_headers`](../data-connectors/https). Header values are marked sensitive.
134+
135+
Both parameters support [secret expansion](../secret-stores/). When `mcp_auth_token` is set, an `Authorization` header in `mcp_headers` is ignored and a warning is logged to avoid duplicate auth headers.
136+
100137
### `env`
101138

102139
For stdio-based MCP tools, environment variables can be set using the `env` field.

0 commit comments

Comments
 (0)