Metadata-Version: 2.4
Name: mcp-proxy-adapter
Version: 6.1.0
Summary: Model Context Protocol Proxy Adapter with Security Framework
Home-page: https://github.com/maverikod/mcp-proxy-adapter
Author: Vasiliy Zdanovskiy
Author-email: Vasiliy Zdanovskiy <vasilyvz@gmail.com>
Maintainer-email: Vasiliy Zdanovskiy <vasilyvz@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/vasilyvz/mcp-proxy-adapter
Project-URL: Documentation, https://mcp-proxy-adapter.readthedocs.io/
Project-URL: Repository, https://github.com/vasilyvz/mcp-proxy-adapter.git
Project-URL: Bug Tracker, https://github.com/vasilyvz/mcp-proxy-adapter/issues
Project-URL: Security Policy, https://github.com/vasilyvz/mcp-proxy-adapter/security/policy
Keywords: mcp,proxy,adapter,json-rpc,microservice,security,fastapi
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Security
Classifier: Framework :: FastAPI
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn[standard]>=0.20.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: mcp-security-framework>=0.1.0
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: python-jose[cryptography]>=3.3.0
Requires-Dist: passlib[bcrypt]>=1.7.4
Requires-Dist: cryptography>=3.4.8
Requires-Dist: pyOpenSSL>=23.0.0
Requires-Dist: certifi>=2023.7.22
Requires-Dist: requests>=2.31.0
Requires-Dist: aiofiles>=23.1.0
Requires-Dist: python-dotenv>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Requires-Dist: httpx>=0.24.0; extra == "dev"
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
Requires-Dist: httpx>=0.24.0; extra == "test"
Requires-Dist: pytest-mock>=3.10.0; extra == "test"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.4.0; extra == "docs"
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.20.0; extra == "docs"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# MCP Proxy Adapter

A powerful framework for creating JSON-RPC-enabled microservices with built-in security, authentication, and proxy registration capabilities.

## Features

- **JSON-RPC Framework**: Complete JSON-RPC 2.0 implementation
- **Security Integration**: Built-in support for mcp_security_framework
- **Authentication**: Multiple auth methods (API Key, JWT, Certificate, Basic Auth)
- **Proxy Registration**: Automatic registration and discovery of services
- **Command System**: Extensible command framework with role-based access control
- **SSL/TLS Support**: Full SSL/TLS support including mTLS
- **Async Support**: Built on FastAPI with full async support
- **Extensible**: Plugin system for custom commands and middleware

## Quick Start

### Installation

```bash
pip install mcp-proxy-adapter
```

### Basic Usage

```python
from mcp_proxy_adapter import create_app, Command, SuccessResult

# Create a custom command
class HelloCommand(Command):
    name = "hello"
    descr = "Say hello"
    
    async def execute(self, **kwargs) -> SuccessResult:
        name = kwargs.get("name", "World")
        return SuccessResult(f"Hello, {name}!")

# Create and run the application
app = create_app()
```

### Configuration

```json
{
  "server": {
    "host": "0.0.0.0",
    "port": 8000
  },
  "security": {
    "enabled": true,
    "framework": "mcp_security_framework"
  },
  "commands": {
    "auto_discovery": true,
    "builtin_commands": ["echo", "health", "config"]
  }
}
```

## Examples

### Proxy Registration Example

```python
# Example of proxy registration with authentication
import asyncio
from mcp_proxy_adapter.examples.proxy_registration_example import ProxyRegistrationExample

async def main():
    async with ProxyRegistrationExample("http://localhost:8002", "your-token") as client:
        result = await client.test_registration({
            "server_id": "my-server",
            "server_url": "http://localhost:8001",
            "server_name": "My Server"
        })
        print(f"Registration result: {result}")

asyncio.run(main())
```

### Security Testing

The framework includes comprehensive security testing examples:

- HTTP with Token Authentication
- HTTPS with Certificate Authentication  
- mTLS (Mutual TLS) Authentication
- Role-based Access Control
- Permission Validation

## Documentation

For detailed documentation, examples, and API reference, see the [documentation](https://github.com/maverikod/mcp-proxy-adapter).

## Development

### Setup Development Environment

```bash
git clone https://github.com/maverikod/mcp-proxy-adapter.git
cd mcp-proxy-adapter
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e ".[dev]"
```

### Running Tests

```bash
pytest tests/
```

### Running Examples

```bash
# Start server
python -m mcp_proxy_adapter.main --config examples/server_configs/config_simple.json

# Run proxy registration example
python examples/proxy_registration_example.py
```

## License

MIT License - see LICENSE file for details.

## Author

**Vasiliy Zdanovskiy** - vasilyvz@gmail.com

## Version

6.1.0 - Major release with security framework integration and proxy registration capabilities. 
