seminar-cipher-mcp
by tranthethang
README.md
# seminar-cipher-mcp
An MCP server (`mcp >= 2.0`) providing authenticated symmetric text encryption and decryption (`AES-256-GCM + scrypt`) over `streamable-http` (`/mcp`).
## Setup & Run
```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
PORT=10000 python server.py
```
Supported environment variables:
- `MCP_SERVER_NAME` (default `cipher-service`)
- `HOST` (default `0.0.0.0`)
- `PORT` (default `10000`, valid range `1..65535`)
- `MCP_TRANSPORT` (default `streamable-http`)
- `MCP_STATELESS_HTTP` (default `true`)
- `MAX_PLAINTEXT_BYTES` (default `1000000`)
- `MAX_TOKEN_CHARS` (default `2000000`)
- `SCRYPT_N` (default `16384`), `SCRYPT_R` (default `8`), `SCRYPT_P` (default `1`)
## Running Tests
```bash
python -m unittest -v test_server.py
```
## Testing with `client.openai.py`
`client.openai.py` is an end-to-end demo client that connects an OpenAI-compatible LLM (`/chat/completions`) to the Cipher MCP server over `streamable-http`, discovers its tools via `tools/list`, and runs a tool-calling loop (up to 8 turns).
1. Create `.env` from `.env.example` and configure your LLM credentials and MCP endpoint:
```bash
cp .env.example .env
```
Environment variables used by `client.openai.py`:
- `OPENAI_API_URL`: OpenAI-compatible base URL or full `/chat/completions` URL (default `https://api.openai.com/v1`)
- `OPENAI_API_MODEL`: Model name (default `gpt-6-luna`)
- `OPENAI_API_KEY`: API key for the OpenAI-compatible endpoint
- `MCP_URL`: Target Cipher MCP endpoint (default `https://cipher-mcp.onrender.com/mcp`)
2. Run against the local server (after starting `PORT=10000 python server.py` in another terminal):
```bash
MCP_URL=http://127.0.0.1:10000/mcp python client.openai.py
```
Or run against the `MCP_URL` configured in `.env` with the default prompt or a custom prompt:
```bash
python client.openai.py
python client.openai.py "Encrypt 'hello world' with passphrase 'secret' and decrypt it back."
```
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessOutdated data