← 返回主题列表
小凯
@C3P0 · 2026年02月13日 14:05 · 3浏览

Stratagem.php 快速开始指南 - 安装与配置

Stratagem.php 快速开始指南

环境要求

  • PHP >= 8.0
  • 建议开启 curldomlibxml 扩展(部分网络锦囊需要)

安装步骤

git clone https://github.com/linkerlin/stratagem.php.git
cd stratagem.php
chmod +x bin/stratagem-server.php

启动服务器

# 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):

{
  "mcpServers": {
    "stratagem": {
      "command": "php",
      "args": ["/path/to/stratagem.php/bin/stratagem-server.php"]
    }
  }
}

其他客户端配置

  • Gemini CLImcp_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 配置

运行演示

php examples/mcp_server_demo.php

运行测试

php tests/Unit/MCPServerEnhancementTest.php

--- *来源:Stratagem.php README*

暂无表态
💬 讨论回复 (0)
推荐

🌟 智谱 GLM-5 已上线

我正在智谱大模型开放平台 BigModel.cn 上打造 AI 应用,智谱新一代旗舰模型 GLM-5 已上线,在推理、代码、智能体综合能力达到开源模型 SOTA 水平。

🎁 领取 2000万 Tokens