PHPackages                             mayur-saptal/php-mcp - 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. [Database &amp; ORM](/categories/database)
4. /
5. mayur-saptal/php-mcp

ActiveLibrary[Database &amp; ORM](/categories/database)

mayur-saptal/php-mcp
====================

A simple and scalable PHP implementation of the Model Context Protocol (MCP)

02PHP

Since Oct 13Pushed 6mo agoCompare

[ Source](https://github.com/mayursaptal/php-mcp-core)[ Packagist](https://packagist.org/packages/mayur-saptal/php-mcp)[ RSS](/packages/mayur-saptal-php-mcp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP MCP (Model Context Protocol)
================================

[](#php-mcp-model-context-protocol)

[![PHP Version](https://camo.githubusercontent.com/7663c9d53dc13cedaf0660a8745a7e77d2dd711257f36aa86ebce12a0600ef42/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d626c75652e737667)](https://php.net)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)![Build Status](https://camo.githubusercontent.com/c27a457659b89ee4f1f80f7995c559dd37f2051bde7167ad25791e5c5c92cc8e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c642d70617373696e672d627269676874677265656e2e737667)

A simple and scalable PHP implementation of the Model Context Protocol (MCP) for building AI-powered applications. This package provides a complete MCP server and client implementation with support for tools, resources, and prompts.

📋 Table of Contents
-------------------

[](#-table-of-contents)

- [Features](#-features)
- [Installation](#-installation)
- [Quick Start](#-quick-start)
- [MCP Capabilities](#mcp-capabilities-tools-resources-and-prompts)
- [Annotation Support](#annotation-support)
- [Advanced Usage](#advanced-usage)
- [Examples](#examples)
- [Testing](#testing)
- [Contributing](#contributing)
- [License](#license)
- [Requirements](#requirements)
- [Roadmap](#roadmap)

🚀 Features
----------

[](#-features)

- **🎯 Simple &amp; Clean API** - Easy to use and understand
- **🔧 Scalable Architecture** - Built with extensibility in mind
- **📡 Multiple Transports** - Support for stdio and custom transports
- **🛡️ Type Safe** - Full PHP 8.1+ type safety with strict typing
- **🧪 Well Tested** - Comprehensive test suite with 100% functionality
- **📚 Well Documented** - Clear examples and comprehensive documentation
- **🔌 MCP Compliant** - Full Model Context Protocol specification support
- **⚡ High Performance** - Optimized for production use
- **🏷️ Annotation Support** - PHP 8 attributes for clean, self-documenting code

📦 Installation
--------------

[](#-installation)

```
composer require mayur-saptal/php-mcp
```

🏃‍♂️ Quick Start
----------------

[](#‍️-quick-start)

### What is MCP?

[](#what-is-mcp)

The Model Context Protocol (MCP) is a standard for connecting AI assistants to external data sources and tools. It enables AI clients to:

- **Execute Tools** - Call functions on your server (calculations, API calls, etc.)
- **Access Resources** - Read files, databases, or any data source
- **Generate Prompts** - Create context-aware prompts for specific tasks

### Creating a Simple Server

[](#creating-a-simple-server)

```
