Skip to content

Commit 440eba5

Browse files
committed
fixed authentication section
1 parent ba2d281 commit 440eba5

File tree

2 files changed

+23
-31
lines changed

2 files changed

+23
-31
lines changed

docs/toolhive/guides-cli/manage-mcp-servers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ thv list
1818
```
1919

2020
This shows the server name, package, status, url, port, tool type, group, and created at. Remote
21-
servers will show their target URL in url, and remote in package and tool type columns making it easy to identify them.
21+
servers display their target URL in the URL column. The word 'remote' is indicated in both the package and tool type columns, making it easy to identify remote servers.
2222

2323
To include stopped servers in the list:
2424

docs/toolhive/guides-cli/run-mcp-servers.mdx

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ thv run neon
3939
thv run stripe
4040
```
4141

42-
When you run a remote server from the registry, ToolHive uses the pre-configured remote URL and authentication settings. By default, remote servers use the `streamable-http` transport. If the server uses Server-Sent Events (SSE), specify the transport flag:
43-
44-
```bash
45-
thv run <SERVER_NAME> --transport sse
46-
```
42+
When you run a remote server from the registry, ToolHive uses the pre-configured remote URL and authentication settings.
4743

4844
:::note[Naming convention]
4945

@@ -601,7 +597,15 @@ thv run <URL> [--name <SERVER_NAME>]
601597
For example:
602598

603599
```bash
604-
thv run https://api.example.com/mcp --name my-remote-server
600+
thv run https://api.example.com/mcp
601+
```
602+
603+
If you don't specify a name with `--name`, ToolHive will automatically derive a name from the URL by extracting the main domain name (e.g., `notion` from `https://api.notion.com/mcp`).
604+
605+
By default, remote servers use the `streamable-http` transport. If the server uses Server-Sent Events (SSE), specify the transport flag:
606+
607+
```bash
608+
thv run https://api.example.com/sse --transport sse
605609
```
606610

607611
:::info[What's happening?]
@@ -612,7 +616,7 @@ When you run a remote MCP server, ToolHive:
612616
2. Handles OAuth/OIDC authentication flows if needed.
613617
3. Starts an HTTP proxy process on a random port to forward client requests to
614618
the remote server.
615-
4. Manages the server like any other ToolHive workload. No conatainer is created for remote MCP servers.
619+
4. Manages the server like any other ToolHive workload. No container is created for remote MCP servers.
616620

617621
:::
618622

@@ -630,11 +634,11 @@ examining the server's response headers and status codes:
630634
thv run https://protected-api.com/mcp --name my-server
631635
```
632636

633-
If authentication is required, ToolHive will prompt you to complete the OAuth flow.
637+
If authentication is required, ToolHive will prompt you to complete the OAuth flow. When no client credentials are provided, ToolHive automatically registers an OAuth client with the authorization server using RFC 7591 dynamic client registration, eliminating the need to pre-configure client ID and secret.
634638

635-
#### OAuth/OIDC authentication
639+
#### OIDC authentication
636640

637-
For servers requiring OAuth or OIDC authentication, you can provide the issuer URL:
641+
For servers using OpenID Connect (OIDC), you can provide the issuer URL:
638642

639643
```bash
640644
thv run https://api.example.com/mcp \
@@ -643,38 +647,26 @@ thv run https://api.example.com/mcp \
643647
--remote-auth-client-id my-client-id
644648
```
645649

646-
#### Dynamic client registration
650+
#### OAuth2 authentication
647651

648-
When no client credentials are provided, ToolHive automatically registers an OAuth client
649-
with the authorization server using RFC 7591 dynamic client registration:
652+
For servers using OAuth2, you can specify the authorization and token URLs manually:
650653

651654
```bash
652-
thv run https://api.example.com/mcp --name my-server
655+
thv run https://api.example.com/mcp \
656+
--name my-server \
657+
--remote-auth-authorize-url https://auth.example.com/oauth/authorize \
658+
--remote-auth-token-url https://auth.example.com/oauth/token \
659+
--remote-auth-client-id my-client-id \
660+
--remote-auth-client-secret my-client-secret
653661
```
654662

655-
This eliminates the need to pre-configure client ID and secret, making it easier to
656-
connect to remote MCP servers.
657-
658663
#### Automatic token refresh
659664

660665
ToolHive automatically handles OAuth token refresh for remote MCP servers. When you
661666
authenticate with a remote server, ToolHive stores both the access token and refresh
662667
token securely. The refresh token is used to automatically obtain new access tokens
663668
when they expire, ensuring uninterrupted service without requiring manual re-authentication.
664669

665-
#### Custom OAuth endpoints
666-
667-
For non-OIDC OAuth servers, you can specify custom authorization and token endpoints:
668-
669-
```bash
670-
thv run https://api.example.com/mcp \
671-
--name my-server \
672-
--remote-auth-authorize-url https://auth.example.com/oauth/authorize \
673-
--remote-auth-token-url https://auth.example.com/oauth/token \
674-
--remote-auth-client-id my-client-id \
675-
--remote-auth-client-secret my-client-secret
676-
```
677-
678670
### Advanced remote server configuration
679671

680672
#### OAuth scopes and parameters

0 commit comments

Comments
 (0)