Tiny Cryptography MCP Server logo

Tiny Cryptography MCP Server

by anton10xr

A Model Context Protocol server built with Express.js that provides cryptographic tools. It enables key pair generation, shared secret derivation, and message encryption/decryption for secure communication.

View on GitHub

Last updated: N/A

What is Tiny Cryptography MCP Server?

This is a Model Context Protocol (MCP) server built with Express.js that offers cryptographic functionalities. It allows AI models and tools to communicate securely by providing tools for key exchange, shared secret derivation, and message encryption/decryption using the Stanford Javascript Crypto Library (SJCL).

How to use Tiny Cryptography MCP Server?

To use the server, first clone the repository and install the dependencies using npm install. Configure the PORT environment variable if needed. Start the development server with npm run dev or build and start the production server with npm run build and npm start. Connect to the server using Server-Sent Events (SSE) at the /sse endpoint. Use the API endpoints /messages/:id to send messages to specific connections. The server provides tools like generateKeyPair, deriveSharedSecret, encrypt, and decrypt to manage cryptographic operations.

Key features of Tiny Cryptography MCP Server

  • Generate SJCL P-256 key pairs

  • Derive shared secrets for secure communication

  • Encrypt messages using SJCL AES-CCM

  • Decrypt encrypted messages

  • Server-sent events (SSE) for real-time communication

Use cases of Tiny Cryptography MCP Server

  • Secure communication between AI models and tools

  • Enabling interoperability between language models and external capabilities

  • Building complex AI applications with multiple components that require secure data exchange

  • Implementing man-in-the-middle attack prevention in AI communication scenarios

FAQ from Tiny Cryptography MCP Server

What is MCP?

The Model Context Protocol (MCP) is an open standard that defines how AI models and tools communicate, enabling seamless interoperability and effective tool usage.

What cryptographic algorithms are used?

The server uses SJCL (Stanford Javascript Crypto Library) for P-256 key pair generation and AES-CCM for message encryption/decryption.

How do I connect to the server?

You can connect to the server using Server-Sent Events (SSE) at the /sse endpoint.

What environment variables are required?

The server uses the PORT environment variable to specify the port on which the server will run (default: 3006).

How do I send messages to a specific connection?

Use the API endpoint POST /messages/:id to send messages to a specific connection.