Download the PHP package code-wheel/mcp-http-security without Composer
On this page you can find all versions of the php package code-wheel/mcp-http-security. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download code-wheel/mcp-http-security
More information about code-wheel/mcp-http-security
Files in code-wheel/mcp-http-security
Download code-wheel/mcp-http-security
More information about code-wheel/mcp-http-security
Files in code-wheel/mcp-http-security
Vendor code-wheel
Package mcp-http-security
Short Description Secure HTTP transport wrapper for MCP servers with API key auth, IP/Origin allowlisting, and rate limiting
License MIT
Package mcp-http-security
Short Description Secure HTTP transport wrapper for MCP servers with API key auth, IP/Origin allowlisting, and rate limiting
License MIT
Please rate this library. Is it a good library?
Informations about the package mcp-http-security
MCP HTTP Security
Secure HTTP transport wrapper for MCP (Model Context Protocol) servers in PHP.
Provides production-ready security components that don't exist elsewhere in the PHP MCP ecosystem:
- API Key Authentication - Secure key generation, hashing (SHA-256 + pepper), TTL/expiry
- IP Allowlisting - CIDR notation, IPv4/IPv6 support
- Origin Allowlisting - Hostname validation with wildcard subdomain support
- PSR-15 Middleware - Drop-in security for any PSR-15 compatible framework
Installation
Quick Start
API Key Management
Creating Keys
Listing Keys
Validating Keys
Revoking Keys
Storage Backends
File Storage (Simple)
Database Storage (PDO)
In-Memory (Testing)
Custom Storage
Implement StorageInterface:
Request Validation
IP Allowlisting
Origin Allowlisting
Combined Request Validation
Middleware Configuration
Error Handling
The middleware throws typed exceptions:
Framework Integration
Slim 4
Laravel
Drupal
See drupal/mcp_tools which uses this package.
Security Considerations
- Pepper your hashes - Always provide a pepper for API key hashing
- Use HTTPS - Never transmit API keys over unencrypted connections
- Rotate keys - Use TTL and rotate keys regularly
- Least privilege - Grant minimal scopes needed
- Audit logging - Log key usage for security monitoring
Examples
See the examples/ directory for complete working examples:
- slim4-integration.php - Full Slim 4 framework integration
- standalone-validation.php - No-framework usage
- cli-key-manager.php - CLI tool for managing API keys
Development
See CONTRIBUTING.md for more details.
License
MIT License - see LICENSE file.
Credits
Extracted from drupal/mcp_tools by CodeWheel.
All versions of mcp-http-security with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
psr/http-server-middleware Version ^1.0
psr/http-message Version ^1.0 || ^2.0
psr/clock Version ^1.0
psr/log Version ^1.0 || ^2.0 || ^3.0
psr/http-server-middleware Version ^1.0
psr/http-message Version ^1.0 || ^2.0
psr/clock Version ^1.0
psr/log Version ^1.0 || ^2.0 || ^3.0
The package code-wheel/mcp-http-security contains the following files
Loading the files please wait ...