Skip to content

Commit 1a16ded

Browse files
author
klapaudius
committed
Update README with prompts documentation and testing commands
- Added a section on creating and registering custom prompts. - Documented `make:mcp-prompt` and `mcp:test-prompt` commands for generating and testing prompts. - Updated prompt implementation status to compliant with MCP specification. - Improved guidance on manual prompt registration and usage.
1 parent 133a2d3 commit 1a16ded

File tree

1 file changed

+57
-3
lines changed

1 file changed

+57
-3
lines changed

README.md

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ Key benefits:
7575
- KLP\KlpMcpServer\Services\ToolService\Examples\ProfileGeneratorTool
7676
- KLP\KlpMcpServer\Services\ToolService\Examples\StreamingDataTool
7777
- KLP\KlpMcpServer\Services\ToolService\Examples\VersionCheckTool
78+
prompts:
79+
- KLP\KlpMcpServer\Services\PromptService\Examples\HelloWorldPrompt
7880
resources:
7981
- KLP\KlpMcpServer\Services\ResourceService\Examples\HelloWorldResource
8082
resources_templates:
@@ -168,7 +170,59 @@ This helps you rapidly develop and debug tools by:
168170

169171
**For deep diving into tools creation please take a look at dedicated documentation [Here](https://github.com/klapaudius/symfony-mcp-server/blob/master/docs/building_tools.md)**
170172

171-
### Visualizing MCP Tools with Inspector
173+
### Creating and Adding Custom Prompts
174+
175+
The package provides convenient commands to generate new prompts:
176+
177+
```bash
178+
php bin/console make:mcp-prompt MyCustomPrompt
179+
```
180+
181+
This command:
182+
183+
- Handles various input formats (spaces, hyphens, mixed case)
184+
- Automatically converts the name to the proper kebab-case format
185+
- Creates a properly structured prompt class in `src/MCP/Prompts`
186+
- Offers to automatically register the prompt in your configuration
187+
188+
You can also manually create and register prompts in `config/packages/klp_mcp_server.yaml`:
189+
190+
```php
191+
use KLP\KlpMcpServer\Services\PromptService\PromptInterface;
192+
use KLP\KlpMcpServer\Services\PromptService\Message\TextPromptMessage;
193+
194+
class MyCustomPrompt implements PromptInterface
195+
{
196+
// Prompt implementation
197+
}
198+
```
199+
200+
### Testing MCP Prompts
201+
202+
The package includes a command for testing your MCP prompts without needing a real MCP client:
203+
204+
```bash
205+
# Test a specific prompt interactively
206+
php bin/console mcp:test-prompt MyCustomPrompt
207+
208+
# List all available prompts
209+
php bin/console mcp:test-prompt --list
210+
211+
# Test with specific arguments
212+
php bin/console mcp:test-prompt MyCustomPrompt --arguments='{"topic":"AI","tone":"professional"}'
213+
```
214+
215+
This helps you rapidly develop and debug prompts by:
216+
217+
- Showing the prompt's argument schema and validating inputs
218+
- Executing the prompt with your provided arguments
219+
- Displaying formatted message results with proper role assignments
220+
- Supporting complex argument types including objects and arrays
221+
- Demonstrating multi-modal content (text, images, audio, resources)
222+
223+
**For deep diving into prompts creation please take a look at dedicated documentation [Here](https://github.com/klapaudius/symfony-mcp-server/blob/master/docs/building_prompts.md)**
224+
225+
### Visualizing with Inspector
172226

173227
You can also use the Model Context Protocol Inspector to visualize and test your MCP tools:
174228

@@ -193,7 +247,7 @@ This will typically open a web interface at `localhost:6274`. To test your MCP s
193247
| 2025-03-26 (Streamable HTTP) | `http(s)://[your-web-server]/[default_path]` |
194248
| | `default_path` is defined in your `config/packages/klp_mcp_server.yaml` file. |
195249

196-
3. Connect and explore available tools visually
250+
3. Connect and explore available items visually
197251

198252
## Advanced Features
199253

@@ -298,7 +352,7 @@ We are committed to actively pursuing the following key initiatives to enhance t
298352
- **Core Features:**
299353
- ✅ Resources implementation compliant with MCP specification.
300354
- ✅ Support for Streamable HTTP (as specified in MCP 2025-03-26 version).
301-
- ⏳️ Prompts implementation compliant with MCP specification.
355+
- Prompts implementation compliant with MCP specification.
302356
- **Additional Adaptaters:**
303357
- Support for more Pub/Sub adapters (e.g., RabbitMQ).
304358

0 commit comments

Comments
 (0)