Skip to content

Commit 34bd170

Browse files
committed
feat(docs): simplify Hyperf integration instructions in README files
1 parent 54d1e2a commit 34bd170

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,18 @@ composer require dtyq/php-mcp
2828

2929
### Hyperf Framework Quick Integration
3030

31-
If you're using Hyperf framework, integration is just two steps away:
31+
If you're using Hyperf framework, integration is extremely simple:
3232

3333
```php
34-
// 1. Register route
34+
// Just one line of code!
3535
Router::post('/mcp', function () {
3636
return di(HyperfMcpServer::class)->handler();
3737
});
38-
39-
// 2. Register tools (optional)
40-
$server->registerTool(
41-
new Tool('echo', [...], 'Echo a message'),
42-
function(array $args): array {
43-
return ['response' => $args['message']];
44-
}
45-
);
4638
```
4739

4840
**Advanced Options**:
4941
- 🔐 **AuthenticatorInterface** - Custom authentication
50-
- 📊 **HttpTransportAuthenticatedEvent** - Dynamic TransportMetadata management
42+
- 📊 **HttpTransportAuthenticatedEvent** - Dynamic tool/resource registration
5143

5244
👉 [View Complete Hyperf Integration Guide](./docs/en/server/hyperf-integration.md)
5345

README_CN.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,18 @@ composer require dtyq/php-mcp
2828

2929
### Hyperf 框架快速集成
3030

31-
如果您使用 Hyperf 框架,只需两步即可完成集成
31+
如果您使用 Hyperf 框架,集成极其简单
3232

3333
```php
34-
// 1. 注册路由
34+
// 只需一行代码!
3535
Router::post('/mcp', function () {
3636
return di(HyperfMcpServer::class)->handler();
3737
});
38-
39-
// 2. 注册工具(可选)
40-
$server->registerTool(
41-
new Tool('echo', [...], '回显消息'),
42-
function(array $args): array {
43-
return ['response' => $args['message']];
44-
}
45-
);
4638
```
4739

4840
**高级选项**
4941
- 🔐 **AuthenticatorInterface** - 自定义认证
50-
- 📊 **HttpTransportAuthenticatedEvent** - 动态管理 TransportMetadata
42+
- 📊 **HttpTransportAuthenticatedEvent** - 动态工具/资源注册
5143

5244
👉 [查看完整 Hyperf 集成指南](./docs/cn/server/hyperf-integration.md)
5345

0 commit comments

Comments
 (0)