Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 45 additions & 40 deletions docs/toolhive/guides-mcp/context7.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description:
Using the Context7 MCP server with ToolHive for up-to-date documentation.
last_update:
author: danbarr
date: 2025-08-27
date: 2025-10-08
---

## Overview
Expand Down Expand Up @@ -39,25 +39,21 @@ While Context7 works without an API key, registering at
- Priority access during peak usage
- Better performance for frequent queries

:::note
<Tabs groupId='mode' queryString='mode'>
<TabItem value='ui' label='UI' default>

Currently, the Context7 MCP server only supports a CLI argument for the API key.
This means ToolHive's secrets management cannot be used to inject the key as an
environment variable. Instead, you must pass the API key directly as a
command-line argument when starting the server.
**Remote MCP server**

:::
Select the `context7-remote` MCP server in the ToolHive registry. Currently,
ToolHive doesn't support adding custom headers for remote MCP servers, so using
the remote server is limited to basic usage without an API key.

<Tabs groupId='mode' queryString='mode'>
<TabItem value='ui' label='UI' default>
**Local MCP server**

Select the `context7` MCP server in the ToolHive registry. The server works
without authentication for basic usage, but you can add an API key for higher
rate limits.
Select the `context7` MCP server in the ToolHive registry.

In the **Command arguments** section, optionally add `--api-key YOUR_API_KEY` if
you have a Context7 API key. This provides higher rate limits and priority
access.
The server works without authentication for basic usage, but you can optionally
add an API key in the **Secrets** section for higher rate limits.

:::tip[Security tip]

Expand All @@ -69,19 +65,18 @@ the server's network access using the default profile contained in the registry.
</TabItem>
<TabItem value='cli' label='CLI'>

Run with the default configuration (no API key required for basic usage):
For basic (unauthenticated) usage, you can connect directly to Context7's public
MCP server:

```bash
thv run context7
thv run context7-remote
```

If you have a Context7 API key for higher rate limits, you can pass it directly
as a command-line argument. You can store the key in a ToolHive secret and
retrieve it when starting the server:
Alternatively, run the local containerized MCP server with the default
configuration (no API key required for basic usage):

```bash
thv secret set context7
thv run context7 -- --api-key $(thv secret get context7)
thv run context7
```

Enable [network isolation](../guides-cli/network-isolation.mdx) using the
Expand All @@ -91,10 +86,18 @@ default profile from the registry to restrict the server's network access:
thv run --isolate-network context7
```

If you have a Context7 API key for higher rate limits, create a secret named
`context7` containing your API key and run the server with the `--secret` flag:

```bash
thv secret set context7
thv run --secret context7,target=CONTEXT7_API_KEY context7
```

Combine API key with network isolation:

```bash
thv run --isolate-network context7 -- --api-key $(thv secret get context7)
thv run --secret context7,target=CONTEXT7_API_KEY --isolate-network context7
```

</TabItem>
Expand All @@ -109,7 +112,7 @@ metadata:
name: context7
namespace: toolhive-system
spec:
image: ghcr.io/stacklok/dockyard/npx/context7:1.0.14
image: ghcr.io/stacklok/dockyard/npx/context7:1.0.21
transport: stdio
port: 8080
```
Expand All @@ -120,21 +123,23 @@ Apply the manifest to your cluster:
kubectl apply -f context7.yaml
```

For higher rate limits, add your API key as a command-line argument:
If you have a Context7 API key for higher rate limits, create a Kubernetes
secret containing your Context7 API key:

```yaml {8} title="context7-with-auth.yaml"
apiVersion: toolhive.stacklok.dev/v1alpha1
kind: MCPServer
metadata:
name: context7
namespace: toolhive-system
```bash
kubectl -n toolhive-system create secret generic context7-api-key --from-literal=token=<YOUR_TOKEN>
```

Then add a `secrets` section to the manifest file above to pass the API key as
an environment variable:

```yaml title="context7-with-auth.yaml"
spec:
image: ghcr.io/stacklok/dockyard/npx/context7:1.0.14
args:
- '--api-key'
- 'YOUR_API_KEY'
transport: stdio
port: 8080
# ...
secrets:
- name: context7-api-key
key: token
targetEnvName: CONTEXT7_API_KEY
```

</TabItem>
Expand All @@ -159,10 +164,10 @@ Here are practical prompts you can use with the Context7 MCP server:

## Recommended practices

- Add `use context7` to your prompts to automatically fetch up-to-date
- Include `use context7` in your prompts to automatically fetch current
documentation for the libraries you're working with.
- When you know the exact library, you can specify it directly using the
Context7 ID format: `use library /supabase/supabase for api and docs`
- When you know the exact library, specify it directly using the Context7 ID
format, for example: `use library /supabase/supabase for api and docs`
- Consider setting up a rule in your MCP client to automatically invoke Context7
for code-related queries, eliminating the need to manually add `use context7`
to each prompt.
Expand Down
4 changes: 2 additions & 2 deletions docs/toolhive/guides-mcp/fetch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_label: Fetch
description: Using the Fetch MCP server with ToolHive to retrieve website data.
last_update:
author: danbarr
date: 2025-08-15
date: 2025-10-07
---

## Overview
Expand Down Expand Up @@ -80,7 +80,7 @@ metadata:
name: fetch
namespace: toolhive-system
spec:
image: ghcr.io/stackloklabs/gofetch/server:0.0.5
image: ghcr.io/stackloklabs/gofetch/server:1.0.1
transport: streamable-http
targetPort: 8080
port: 8080
Expand Down
4 changes: 2 additions & 2 deletions docs/toolhive/guides-mcp/github.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description:
Using the GitHub MCP server with ToolHive for repository management.
last_update:
author: danbarr
date: 2025-08-15
date: 2025-10-07
---

## Overview
Expand Down Expand Up @@ -141,7 +141,7 @@ metadata:
name: github
namespace: toolhive-system
spec:
image: ghcr.io/github/github-mcp-server:v0.13.0
image: ghcr.io/github/github-mcp-server:v0.17.1
transport: stdio
port: 8080
secrets:
Expand Down
4 changes: 2 additions & 2 deletions docs/toolhive/guides-mcp/k8s.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description:
Using the Kubernetes (MKP) MCP server with ToolHive for cluster management.
last_update:
author: danbarr
date: 2025-09-02
date: 2025-10-07
---

## Overview
Expand Down Expand Up @@ -132,7 +132,7 @@ metadata:
name: mkp
namespace: toolhive-system
spec:
image: ghcr.io/stackloklabs/mkp/server:0.2.1
image: ghcr.io/stackloklabs/mkp/server:0.2.4
transport: streamable-http
targetPort: 8080
port: 8080
Expand Down
Loading