PHP code example of hi / mcp-server

1. Go to this page and download the library: Download hi/mcp-server library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hi / mcp-server example snippets

bash
# 在 mcp-server 包目录下生成文档
cd vendor/hi/mcp-server
php bin/mcp-generate \
  --src=../framework/src \
  --docs=../framework/docs \
  --output=.mcp
bash
# 默认使用包自身的 .mcp 目录
php bin/mcp-server