
php-mcp/server
Deployment & DevOps이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
모델 컨텍스트 프로토콜(MCP) 서버를 위한 핵심 PHP 구현
개요
이 SDK는 PHP 애플리케이션 기능을 표준화된 MCP , , , 로 노출할 수 있게 해주어, AI 어시스턴트(예: Anthropic의 Claude, Cursor IDE, OpenAI의 ChatGPT 등)가 MCP 표준을 사용해 백엔드와 상호작용할 수 있게 합니다. - : PHP 8.1+ 기능, PSR 표준, 모듈식 설계로 구축됨 - : stdio, http+sse 및 재수립 기능이 있는 신규 버전 지원 - : 0-config 요소 등록을 위해 PHP 8 속성(#[McpTool], #[McpResource] 등) 사용 - : 클로저, 클래스 메서드, 정적 메서드, 호출 가능한 클래스 지원 - : 메서드 서명에서 자동 JSON 스키마 생성과 선택적 #[Schema] 속성 향상 - : 다중 스토리지 백엔드를 통한 고급 세션 처리 - : 고동시성 및 비차단 연산을 위한 ReactPHP 기반 - : JSON-RPC 배치 요청에 대한 완전한 지원 - : 수동 오버라이드 우선순위를 적용한 발견된 요소의 지능형 캐싱 - : 도구 및 프롬프트에서 인자 완성 내장 지원 - : 완전한 PSR-11 컨테이너 지원...
개요(AI 번역)
모델 컨텍스트 프로토콜(MCP) 서버 구축을 위한 포괄적인 PHP SDK입니다. 현대적인 아키텍처, 광범위한 테스트, 유연한 전송 옵션을 갖춘 PHP로 운영 준비가 된 MCP 서버를 구축하세요.
이 SDK는 PHP 애플리케이션 기능을 표준화된 MCP Tools, Resources, Prompt로 노출할 수 있게 해주며, Anthropic의 Claude, Cursor IDE, OpenAI의 ChatGPT 등 AI 어시스턴트가 MCP 표준을 사용해 백엔드와 상호작용할 수 있게 합니다.
🚀 주요 특징
- ** 🏗️ 현대 아키텍처**: PHP 8.1+ 기능, PSR 표준, 모듈러 설계로 구축됨
- ** 📡 다중 전송 기능**:
stdio,http+sse및 재수기 기능이 있는 새로운 스트리밍 가능한 HTTP 지원 - ** 🎯 속성 기반 정의**: 0-구성 요소 등록을 위해 PHP 8 속성(
#[McpTool],#[McpResource]등)을 사용하세요 - ** 🔧 유연한 핸들러**: 클로저, 클래스 메서드, 정적 메서드, 호출 가능한 클래스 지원
- ** 📝 스마트 스키마 생성**: 선택적
#[Schema]속성 향상을 포함하여 메서드 서명에서 자동 JSON 스키마 생성 - ** ⚡ 세션 관리**: 다중 스토리지 백엔드를 통한 고급 세션 처리
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
PHP MCP Server SDK
A comprehensive PHP SDK for building Model Context Protocol (MCP) servers. Create production-ready MCP servers in PHP with modern architecture, extensive testing, and flexible transport options.
This SDK enables you to expose your PHP application’s functionality as standardized MCP Tools, Resources, and Prompts, allowing AI assistants (like Anthropic’s Claude, Cursor IDE, OpenAI’s ChatGPT, etc.) to interact with your backend using the MCP standard.
🚀 Key Features
- 🏗️ Modern Architecture: Built with PHP 8.1+ features, PSR standards, and modular design
- 📡 Multiple Transports: Supports
stdio,http+sse, and new streamable HTTP with resumability - 🎯 Attribute-Based Definition: Use PHP 8 Attributes (
#[McpTool],#[McpResource], etc.) for zero-config element registration - 🔧 Flexible Handlers: Support for closures, class methods, static methods, and invokable classes
- 📝 Smart Schema Generation: Automatic JSON schema generation from method signatures with optional
#[Schema]attribute enhancements - ⚡ Session Management: Advanced session handling with multiple storage backends
- 🔄 Event-Driven: ReactPHP-based for high concurrency and non-blocking operations
- 📊 Batch Processing: Full support for JSON-RPC batch requests
- 💾 Smart Caching: Intelligent caching of discovered elements with manual override precedence
- 🧪 Completion Providers: Built-in support for argument completion in tools and prompts
- 🔌 Dependency Injection: Full PSR-11 container support with auto-wiring
- 📋 Comprehensive Testing: Extensive test suite with integration tests for all transports
This package supports the 2025-03-26 version of the Model Context Protocol with backward compatibility.
📋 Requirements
- PHP >= 8.1
- Composer
- For HTTP Transport: An event-driven PHP environment (CLI recommended)
- Extensions:
json,mbstring,pcre(typically enabled by default)
📦 Installation
composer require php-mcp/server
💡 Laravel Users: Consider using
php-mcp/laravelfor enhanced framework integration, configuration management, and Artisan commands.
⚡ Quick Start: Stdio Server with Discovery
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →설정
{
"mcpServers": {
"php-calculator": {
"command": "php",
"args": ["/absolute/path/to/your/mcp-server.php"]
}
}
}