server
Core PHP implementation for the Model Context Protocol (MCP) server
The PHP MCP Server SDK is a production-ready toolkit for building Model Context Protocol servers in PHP 8.1+, enabling PHP applications to expose tools, resources, and prompts to AI assistants like Claude, ChatGPT, and Cursor. It features attribute-based element discovery, multiple transport options (stdio, HTTP+SSE, streamable HTTP), automatic JSON schema generation, and ReactPHP-based async operations. Developers can quickly create MCP servers using PHP attributes to mark methods as tools or resources, with full dependency injection, session management, and PSR standards compliance. The SDK supports both simple command-line integrations and production HTTP deployments with SSL, middleware, and resumable connections.
Key Features
Use Cases
- 01Exposing PHP application APIs as MCP tools for AI assistants to query databases, send emails, or process data
- 02Creating file and configuration resource servers that AI agents can read and monitor
- 03Building prompt template libraries for standardized AI conversation starters in PHP applications
- 04Developing production MCP servers with HTTP transport for remote AI client access with SSL/TLS
- 05Integrating existing PHP business logic with Claude, ChatGPT, or Cursor via MCP protocol
- 06Creating user profile management systems accessible to AI assistants through resource templates
Related MCP Servers
View moremarkitdown
Python tool for converting files and office documents to Markdown.
firecrawl
The context API to search, scrape, and interact with the web at scale. 🔥
prompts.chat
f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.
langflow
Langflow is a powerful tool for building and deploying AI-powered agents and workflows.
server — FAQ
What is the PHP MCP Server SDK?+
It's a comprehensive PHP 8.1+ library for building Model Context Protocol (MCP) servers that expose PHP application functionality (tools, resources, prompts) to AI assistants like Claude, ChatGPT, and Cursor. It provides attribute-based discovery, multiple transport options, and production-ready features like session management and async operations.
How do I install the PHP MCP Server SDK?+
Install via Composer with 'composer require php-mcp/server'. Then create a server script using Server::make(), define elements with PHP attributes like #[McpTool], and configure your MCP client to run the script via stdio or HTTP transport.
Which MCP clients work with this server?+
It works with any MCP-compatible client including Claude Desktop, Cursor IDE, ChatGPT, and other AI assistants that support the Model Context Protocol 2025-03-26 specification with backward compatibility.
Do I need API keys or special prerequisites?+
You need PHP 8.1 or higher and Composer. No API keys are required for the SDK itself, though your specific tools may need API keys for external services they integrate with (databases, email providers, etc.).
Is the PHP MCP Server SDK free?+
Yes, it's open source under the MIT License and free to use for both personal and commercial projects.
What's the difference between stdio and HTTP transports?+
Stdio transport is for direct client execution via command-line (best for simple deployments), while HTTP/SSE and streamable HTTP are for remote access, multiple clients, and production deployments with SSL, middleware, and resumable connections.
How do I install server?+
Open the source repository on GitHub and follow its README. server is a mcp server — MCP Agents Market links you directly to the official repo.
Is server free?+
server is an open-source project hosted on GitHub. Check the repository for its license and any usage requirements.