A demonstration project showcasing a Model Context Protocol (MCP) server implementation in PHP, featuring a calculator service with configurable settings and employee data management.
- PHP 8.0 or higher
- Composer
- Clone this repository:
git clone <repository-url>
cd php-mcp-demo
- Install dependencies:
composer install
Run the MCP server:
php index.php
It will be available at: http://127.0.0.1:8080
;
Want to use this server with Claude or any AI that supports MCP? Follow these steps:
- Expose the local server using ngrok:
ngrok http 8080
- Copy the ngrok URL (e.g., https://abc123.ngrok.io)
- Create a connector in Claude pointing to:
https://abc123.ngrok.io/mcp
Done! You can now use the calculator and employee tools directly via Claude.