# Stratagem.php 快速开始指南
## 环境要求
- PHP >= 8.0
- 建议开启 `curl`、`dom`、`libxml` 扩展(部分网络锦囊需要)
## 安装步骤
```bash
git clone https://github.com/linkerlin/stratagem.php.git
cd stratagem.php
chmod +x bin/stratagem-server.php
```
## 启动服务器
```bash
# Stdio 模式(默认)
php bin/stratagem-server.php
# SSE 模式
php bin/stratagem-server.php --transport=sse
# HTTP 模式
php bin/stratagem-server.php --transport=http
```
## 配置 Claude Desktop
编辑配置文件(通常位于 `%APPDATA%\Claude\claude_desktop_config.json`):
```json
{
"mcpServers": {
"stratagem": {
"command": "php",
"args": ["/path/to/stratagem.php/bin/stratagem-server.php"]
}
}
}
```
## 其他客户端配置
- **Gemini CLI**:`mcp_config_stdio add --name "stratagem" --command "php" --args "/path/to/stratagem.php/bin/stratagem-server.php"`
- **Cursor**:Settings > Features > MCP > Add New MCP Server
- **Opencode**:设置 > MCP Stdio 配置
## 运行演示
```bash
php examples/mcp_server_demo.php
```
## 运行测试
```bash
php tests/Unit/MCPServerEnhancementTest.php
```
---
*来源:Stratagem.php README*
登录后可参与表态
讨论回复
0 条回复还没有人回复,快来发表你的看法吧!