Skip to content

Commit 00a6fc8

Browse files
author
klapaudius
committed
Improve README documentation for tools, prompts, and resource management
- Added sections on creating and testing prompts and resources. - Updated examples and usage instructions. - Enhanced clarity, fixed typos, and restructured headings. - Updated roadmap details and documentation links.
1 parent 6e830aa commit 00a6fc8

File tree

1 file changed

+77
-119
lines changed

1 file changed

+77
-119
lines changed

README.md

Lines changed: 77 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<a href="https://github.com/klapaudius/symfony-mcp-server/actions"><img src="https://github.com/klapaudius/symfony-mcp-server/actions/workflows/tests.yml/badge.svg" alt="Build Status"></a>
99
<a href="https://codecov.io/gh/klapaudius/symfony-mcp-server" > <img src="https://codecov.io/gh/klapaudius/symfony-mcp-server/graph/badge.svg?token=5FXOJVXPZ1" alt="Coverage"/></a>
1010
<a href="https://packagist.org/packages/klapaudius/symfony-mcp-server"><img src="https://img.shields.io/packagist/l/klapaudius/symfony-mcp-server" alt="License"></a>
11+
<a href="https://packagist.org/packages/klapaudius/symfony-mcp-server"><img src="https://img.shields.io/packagist/v/klapaudius/symfony-mcp-server" alt="Latest Stable Version"></a>
1112

12-
[//]: # (<a href="https://packagist.org/packages/klapaudius/symfony-mcp-server"><img src="https://img.shields.io/packagist/v/klapaudius/symfony-mcp-server" alt="Latest Stable Version"></a>)
1313
[//]: # (<a href="https://packagist.org/packages/klapaudius/symfony-mcp-server"><img src="https://img.shields.io/packagist/dt/klapaudius/symfony-mcp-server" alt="Total Downloads"></a>)
1414
</p>
1515

@@ -40,9 +40,9 @@ Key benefits:
4040
## Key Features
4141

4242
- Real-time communication support through StreamableHTTP and/or Server-Sent Events (SSE) integration
43-
- Implementation of tools and resources compliant with Model Context Protocol specifications
44-
- Support of streaming tools with progres notifications
45-
- Support different types of tool results such as Text, Image, Audio, or Resource
43+
- Implementation of tools, resources and prompts compliant with Model Context Protocol specifications
44+
- Support of streaming tools with progress notifications
45+
- Support different types of tool results such as Text, Image, Audio or Resource
4646
- Adapter-based design architecture with Pub/Sub messaging pattern
4747

4848
## Requirements
@@ -116,111 +116,122 @@ Enhance your application's security by implementing OAuth2 Authentication. You c
116116

117117
## Basic Usage
118118

119-
### Creating and Adding Custom Tools
120-
121-
The package provides convenient commands to generate new tools:
119+
### Creating and Adding Custom Tools or Prompts
122120

121+
The package provides convenient commands
122+
- to generate new tools:
123123
```bash
124124
php bin/console make:mcp-tool MyCustomTool
125125
```
126+
- to generate new prompts:
127+
```bash
128+
php bin/console make:mcp-prompt MyCustomPrompt
129+
```
126130

127-
This command:
131+
Those commands:
128132

129133
- Handles various input formats (spaces, hyphens, mixed case)
130134
- Automatically converts the name to the proper case format
131-
- Creates a properly structured tool class in `src/MCP/Tools`
132-
- Offers to automatically register the tool in your configuration
135+
- Creates a properly structured class in `src/MCP/Tools` or `src/MCP/Prompts`
136+
- Offers to automatically register items in your configuration (`config/packages/klp_mcp_server.yaml`)
133137

134-
You can also manually create and register tools in `config/packages/klp_mcp_server.yaml`:
135-
136-
```php
137-
use KLP\KlpMcpServer\Services\ProgressService\ProgressNotifierInterface;
138-
use KLP\KlpMcpServer\Services\ToolService\Annotation\ToolAnnotation;
139-
use KLP\KlpMcpServer\Services\ToolService\Result\ToolResultInterface;
140-
use KLP\KlpMcpServer\Services\ToolService\StreamableToolInterface;
141-
142-
class MyCustomTool implements StreamableToolInterface
143-
{
144-
// Tool implementation
145-
}
146-
```
147-
148-
### Testing MCP Tools
138+
### Testing MCP Tools or Prompts
149139

150140
The package includes a special command for testing your MCP tools without needing a real MCP client:
151141

152142
```bash
153143
# Test a specific tool interactively
154144
php bin/console mcp:test-tool MyCustomTool
155145
146+
# Test a specific prompt interactively
147+
php bin/console mcp:test-prompt MyCustomPrompt
148+
156149
# List all available tools
157150
php bin/console mcp:test-tool --list
158151
152+
# List all available prompts
153+
php bin/console mcp:test-prompt --list
154+
159155
# Test with specific JSON input
160156
php bin/console mcp:test-tool MyCustomTool --input='{"param1":"value"}'
157+
158+
# Test with specific arguments
159+
php bin/console mcp:test-prompt MyCustomPrompt --arguments='{"topic":"AI","tone":"professional"}'
161160
```
162161

163162
This helps you rapidly develop and debug tools by:
164163

165-
- Showing the tool's input schema and validating inputs
166-
- Executing the tool with your provided input
164+
- Showing the item's input schema and validating inputs
165+
- Executing the item with your provided input
167166
- Displaying formatted results or detailed error information
168-
- Displaying progress notifications for streaming tool
167+
- Displaying progress notifications for a streaming tool
169168
- Supporting complex input types including objects and arrays
170169

171-
**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)**
170+
**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)**
172171

173-
### Creating and Adding Custom Prompts
172+
**For prompts creation: [Here](https://github.com/klapaudius/symfony-mcp-server/blob/master/docs/building_prompts.md)**
174173

175-
The package provides convenient commands to generate new prompts:
174+
## Resources
176175

177-
```bash
178-
php bin/console make:mcp-prompt MyCustomPrompt
179-
```
176+
The package provides a flexible resource management system that allows you to store and retrieve resources from different providers (file system, database, etc.).
180177

181-
This command:
178+
### Configuration
182179

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
180+
Configure resources in your `config/packages/klp_mcp_server.yaml` file:
181+
182+
```yaml
183+
klp_mcp_server:
184+
# ...
185+
resources:
186+
- App\MCP\Resources\MyCustomResource
187+
resources_templates:
188+
- App\MCP\Resources\MyCustomResourceTemplate
189+
```
187190

188-
You can also manually create and register prompts in `config/packages/klp_mcp_server.yaml`:
191+
### Usage
192+
193+
### Creating Custom Resource
189194

190195
```php
191-
use KLP\KlpMcpServer\Services\PromptService\PromptInterface;
192-
use KLP\KlpMcpServer\Services\PromptService\Message\TextPromptMessage;
196+
use KLP\KlpMcpServer\Services\ResourceService\ResourceInterface;
193197
194-
class MyCustomPrompt implements PromptInterface
198+
class MyCustomResource implements ResourceInterface
195199
{
196-
// Prompt implementation
200+
// Resource implementation
197201
}
198202
```
203+
Then register your resource in the configuration:
199204

200-
### Testing MCP Prompts
205+
```yaml
206+
klp_mcp_server:
207+
# ...
208+
resources:
209+
- App\MCP\Resources\MyCustomResource
210+
```
201211

202-
The package includes a command for testing your MCP prompts without needing a real MCP client:
212+
### Creating Custom Resource Template
203213

204-
```bash
205-
# Test a specific prompt interactively
206-
php bin/console mcp:test-prompt MyCustomPrompt
214+
You can create custom resource templates by implementing the `ResourceTemplateInterface`:
207215

208-
# List all available prompts
209-
php bin/console mcp:test-prompt --list
216+
```php
217+
use KLP\KlpMcpServer\Services\ResourceService\ResourceTemplateInterface;
210218
211-
# Test with specific arguments
212-
php bin/console mcp:test-prompt MyCustomPrompt --arguments='{"topic":"AI","tone":"professional"}'
219+
class MyCustomResourceTemplate implements ResourceTemplateInterface
220+
{
221+
// Implement the required methods
222+
}
213223
```
214224

215-
This helps you rapidly develop and debug prompts by:
225+
Then register your resource template in the configuration:
216226

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)
227+
```yaml
228+
klp_mcp_server:
229+
# ...
230+
resources_templates:
231+
- App\MCP\Resources\MyCustomResourceTemplate
232+
```
222233

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)**
234+
**For deep diving into resources' management, please take a look at dedicated documentation [Here](https://github.com/klapaudius/symfony-mcp-server/blob/master/docs/building_resources.md)**
224235

225236
### Visualizing with Inspector
226237

@@ -272,7 +283,6 @@ This architecture enables:
272283

273284
A Redis adapter can be configured as follows:
274285

275-
276286
```yaml
277287
klp_mcp_server:
278288
# ...
@@ -284,67 +294,15 @@ klp_mcp_server:
284294
ttl: 100 # Message TTL in seconds
285295
```
286296

287-
## Resources
288-
289-
The package provides a flexible resource management system that allows you to store and retrieve resources from different providers (file system, database, etc.).
290-
291-
### Configuration
292-
293-
Configure resources in your `config/packages/klp_mcp_server.yaml` file:
294-
295-
```yaml
296-
klp_mcp_server:
297-
# ...
298-
resources:
299-
- App\MCP\Resources\MyCustomResource
300-
resources_templates:
301-
- App\MCP\Resources\MyCustomResourceTemplate
302-
```
303-
304-
### Usage
305-
306-
### Creating Custom Resource
307-
308-
```php
309-
use KLP\KlpMcpServer\Services\ResourceService\ResourceInterface;
310-
311-
class MyCustomResource implements ResourceInterface
312-
{
313-
// Resource implementation
314-
}
315-
```
316-
Then register your resource in the configuration:
317-
318-
```yaml
319-
klp_mcp_server:
320-
# ...
321-
resources:
322-
- App\MCP\Resources\MyCustomResource
323-
```
324-
325-
### Creating Custom Resource Template
297+
## Roadmap
326298

327-
You can create custom resource templates by implementing the `ResourceTemplateInterface`:
299+
Our development roadmap outlines the planned enhancements and features for upcoming releases:
328300

329-
```php
330-
use KLP\KlpMcpServer\Services\ResourceService\ResourceTemplateInterface;
301+
- **Enhanced Protocol Support**: Continued improvements to StreamableHTTP implementation and stay up to date with newer specifications
302+
- **Sampling Feature Implementation**: Taking advantage of Client's Sampling Capability
331303

332-
class MyCustomResourceTemplate implements ResourceTemplateInterface
333-
{
334-
// Implement the required methods
335-
}
336-
```
337-
338-
Then register your resource template in the configuration:
339-
340-
```yaml
341-
klp_mcp_server:
342-
# ...
343-
resources_templates:
344-
- App\MCP\Resources\MyCustomResourceTemplate
345-
```
346-
347-
**For deep diving into resources' management, please take a look at dedicated documentation [Here](https://github.com/klapaudius/symfony-mcp-server/blob/master/docs/building_resources.md)**
304+
For detailed discussions about upcoming features and to contribute your ideas, please visit the [Discussion section](https://github.com/klapaudius/symfony-mcp-server/discussions).
305+
Community feedback plays a crucial role in shaping our development priorities.
348306

349307
## MCP Registries referencing
350308
https://mcpreview.com/mcp-servers/klapaudius/symfony-mcp-server

0 commit comments

Comments
 (0)