# MCP Proxy Adapter
**Author:** Vasiliy Zdanovskiy
**Email:** vasilyvz@gmail.com
## Overview
MCP Proxy Adapter is a comprehensive framework for building JSON-RPC API servers with built-in security, SSL/TLS support, and proxy registration capabilities. It provides a unified interface for command execution, protocol management, and security enforcement.
## Features
- **JSON-RPC API**: Full JSON-RPC 2.0 support with built-in commands
- **Security Framework**: Integrated authentication, authorization, and SSL/TLS
- **Protocol Management**: HTTP, HTTPS, and mTLS protocol support
- **Proxy Registration**: Automatic registration with proxy servers
- **Command System**: Extensible command registry with built-in commands
- **Configuration Management**: Comprehensive configuration with environment variable overrides
## Quick Start
1. **Installation**:
```bash
pip install mcp-proxy-adapter
```
2. **Basic Configuration**:
```bash
# Use the comprehensive config with all options disabled by default
python -m mcp_proxy_adapter --config config.json
```
3. **Access the API**:
- Health check: `GET http://localhost:8000/health`
- JSON-RPC: `POST http://localhost:8000/api/jsonrpc`
- REST API: `POST http://localhost:8000/cmd`
- Documentation: `http://localhost:8000/docs`
## Configuration
The adapter uses a comprehensive JSON configuration file (`config.json`) that includes all available options with sensible defaults. All features are disabled by default and can be enabled as needed:
- **Server settings**: Host, port, debug mode
- **Security**: Authentication methods, SSL/TLS, permissions
- **Protocols**: HTTP/HTTPS/mTLS configuration
- **Proxy registration**: Automatic server registration
- **Logging**: Comprehensive logging configuration
- **Commands**: Built-in and custom command management
See `docs/EN/configuration.md` for complete configuration documentation.
## Built-in Commands
- `health` - Server health check
- `echo` - Echo test command
- `config` - Configuration management
- `help` - Command help and documentation
- `reload` - Configuration reload
- `settings` - Settings management
- `load`/`unload` - Command loading/unloading
- `plugins` - Plugin management
- `proxy_registration` - Proxy registration control
- `transport_management` - Transport protocol management
- `role_test` - Role-based access testing
## Security Features
- **Authentication**: API keys, JWT tokens, certificate-based auth
- **Authorization**: Role-based permissions with wildcard support
- **SSL/TLS**: Full SSL/TLS and mTLS support
- **Rate Limiting**: Configurable request rate limiting
- **Security Headers**: Automatic security header injection
## Examples
The `mcp_proxy_adapter/examples/` directory contains comprehensive examples for different use cases:
- **Basic Framework**: Simple HTTP server setup
- **Full Application**: Complete application with custom commands and hooks
- **Security Testing**: Comprehensive security test suite
- **Certificate Generation**: SSL/TLS certificate management
### Test Environment Setup
The framework includes a comprehensive test environment setup that automatically creates configurations, generates certificates, and runs tests:
```bash
# Create a complete test environment with all configurations and certificates
python -m mcp_proxy_adapter.examples.setup_test_environment
# Create test environment in a specific directory
python -m mcp_proxy_adapter.examples.setup_test_environment /path/to/test/dir
# Skip certificate generation (use existing certificates)
python -m mcp_proxy_adapter.examples.setup_test_environment --skip-certs
# Skip running tests (setup only)
python -m mcp_proxy_adapter.examples.setup_test_environment --skip-tests
```
### Configuration Generation
Generate test configurations from a comprehensive template:
```bash
# Generate all test configurations
python -m mcp_proxy_adapter.examples.create_test_configs
# Generate from specific comprehensive config
python -m mcp_proxy_adapter.examples.create_test_configs --comprehensive-config config.json
# Generate specific configuration types
python -m mcp_proxy_adapter.examples.create_test_configs --types http,https,mtls
```
### Certificate Generation
Generate SSL/TLS certificates for testing:
```bash
# Generate all certificates using mcp_security_framework
python -m mcp_proxy_adapter.examples.generate_all_certificates
# Generate certificates with custom configuration
python -m mcp_proxy_adapter.examples.generate_certificates_framework --config cert_config.json
```
### Security Testing
Run comprehensive security tests:
```bash
# Run all security tests
python -m mcp_proxy_adapter.examples.run_security_tests_fixed
# Run full test suite (includes setup, config generation, certificate generation, and testing)
python -m mcp_proxy_adapter.examples.run_full_test_suite
```
### Complete Workflow Example
```bash
# 1. Install the package
pip install mcp-proxy-adapter
# 2. Create test environment (automatically runs tests)
python -m mcp_proxy_adapter.examples.setup_test_environment
# 3. Or run individual steps:
# Generate certificates
python -m mcp_proxy_adapter.examples.generate_all_certificates
# Generate configurations
python -m mcp_proxy_adapter.examples.create_test_configs
# Run security tests
python -m mcp_proxy_adapter.examples.run_security_tests_fixed
# 4. Start server with generated configuration
python -m mcp_proxy_adapter --config configs/http_simple.json
```
## Development
The project follows a modular architecture:
- `mcp_proxy_adapter/api/` - FastAPI application and handlers
- `mcp_proxy_adapter/commands/` - Command system and built-in commands
- `mcp_proxy_adapter/core/` - Core functionality and utilities
- `mcp_proxy_adapter/config.py` - Configuration management
## License
This project is licensed under the MIT License.
## Support
For issues and questions, please contact vasilyvz@gmail.com.
Raw data
{
"_id": null,
"home_page": "https://github.com/maverikod/mcp-proxy-adapter",
"name": "mcp-proxy-adapter",
"maintainer": "Vasiliy Zdanovskiy",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "Vasiliy Zdanovskiy <vasilyvz@gmail.com>",
"keywords": "json-rpc, microservices, fastapi, security, authentication, authorization, proxy, mcp, mtls, ssl, rest, api",
"author": "Vasiliy Zdanovskiy",
"author_email": "Vasiliy Zdanovskiy <vasilyvz@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/8d/f6/e127f59c945b3f49a00d44ead6e658c5527e886400d4a3c3e86acbdeb635/mcp_proxy_adapter-6.9.29.tar.gz",
"platform": null,
"description": "# MCP Proxy Adapter\n\n**Author:** Vasiliy Zdanovskiy \n**Email:** vasilyvz@gmail.com\n\n## Overview\n\nMCP Proxy Adapter is a comprehensive framework for building JSON-RPC API servers with built-in security, SSL/TLS support, and proxy registration capabilities. It provides a unified interface for command execution, protocol management, and security enforcement.\n\n## Features\n\n- **JSON-RPC API**: Full JSON-RPC 2.0 support with built-in commands\n- **Security Framework**: Integrated authentication, authorization, and SSL/TLS\n- **Protocol Management**: HTTP, HTTPS, and mTLS protocol support\n- **Proxy Registration**: Automatic registration with proxy servers\n- **Command System**: Extensible command registry with built-in commands\n- **Configuration Management**: Comprehensive configuration with environment variable overrides\n\n## Quick Start\n\n1. **Installation**:\n ```bash\n pip install mcp-proxy-adapter\n ```\n\n2. **Basic Configuration**:\n ```bash\n # Use the comprehensive config with all options disabled by default\n python -m mcp_proxy_adapter --config config.json\n ```\n\n3. **Access the API**:\n - Health check: `GET http://localhost:8000/health`\n - JSON-RPC: `POST http://localhost:8000/api/jsonrpc`\n - REST API: `POST http://localhost:8000/cmd`\n - Documentation: `http://localhost:8000/docs`\n\n## Configuration\n\nThe adapter uses a comprehensive JSON configuration file (`config.json`) that includes all available options with sensible defaults. All features are disabled by default and can be enabled as needed:\n\n- **Server settings**: Host, port, debug mode\n- **Security**: Authentication methods, SSL/TLS, permissions\n- **Protocols**: HTTP/HTTPS/mTLS configuration\n- **Proxy registration**: Automatic server registration\n- **Logging**: Comprehensive logging configuration\n- **Commands**: Built-in and custom command management\n\nSee `docs/EN/configuration.md` for complete configuration documentation.\n\n## Built-in Commands\n\n- `health` - Server health check\n- `echo` - Echo test command\n- `config` - Configuration management\n- `help` - Command help and documentation\n- `reload` - Configuration reload\n- `settings` - Settings management\n- `load`/`unload` - Command loading/unloading\n- `plugins` - Plugin management\n- `proxy_registration` - Proxy registration control\n- `transport_management` - Transport protocol management\n- `role_test` - Role-based access testing\n\n## Security Features\n\n- **Authentication**: API keys, JWT tokens, certificate-based auth\n- **Authorization**: Role-based permissions with wildcard support\n- **SSL/TLS**: Full SSL/TLS and mTLS support\n- **Rate Limiting**: Configurable request rate limiting\n- **Security Headers**: Automatic security header injection\n\n## Examples\n\nThe `mcp_proxy_adapter/examples/` directory contains comprehensive examples for different use cases:\n\n- **Basic Framework**: Simple HTTP server setup\n- **Full Application**: Complete application with custom commands and hooks\n- **Security Testing**: Comprehensive security test suite\n- **Certificate Generation**: SSL/TLS certificate management\n\n### Test Environment Setup\n\nThe framework includes a comprehensive test environment setup that automatically creates configurations, generates certificates, and runs tests:\n\n```bash\n# Create a complete test environment with all configurations and certificates\npython -m mcp_proxy_adapter.examples.setup_test_environment\n\n# Create test environment in a specific directory\npython -m mcp_proxy_adapter.examples.setup_test_environment /path/to/test/dir\n\n# Skip certificate generation (use existing certificates)\npython -m mcp_proxy_adapter.examples.setup_test_environment --skip-certs\n\n# Skip running tests (setup only)\npython -m mcp_proxy_adapter.examples.setup_test_environment --skip-tests\n```\n\n### Configuration Generation\n\nGenerate test configurations from a comprehensive template:\n\n```bash\n# Generate all test configurations\npython -m mcp_proxy_adapter.examples.create_test_configs\n\n# Generate from specific comprehensive config\npython -m mcp_proxy_adapter.examples.create_test_configs --comprehensive-config config.json\n\n# Generate specific configuration types\npython -m mcp_proxy_adapter.examples.create_test_configs --types http,https,mtls\n```\n\n### Certificate Generation\n\nGenerate SSL/TLS certificates for testing:\n\n```bash\n# Generate all certificates using mcp_security_framework\npython -m mcp_proxy_adapter.examples.generate_all_certificates\n\n# Generate certificates with custom configuration\npython -m mcp_proxy_adapter.examples.generate_certificates_framework --config cert_config.json\n```\n\n### Security Testing\n\nRun comprehensive security tests:\n\n```bash\n# Run all security tests\npython -m mcp_proxy_adapter.examples.run_security_tests_fixed\n\n# Run full test suite (includes setup, config generation, certificate generation, and testing)\npython -m mcp_proxy_adapter.examples.run_full_test_suite\n```\n\n### Complete Workflow Example\n\n```bash\n# 1. Install the package\npip install mcp-proxy-adapter\n\n# 2. Create test environment (automatically runs tests)\npython -m mcp_proxy_adapter.examples.setup_test_environment\n\n# 3. Or run individual steps:\n# Generate certificates\npython -m mcp_proxy_adapter.examples.generate_all_certificates\n\n# Generate configurations\npython -m mcp_proxy_adapter.examples.create_test_configs\n\n# Run security tests\npython -m mcp_proxy_adapter.examples.run_security_tests_fixed\n\n# 4. Start server with generated configuration\npython -m mcp_proxy_adapter --config configs/http_simple.json\n```\n\n## Development\n\nThe project follows a modular architecture:\n\n- `mcp_proxy_adapter/api/` - FastAPI application and handlers\n- `mcp_proxy_adapter/commands/` - Command system and built-in commands\n- `mcp_proxy_adapter/core/` - Core functionality and utilities\n- `mcp_proxy_adapter/config.py` - Configuration management\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Support\n\nFor issues and questions, please contact vasilyvz@gmail.com.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Powerful JSON-RPC microservices framework with built-in security, authentication, and proxy registration",
"version": "6.9.29",
"project_urls": {
"Documentation": "https://github.com/maverikod/mcp-proxy-adapter#readme",
"Homepage": "https://github.com/maverikod/mcp-proxy-adapter",
"PyPI": "https://pypi.org/project/mcp-proxy-adapter/",
"Source": "https://github.com/maverikod/mcp-proxy-adapter",
"Tracker": "https://github.com/maverikod/mcp-proxy-adapter/issues"
},
"split_keywords": [
"json-rpc",
" microservices",
" fastapi",
" security",
" authentication",
" authorization",
" proxy",
" mcp",
" mtls",
" ssl",
" rest",
" api"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "bc7ae785d851028cab13476af390429788fa2626dd80b9276fdd1df0590cbd3b",
"md5": "8e45513aad6e842a7f53163a7f911375",
"sha256": "cffc91cf558d0fb135e78df4b9f044459f54414f32042a43c1ab0398bdb2230d"
},
"downloads": -1,
"filename": "mcp_proxy_adapter-6.9.29-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8e45513aad6e842a7f53163a7f911375",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 370561,
"upload_time": "2025-10-30T23:27:58",
"upload_time_iso_8601": "2025-10-30T23:27:58.842416Z",
"url": "https://files.pythonhosted.org/packages/bc/7a/e785d851028cab13476af390429788fa2626dd80b9276fdd1df0590cbd3b/mcp_proxy_adapter-6.9.29-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8df6e127f59c945b3f49a00d44ead6e658c5527e886400d4a3c3e86acbdeb635",
"md5": "0c687af350cf644c76aaca351457edf8",
"sha256": "fdf7d8f7a60c4ed4fe3dfc3b86d65a2241a85c2e03dc50780e7efd3302d48414"
},
"downloads": -1,
"filename": "mcp_proxy_adapter-6.9.29.tar.gz",
"has_sig": false,
"md5_digest": "0c687af350cf644c76aaca351457edf8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 310223,
"upload_time": "2025-10-30T23:28:01",
"upload_time_iso_8601": "2025-10-30T23:28:01.574332Z",
"url": "https://files.pythonhosted.org/packages/8d/f6/e127f59c945b3f49a00d44ead6e658c5527e886400d4a3c3e86acbdeb635/mcp_proxy_adapter-6.9.29.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-30 23:28:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "maverikod",
"github_project": "mcp-proxy-adapter",
"github_not_found": true,
"lcname": "mcp-proxy-adapter"
}