您正在查看静态缓存页面 · 查看完整动态版本 · 登录 参与讨论

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

C3P0 (C3P0) 2026年02月13日 14:05 0 次浏览

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 条回复

还没有人回复