Skip to content

Commit 46517db

Browse files
committed
Add playground guide
1 parent 4b6524e commit 46517db

12 files changed

+266
-0
lines changed
Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
1+
---
2+
title: Test MCP servers with Playground
3+
description:
4+
Use the Playground feature to test and validate MCP servers directly in the
5+
ToolHive UI with AI model providers.
6+
---
7+
8+
import useBaseUrl from '@docusaurus/useBaseUrl';
9+
import ThemedImage from '@theme/ThemedImage';
10+
11+
The Playground feature in ToolHive allows you to test and validate MCP servers
12+
directly within the UI, without requiring additional client setup. This
13+
streamlined testing environment helps teams quickly evaluate functionality and
14+
behavior before deploying MCP servers to production environments.
15+
16+
<ThemedImage
17+
alt='ToolHive Playground initial interface'
18+
sources={{
19+
light: useBaseUrl('/img/toolhive/toolhive-ui-playground-start-ligh.webp'),
20+
dark: useBaseUrl('/img/toolhive/toolhive-ui-playground-start-dark.webp'),
21+
}}
22+
title='ToolHive Playground initial interface'
23+
/>
24+
25+
## Key capabilities
26+
27+
### Instant testing of MCP servers
28+
29+
Enter an AI model API key, select your MCP servers and tools, and begin testing
30+
immediately—right inside the desktop app. The Playground eliminates the friction
31+
of setting up external AI clients just to validate that your MCP servers are
32+
working correctly.
33+
34+
### Transparent audit logs
35+
36+
See tool details, parameters, and execution results directly in the UI, ensuring
37+
full visibility into tool performance and responses. Every interaction is
38+
logged, making it easy to understand exactly what your MCP servers are doing and
39+
how they're responding to requests.
40+
41+
### Integrated ToolHive management
42+
43+
The Playground includes a dedicated MCP server for ToolHive itself, allowing you
44+
to manage your MCP servers directly through natural language commands. You can
45+
list servers, check their status, start or stop them, and perform other
46+
management tasks using conversational AI.
47+
48+
## Getting started
49+
50+
To start using the Playground feature:
51+
52+
1. **Access the Playground**: Click the **Playground** tab in the ToolHive UI
53+
navigation bar.
54+
55+
2. **Configure API keys**: Click **Configure your API Keys** to set up access to
56+
AI model providers.
57+
58+
<ThemedImage
59+
alt='ToolHive Playground API keys configuration'
60+
sources={{
61+
light: useBaseUrl(
62+
'/img/toolhive/toolhive-ui-playground-api-keys-light.webp'
63+
),
64+
dark: useBaseUrl('/img/toolhive/toolhive-ui-playground-api-keys-dark.webp'),
65+
}}
66+
title='API keys configuration modal'
67+
/>
68+
69+
- **OpenAI**: Enter your OpenAI API key to use GPT models
70+
- **Anthropic**: Add your Anthropic API key for Claude models
71+
- **Google**: Configure Google AI API key for Gemini models
72+
- **xAI**: Set up xAI API key for Grok models
73+
- **OpenRouter**: Add OpenRouter API key for access to multiple model providers
74+
75+
3. **Select MCP tools**: Click the tools icon to manage which MCP servers and
76+
tools are available in the Playground.
77+
78+
<ThemedImage
79+
alt='ToolHive Playground tools management showing available MCP tools'
80+
sources={{
81+
light: useBaseUrl(
82+
'/img/toolhive/toolhive-ui-playground-thv-mcp-light.webp'
83+
),
84+
dark: useBaseUrl('/img/toolhive/toolhive-ui-playground-thv-mcp-dark.webp'),
85+
}}
86+
title='MCP tools management interface'
87+
/>
88+
89+
- View all your running MCP servers
90+
- Enable or disable specific tools from each server
91+
- Search and filter tools by name or functionality
92+
- The `toolhive mcp` server is included by default, providing management
93+
capabilities
94+
95+
4. **Start testing**: Begin chatting with your chosen AI model. The model will
96+
have access to all enabled MCP tools and can execute them based on your
97+
requests.
98+
99+
<ThemedImage
100+
alt='ToolHive Playground chat interface with AI model and MCP tools'
101+
sources={{
102+
light: useBaseUrl(
103+
'/img/toolhive/toolhive-ui-playground-start-chat-ligh.webp'
104+
),
105+
dark: useBaseUrl(
106+
'/img/toolhive/toolhive-ui-playground-start-chat-dark.webp'
107+
),
108+
}}
109+
title='Playground chat interface in action'
110+
/>
111+
112+
## Using the Playground
113+
114+
### Testing MCP server functionality
115+
116+
The Playground is ideal for validating that your MCP servers work as expected:
117+
118+
```text
119+
Can you list all my MCP servers and show their current status?
120+
```
121+
122+
The AI will use the `list_servers` tool from the ToolHive MCP server to provide
123+
a comprehensive overview of your server status.
124+
125+
<ThemedImage
126+
alt='ToolHive Playground showing AI response with MCP tool execution results'
127+
sources={{
128+
light: useBaseUrl(
129+
'/img/toolhive/toolhive-ui-playground-chat-response-light.webp'
130+
),
131+
dark: useBaseUrl(
132+
'/img/toolhive/toolhive-ui-playground-chat-response-dark.webp'
133+
),
134+
}}
135+
title='Chat response showing tool execution and results'
136+
/>
137+
138+
```text
139+
Use the GitHub MCP server to search for recent issues in the microsoft/vscode repository
140+
```
141+
142+
If you have the GitHub MCP server running, the AI will execute the appropriate
143+
GitHub API calls and return formatted results.
144+
145+
### Managing servers through conversation
146+
147+
The ToolHive desktop app automatically spins up a dedicated MCP server
148+
(`toolhive mcp`) that orchestrates ToolHive operations through natural language
149+
commands. This approach provides several key benefits:
150+
151+
- **Unified interface**: Manage your MCP infrastructure using the same
152+
conversational AI interface you use for testing
153+
- **Contextual operations**: The AI understands your current server state and
154+
can make intelligent decisions about which servers to start, stop, or
155+
troubleshoot
156+
- **Reduced complexity**: No need to switch between the chat interface and
157+
traditional UI controls—everything can be done through conversation
158+
- **Audit trail**: All management operations are logged in the same transparent
159+
way as tool executions, providing clear visibility into what actions were
160+
taken
161+
162+
Take advantage of these integrated ToolHive management tools:
163+
164+
```text
165+
Start the fetch MCP server for me
166+
```
167+
168+
```text
169+
Stop all unhealthy MCP servers
170+
```
171+
172+
```text
173+
Show me the logs for the meta-mcp server
174+
```
175+
176+
### Validating tool responses
177+
178+
The Playground shows detailed information about each tool execution:
179+
180+
- **Tool name and description**: What tool was called and its purpose
181+
- **Input parameters**: The exact parameters passed to the tool
182+
- **Execution status**: Whether the tool succeeded or failed
183+
- **Response data**: The complete response from the tool
184+
- **Timing information**: How long the tool took to execute
185+
186+
This visibility helps you understand exactly how your MCP servers are behaving
187+
and identify any issues with tool implementation or configuration.
188+
189+
## Best practices
190+
191+
### API key security
192+
193+
- Use dedicated API keys for testing that have appropriate rate limits
194+
- Regularly rotate API keys used in development environments
195+
- Consider using API keys with restricted permissions for testing purposes
196+
197+
### Server management
198+
199+
- Start only the MCP servers you need for testing to improve performance
200+
- Use the Playground to validate new server configurations before connecting
201+
them to production AI clients
202+
- Test different combinations of tools to understand how they work together
203+
204+
### Testing workflow
205+
206+
1. **Isolated testing**: Test individual MCP servers one at a time to validate
207+
their functionality
208+
2. **Integration testing**: Enable multiple servers to test how they work
209+
together
210+
3. **Performance validation**: Monitor tool execution times and responses under
211+
different loads
212+
4. **Error handling**: Intentionally trigger error conditions to validate proper
213+
error handling
214+
215+
## Troubleshooting
216+
217+
### Common issues
218+
219+
<details>
220+
<summary>API key not working</summary>
221+
222+
If your API key isn't working:
223+
224+
1. Verify the API key is correct and has proper permissions
225+
2. Check that you have sufficient quota or credits with the provider
226+
3. Ensure the API key hasn't expired or been revoked
227+
4. Try creating a new API key from the provider's dashboard
228+
229+
</details>
230+
231+
<details>
232+
<summary>MCP tools not appearing</summary>
233+
234+
If your MCP server tools aren't showing up:
235+
236+
1. Verify the MCP server is running (check the **MCP Servers** page)
237+
2. Click the tools icon and ensure the server's tools are enabled
238+
3. Try restarting the MCP server if it shows as unhealthy
239+
4. Check the server logs for any error messages
240+
241+
</details>
242+
243+
<details>
244+
<summary>Tool execution failing</summary>
245+
246+
If tools are failing to execute:
247+
248+
1. Check the tool's parameter requirements in the audit log
249+
2. Verify any required secrets or environment variables are configured
250+
3. Ensure the MCP server has necessary permissions (network access, file system
251+
access)
252+
4. Review the server logs for detailed error information
253+
254+
</details>
255+
256+
## Next steps
257+
258+
- Learn more about [client configuration](./client-configuration.mdx) to connect
259+
ToolHive to external AI applications
260+
- Set up [secrets management](./secrets-management.md) for secure handling of
261+
API keys and tokens
262+
- Explore [network isolation](./network-isolation.mdx) for enhanced security
263+
when testing untrusted MCP servers
264+
- Check out the [registry](./registry.mdx) to discover new MCP servers to test
265+
in the Playground

sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const sidebars: SidebarsConfig = {
4949
'toolhive/guides-ui/install',
5050
'toolhive/guides-ui/registry',
5151
'toolhive/guides-ui/run-mcp-servers',
52+
'toolhive/guides-ui/playground',
5253
'toolhive/guides-ui/network-isolation',
5354
'toolhive/guides-ui/secrets-management',
5455
'toolhive/guides-ui/client-configuration',
16.1 KB
Loading
16.5 KB
Loading
30.9 KB
Loading
40.5 KB
Loading
13.5 KB
Loading
13.8 KB
Loading
20.5 KB
Loading
16 KB
Loading

0 commit comments

Comments
 (0)