A Model Context Protocol (MCP) server that allows interacting with the CipherTrust RestFul Data Protection (CRDP) service. This MCP server enables AI applications and LLMs to securely protect and reveal sensitive data through the CipherTrust CRDP service. It supports both individual and bulk protect and reveal operations with versioning support. - Video 1: [https://youtu.be/O2pQRoykaaU] - Deployme
Add this skill
npx mdskills install sanyambassi/thales-cdsp-crdp-mcp-serverWell-documented MCP server enabling secure data protection/revelation through Thales CipherTrust CRDP with clear setup and examples
1# Thales CDSP CRDP MCP Server23A Model Context Protocol (MCP) server that allows interacting with the CipherTrust RestFul Data Protection (CRDP) service.45## Overview67This MCP server enables AI applications and LLMs to securely protect and reveal sensitive data through the CipherTrust CRDP service. It supports both individual and bulk protect and reveal operations with versioning support.89## Demo Videos1011- **Video 1**: [https://youtu.be/O2pQRoykaaU] - Deployment and usage with Cursor AI12- **Video 2**: [https://youtu.be/ILNyWRYQUpw] - How to use the n8n workflows1314## Features1516- **Data Protection**: Protect sensitive data using Data Protection policies defined on the Thales CipherTrust manager.17- **Data Revelation**: Securely reveal protected data with proper authorization (username/jwt)18- **Bulk Operations**: Process multiple data items in single batch operations19- **Versioning Support**: Handles external versioned, internal versioned, and version disabled protection policies.20- **Monitoring**: Health checks and metrics collection21- **Multiple Transports**: Support for stdio and HTTP transports2223## Prerequisites2425Before installing and running the CRDP MCP Server, ensure you have the following prerequisites installed:2627- **Node.js** (v18 or higher)28- **npm** (comes with Node.js)29- **TypeScript** (installed globally)30- **CRDP container running and registered with CipherTrust Manager**3132See [prerequisites](docs/prerequisites.md) for detailed installation instructions.3334## Quick Start3536### 1. Clone the Repository3738```bash39git clone https://github.com/sanyambassi/thales-cdsp-crdp-mcp-server.git40cd thales-cdsp-crdp-mcp-server41```4243### 2. Install Dependencies4445```bash46npm install47```4849### 3. Build the Project5051```bash52npm run build53```5455### 4. Start the Server5657#### For stdio transport (default):58```bash59npm start60```6162#### For HTTP transport:63```bash64MCP_TRANSPORT=streamable-http npm start65```6667## Configuration6869### Environment Variables7071| Variable | Description | Default |72|----------|-------------|---------|73| `CRDP_SERVICE_URL` | CRDP service endpoint for protect/reveal operations | `http://localhost:8090` |74| `CRDP_PROBES_URL` | CRDP service endpoint for monitoring operations | `http://localhost:8080` |75| `MCP_TRANSPORT` | Transport type (`stdio` or `streamable-http`) | `stdio` |76| `MCP_PORT` | HTTP port (when using streamable-http) | `3000` |7778### Setting Environment Variables7980**Windows (PowerShell):**81```powershell82$env:CRDP_SERVICE_URL="http://crdp-server:8090"83$env:MCP_TRANSPORT="streamable-http"84```8586**Windows (CMD):**87```cmd88set CRDP_SERVICE_URL=http://crdp-server:809089set MCP_TRANSPORT=streamable-http90```9192**Linux/macOS:**93```bash94export CRDP_SERVICE_URL="http://crdp-server:8090"95export CRDP_PROBES_URL="http://crdp-server:8080"96export MCP_TRANSPORT="streamable-http"97export MCP_PORT="3000"98```99100## Available Tools101102### Data Protection Tools103104#### `protect_data`105Protect a single piece of sensitive data.106107**Parameters:**108- `data` (required): The sensitive data to protect109- `protection_policy_name` (required): CRDP protection policy name110- `jwt` (optional, required if CRDP is running with JWT verification enabled): JWT token for authorization111112> **Note:** If CRDP is running with JWT verification enabled, 'jwt' is required.113114**Example:**115```json116{117 "name": "protect_data",118 "arguments": {119 "data": "john.doe@example.com",120 "protection_policy_name": "email_policy",121 "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."122 }123}124```125126#### `protect_bulk`127Protect multiple data items in a single batch operation.128129**Parameters:**130- `request_data` (required): Array of protection request objects131- `jwt` (optional, required if CRDP is running with JWT verification enabled): JWT token for authorization132133> **Note:** If CRDP is running with JWT verification enabled, 'jwt' is required.134135**Example:**136```json137{138 "name": "protect_bulk",139 "arguments": {140 "request_data": [141 {142 "protection_policy_name": "email_policy",143 "data": "john.doe@example.com"144 },145 {146 "protection_policy_name": "ssn_policy",147 "data": "123-45-6789"148 }149 ]150 }151}152```153154### Data Revelation Tools155156#### `reveal_data`157Reveal a single piece of protected data.158159**Parameters:**160- `protected_data` (required): The protected data to reveal161- `protection_policy_name` (required): Policy name used for protection162- `external_version` (optional): Version information for the protected data163- `username` (conditionally required): User identity for authorization (required if 'jwt' is not provided)164- `jwt` (conditionally required): JWT token for authorization (required if 'username' is not provided)165166> **Note:** At least one of 'username' or 'jwt' is required for reveal operations.167168**Example:**169```json170{171 "name": "reveal_data",172 "arguments": {173 "protected_data": "enc_abc123def456",174 "username": "authorized_user",175 "protection_policy_name": "email_policy",176 "external_version": "1003000",177 "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."178 }179}180```181182#### `reveal_bulk`183Reveal multiple protected data items in a single batch operation.184185**Parameters:**186- `protected_data` (required): The protected data to reveal187- `username` (required): User identity for authorization188- `protection_policy_name` (required): Policy name used for protection189- `external_version` (optional): From the output of the protect operation when using a protection policy with external versioning190- `jwt` (optional): JWT token for authorization191192**Example:**193```json194{195 "name": "reveal_bulk",196 "arguments": {197 "username": "authorized_user",198 "protected_data_array": [199 {200 "protection_policy_name": "email_policy",201 "protected_data": "enc_abc123"202 },203 {204 "protection_policy_name": "ssn_policy",205 "protected_data": "enc_def456"206 }207 ],208 "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."209 }210}211```212213### Monitoring Tools214215#### `get_metrics`216Get CRDP service metrics.217218#### `check_health`219Check CRDP service health status.220221#### `check_liveness`222Check CRDP service liveness.223224## Versioning Support225226The server supports Portection Policy versioning:227228### 1. External Versioning229Returns both protected data and external version:230```231Data protected successfully. Protected data: abcdefcLJTrU0Y8FKC232External version: 1003000233```234235### 2. Internal Versioning236Returns protected data with embedded version:237```238Data protected successfully. Protected data: 1001000Y57IlQvok1Ke239```240241### 3. Versioning Disabled242Returns protected data only:243```244Data protected successfully. Protected data: BcmX5McZK6BB245```246247## Testing248249For comprehensive testing instructions, see [testing](docs/testing.md).250251## Integration with AI Assistants252253This MCP server can be integrated with various AI assistants to enable secure data protection and revelation capabilities through natural language interactions.254255### Supported AI Assistants256257- **Cursor AI**258- **Google Gemini**259- **Claude Desktop**260261### Quick Setup262263All supported AI assistants use the same `mcp.json` configuration:264265```json266{267 "mcpServers": {268 "crdp": {269 "command": "node",270 "args": ["/path/to/your/crdp-mcp-server/dist/crdp-mcp-server.js"],271 "env": {272 "CRDP_SERVICE_URL": "http://your-crdp-server:8090",273 "CRDP_PROBES_URL": "http://your-crdp-server:8080",274 "MCP_TRANSPORT": "stdio"275 }276 }277 }278}279```280281### Usage Examples282283After configuration, you can use natural language commands like:284285- "Protect my email address john.doe@example.com using the email_policy"286- "Reveal the protected data abc123def456 for user admin using protection policy ssn_policy"287- "Check the health of my CRDP service"288289For detailed setup instructions and troubleshooting, see [AI Assistant Integration Guide](docs/ai-assistants.md).290291## n8n Integration292293This project includes n8n workflow templates for creating conversational AI interfaces to the CRDP service:294295### **n8n Templates**296297- **`crdp_demo_mcp_server.json`**: MCP Server workflow that exposes CRDP tools298- **`crdp_demo_mcp_client.json`**: MCP Client workflow with conversational AI interface.299**Note:** You will need an [OpenAI API key](https://platform.openai.com/api-keys) to use the conversational AI features. Sign up or generate a key at the OpenAI website.300301### **Features**302303- **Conversational Interface**: Protect and reveal data using natural language304- **JWT Authorization**: Secure operations with optional JWT tokens305- **Conversational Memory**: Maintains context across chat sessions306- **Intelligent Tool Selection**: Automatically uses bulk operations for multiple data items307- **Strict Security**: Always requires proper authorization parameters308309### **Quick Setup**3103111. **Import Workflows**: Import both JSON files into your n8n instance3122. **Configure Credentials**: Add your OpenAI credentials to the MCP Client3133. **Activate Workflows**: Enable both workflows3144. **Start Chatting**: Use the chat interface to interact with CRDP315316For detailed n8n setup instructions, see [n8n docs](n8n/README.md).317318### Quick Test319320Test the server using curl:321322```bash323# Test HTTP transport324curl -X POST http://localhost:3000/mcp \325 -H "Content-Type: application/json" \326 -d '{327 "jsonrpc": "2.0",328 "id": 1,329 "method": "tools/call",330 "params": {331 "name": "protect_data",332 "arguments": {333 "data": "test@example.com",334 "protection_policy_name": "email_policy"335 }336 }337 }'338```339340## Development341342### Project Structure343344```345crdp-mcp-server/346├── src/347│ └── crdp-mcp-server.ts # Main server implementation348├── dist/ # Compiled JavaScript output349├── docs/ # Documentation350├── n8n/ # n8n workflow templates351├── package.json # Project configuration352├── scripts/353│ └── test-server.ts # Test Script354└── tsconfig.json # TypeScript configuration355```356357### npm Commands358359| Script | Description |360|--------|-------------|361| `npm start` | Start the server (stdio transport) |362| `npm run dev` | Start development server with auto-reload |363| `npm run build` | Compile TypeScript to JavaScript |364| `npm run clean` | Clean the dist directory |365366## Security Considerations367368- All sensitive data is processed through the secure CRDP service369- User authorization is required for all reveal operations370- The server does not store sensitive data locally371- This MCP server only supports CRDP running in no-tls mode372373## Troubleshooting374375### Common Issues3763771. **"tsc is not recognized"**: Install TypeScript globally with `npm install -g typescript`3782. **Connection refused**: Ensure CRDP service is running and accessible3793. **404 errors**: Ensure correct protection policy names are being used380381### Logs382383The server outputs logs to stderr. Check for:384- CRDP service connection status385- Tool execution results386- Error messages and stack traces387388## Contributing3893901. Fork the repository3912. Create a feature branch3923. Make your changes3934. Add tests if applicable3945. Submit a pull request395396## License397398This project is licensed under the MIT License (c) 2025 Thales Group. See the [LICENSE](LICENSE) file for details.399400## Support401402For issues and questions:403- Check the [troubleshooting section](#troubleshooting)404- Review the [testing documentation](docs/testing.md)405- Open an issue on GitHub406407408
Full transparency — inspect the skill content before installing.