PHPackages                             stribus/mcp-flightphp-server-skeleton - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. stribus/mcp-flightphp-server-skeleton

ActiveLibrary[Framework](/categories/framework)

stribus/mcp-flightphp-server-skeleton
=====================================

A Flight PHP framework skeleton app for MCP Server

1.0.1(9mo ago)04[1 issues](https://github.com/stribus/mcp-flightphp-server-skeleton/issues)MITPHPPHP ^7.4 || ^8.0

Since Aug 14Pushed 9mo agoCompare

[ Source](https://github.com/stribus/mcp-flightphp-server-skeleton)[ Packagist](https://packagist.org/packages/stribus/mcp-flightphp-server-skeleton)[ RSS](/packages/stribus-mcp-flightphp-server-skeleton/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

MCP Server for VS Code Copilot
==============================

[](#mcp-server-for-vs-code-copilot)

A PHP-based Model Context Protocol (MCP) server skeleton that supports both **HTTP** and **stdio** communication methods. This server can be integrated with VS Code Copilot and other MCP-compatible clients.

Features
--------

[](#features)

- **Dual Communication**: HTTP REST API and stdio (JSON-RPC 2.0)
- **Auto-discovery**: Automatically discovers tools, prompts, and resources
- **Code Generation**: Built-in commands to generate new tools and prompts
- **Flight PHP Framework**: Lightweight and fast PHP framework
- **Logging**: Comprehensive logging for debugging
- **Testing Scripts**: Ready-to-use test scripts for both modes

Quick Start
-----------

[](#quick-start)

1. **Install**Run this command from the directory in which you want to install your new Flight PHP application. (this will require PHP 7.4 or newer)

    ```
     composer create-project stribus/mcp-flightphp-server-skeleton cool-project-name
    ```

Run this command from the directory in which you want to install your new Flight PHP application. (this will require PHP 7.4 or newer)

2. **Test HTTP Server**

    ```
    composer start
    # or
    php -S localhost:8000 -t public
    ```
3. **Test stdio Server**

    ```
    php mcp-server.php
    ```

Usage Methods
-------------

[](#usage-methods)

### 1. HTTP Server Mode

[](#1-http-server-mode)

The HTTP server exposes MCP functionality via REST endpoints:

**Start the server:**

```
composer start
```

**Available endpoints:**

- `GET /` - Server information
- `POST /tools/list` - List available tools
- `POST /tools/call` - Execute a tool
- `POST /prompts/list` - List available prompts
- `POST /prompts/get` - Get a prompt
- `POST /resources/list` - List available resources
- `POST /resources/read` - Read a resource

**Test the HTTP server:**

```
# Windows PowerShell
.\test-http-server.ps1

# Or manually test endpoints
curl -X POST http://localhost:8000/tools/list
curl -X POST http://localhost:8000/tools/call -H "Content-Type: application/json" -d '{"name":"hello-world-tool","arguments":{"firstName":"John","lastName":"Doe"}}'
```

### 2. stdio Mode (JSON-RPC 2.0)

[](#2-stdio-mode-json-rpc-20)

The stdio server communicates via standard input/output using JSON-RPC 2.0 protocol:

**Start the server:**

```
php mcp-server.php
```

**Test JSON-RPC commands:**

```
# Windows PowerShell
.\test-mcp-server.ps1

# Or send commands manually
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | php mcp-server.php
echo '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' | php mcp-server.php
echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"hello-world-tool","arguments":{"firstName":"VS Code","lastName":"Copilot"}}}' | php mcp-server.php
```

### 3. VS Code Integration

[](#3-vs-code-integration)

For VS Code Copilot integration, configure the MCP server in your VS Code settings:

**mcp-config.json example:**

```
{
  "mcpServers": {
    "php-mcp-server": {
      "command": "php",
      "args": ["path/to/mcp-server.php"],
      "env": {}
    }
  }
}
```

Creating Tools
--------------

[](#creating-tools)

Tools are executable functions that can be called by MCP clients.

### Generate a new tool:

[](#generate-a-new-tool)

```
vendor/bin/runway make:tool MyCustomTool
```

### Tool Structure:

[](#tool-structure)

```
