Skip to main content
Glama
igorgrv1

@igorromero/ciphersuite-mcp

by igorgrv1

ciphersuite-mcp

Ein MCP (Model Context Protocol)-Server, der AES-256-CBC-Verschlüsselungs- und -Entschlüsselungstools, Ressourcen, die jeden Algorithmus beschreiben, und sofort einsatzbereite Prompts bereitstellt — alles direkt in VS Code Copilot Chat ausführbar.

tools

Related MCP server: @erickwendel/ciphersuite-mcp

Was es tut

Funktion

Name

Beschreibung

🔧 Tool

encrypt_message

Verschlüsselt eine beliebige Klartextnachricht mit einer Passphrase

🔧 Tool

decrypt_message

Entschlüsselt eine zuvor verschlüsselte Nachricht mit derselben Passphrase

📄 Ressource

encryption://info

Gibt Details zum Verschlüsselungsalgorithmus, zur Schlüsselableitung und zum Ausgabeformat zurück

📄 Ressource

decryption://info

Gibt an, wie das Entschlüsselungs-Tool verwendet wird: erwartetes Format, Passphrasenregeln und häufige Fehler

💬 Prompt

encrypt_message_prompt

Vorgefertigter Prompt, der den Agenten auffordert, eine Nachricht zu verschlüsseln

💬 Prompt

decrypt_message_prompt

Vorgefertigter Prompt, der den Agenten auffordert, eine Nachricht zu entschlüsseln

So funktioniert die Verschlüsselung

  • Algorithmus: AES-256-CBC

  • Schlüsselableitung: scrypt(passphrase, fixedSalt, 32) — Sie übergeben eine beliebige Passphrase als String; der Server leitet daraus automatisch einen starken 32-Byte-Schlüssel ab

  • Ausgabeformat: <IV in hex>:<ciphertext in hex> — bewahren Sie den vollständigen String auf, um später entschlüsseln zu können

  • IV: Bei jedem Verschlüsselungsaufruf wird ein neuer, zufälliger 16-Byte-IV generiert, sodass dieselbe Nachricht bei zweimaliger Verschlüsselung unterschiedliche Ausgaben erzeugt


Voraussetzungen

  • Node.js v24+ (siehe engines in package.json)


Installation

npm install

Es ist kein Build-Schritt erforderlich — der Server führt TypeScript direkt über die native TypeScript-Unterstützung von Node.js aus.


Verwendung in VS Code

1. MCP-Serverkonfiguration hinzufügen

Erstellen Sie (oder öffnen Sie) .vscode/mcp.json in Ihrem Arbeitsbereich und fügen Sie Folgendes hinzu:

{
  "servers": {
    "ciphersuite-mcp": {
      "command": "node",
      "args": ["--experimental-strip-types", "ABSOLUTE_PATH_TO_PROJECT/src/index.ts"]
    }
  }
}

oder über npm:

{
  "servers": {
    "ciphersuite-mcp": {
      "command": "npx",
      "args": ["-y", "@igorromero/ciphersuite-mcp"]
    }
  }
}

Tipp: Sie können diesen Server auch zur MCP-Konfiguration auf Benutzerebene unter ~/.vscode/mcp.json hinzufügen, um ihn in jedem Arbeitsbereich verfügbar zu machen.

2. VS Code neu laden

Öffnen Sie die Befehlspalette (Cmd+Shift+P) und führen Sie Developer: Reload Window aus (oder starten Sie VS Code einfach neu).

3. In Copilot Chat verwenden

Öffnen Sie Copilot Chat (Agent-Modus) und probieren Sie Folgendes aus:

Encrypt the message "Hello, World!" using the passphrase "my-secret-key"
Decrypt this message: a3f1...:<ciphertext> using the passphrase "my-secret-key"
Show me the encryption://info resource

Der Agent ruft automatisch das passende Tool auf und gibt das Ergebnis zurück.


Den MCP Inspector ausführen

Mit dem MCP Inspector können Sie alle Tools, Ressourcen und Prompts interaktiv in einer Browser-UI erkunden und testen:

npm run mcp:inspect

Dadurch wird der Inspector unter http://localhost:5173 geöffnet und mit dem laufenden Server verbunden.


Tests ausführen

# Run all tests once
npm test

# Run tests in watch mode (with debugger)
npm run test:dev

Die Testsuite umfasst:

  • Verschlüsseln einer Nachricht

  • Entschlüsseln einer Nachricht mit der korrekten Passphrase

  • Auflisten und Lesen der Ressource encryption://info

  • Abrufen beider Prompts

  • Fehler: Entschlüsseln mit falscher Passphrase

  • Fehler: Entschlüsseln eines fehlerhaften Chiffrats


Projektstruktur

src/
  index.ts   # Entry point — connects the server to stdio transport
  mcp.ts     # All tools, resources, and prompts are registered here
tests/
  mcp.test.ts

Verfügbare Skripte

Skript

Beschreibung

npm start

Startet den Server (wird von MCP-Clients verwendet)

npm run dev

Startet mit Dateiüberwachung und Node.js-Inspector

npm test

Führt alle Tests aus

npm run test:dev

Führt Tests im Watch-Modus aus

npm run mcp:inspect

Öffnet die MCP-Inspector-UI



Von Grund auf erstellen

Dieser Abschnitt dokumentiert Schritt für Schritt, wie dieser MCP-Server aufgebaut wurde — nützlich für die zukünftige Erstellung neuer MCP-Server.

MCP-Transporttypen

Es gibt 3 Arten von MCP-Transport:

Typ

Klasse

Beschreibung

stdio

StdioServerTransport

Läuft lokal auf dem Rechner — die häufigste Variante für lokale Tools

http

—

Läuft als API über HTTP

sse

—

Server-Sent Events — verarbeitet Daten bei Bedarf (Streaming)

Abhängigkeiten

// package.json
"dependencies": {
  "@modelcontextprotocol/sdk": "^1.27.1",
  "@types/node": "^24.11.0",
  "zod": "^3.25.76"
}

1. Einstiegspunkt — src/index.ts

Der Einstiegspunkt erstellt einen StdioServerTransport und verbindet den MCP-Server damit:

// src/index.ts
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { server } from "./mcp.ts";

async function main() {
    const transport = new StdioServerTransport()
    await server.connect(transport)
    console.error('Encrypt MCP Server running on stdio')
}

main().catch((error) => {
    console.error("Fatal error in main():", error);
    process.exit(1);
});

2. Server-Einrichtung — src/mcp.ts

Erstellen Sie die MCP-Serverinstanz mit einem Namen und einer Version:

// src/mcp.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";

export const server = new McpServer({
    name: '@igorromero/ciphersuite-mcp',
    version: '0.0.1'
})

3. Tools registrieren

tools

Tools sind Funktionen, die das LLM aufrufen kann, um Aktionen auszuführen. Verwenden Sie server.registerTool, das 3 Argumente benötigt:

  1. Name des Tools (String)

  2. Konfigurationsobjekt mit:

    • description — was das Tool tut; das LLM verwendet dies, um zu entscheiden, wann es aufgerufen wird

    • inputSchema — entspricht dem Request-Body, definiert mit Zod

    • outputSchema — entspricht dem Response-Body, definiert mit Zod

  3. Asynchrone Handler-Funktion — die eigentliche Implementierung

server.registerTool(
    'encrypt_message',
    {
        description: 'Encrypt a message',
        inputSchema: {
            message: z.string().describe("The message to encrypt"),
            encryptionKey: z.string().describe(
                "Any passphrase to use for encryption — the server derives a strong key from it automatically"
            )
        },
        outputSchema: {
            encryptedMessage: z.string().describe(
                "The encrypted message (format: iv:ciphertext)"
            )
        }
    },
    async ({ message, encryptionKey }) => {
        try {
            const encryptedMessage = encrypt(message, encryptionKey)
            return {
                content: [{ type: "text", text: encryptedMessage }],
                structuredContent: { encryptedMessage }
            }
        } catch (error) {
            return {
                isError: true,
                content: [{
                    type: 'text',
                    text: `Failed to encrypt message! Error: ${error instanceof Error ? error.message : String(error)}`
                }]
            }
        }
    }
)

Dasselbe Muster gilt für decrypt_message — tauschen Sie einfach die Felder des Eingabe-/Ausgabeschemas aus und rufen Sie stattdessen decrypt() auf.


4. Ressourcen registrieren

resource

Ressourcen stellen statische oder berechnete Informationen bereit, die dem LLM helfen, den Kontext rund um ein Tool zu verstehen. Verwenden Sie server.registerResource, das 4 Argumente benötigt:

  1. Name der Ressource

  2. URI-Vorlage (normalerweise identisch mit dem Namen)

  3. Konfigurationsobjekt, das eine description enthält

  4. Handler-Funktion, die contents zurückgibt — ein Array von Objekten mit uri, mimeType und text

server.registerResource(
    'encryption://info',
    'encryption://info',
    {
        description: 'Describes the encryption algorithm, key requirements, and output format used by this server',
    },
    () => ({
        contents: [
            {
                uri: "encryption://info",
                mimeType: "text/plain",
                text: `
Algorithm : AES-256-CBC
Key derivation: scrypt (passphrase + fixed server salt → 32-byte key)
Output format: <16-byte IV in hex>:<ciphertext in hex>  (separated by ":")
Notes:
  - Users pass any passphrase — the server derives a strong 32-byte key automatically using scrypt.
  - A random IV is generated for every encryption — the same message encrypted twice will produce different output.
  - Use the exact same passphrase to decrypt.
  - Keep the full "iv:ciphertext" string to decrypt later.
                `.trim(),
            },
        ]
    })
)

Die Ressource decryption://info folgt demselben Muster und beschreibt das erwartete Eingabeformat, die Passphrasenanforderungen und häufige Fehlerszenarien für das Entschlüsselungs-Tool.


5. Prompts registrieren

prompt

Prompts sind vorgefertigte Nachrichtenvorlagen, mit denen das LLM Tools auf geführte Weise aufrufen kann. Verwenden Sie server.registerPrompt, das 3 Argumente benötigt:

  1. Name des Prompts

  2. Konfigurationsobjekt mit:

    • description — was der Prompt tut

    • argsSchema — die Eingabeparameter, definiert mit Zod

  3. Handler-Funktion, die messages zurückgibt — ein Array von Objekten mit role (user oder assistant) und content

server.registerPrompt(
    "encrypt_message_prompt",
    {
        description: "Prompt to encrypt a plain-text message using the encrypt_message tool",
        argsSchema: {
            message: z.string().describe("The message to encrypt"),
            encryptionKey: z.string().describe(
                "Any passphrase to use for encryption — the server derives a strong key from it automatically"
            )
        }
    },
    ({ message, encryptionKey }) => ({
        messages: [
            {
                role: 'user',
                content: {
                    type: "text",
                    text: `Please encrypt the following message using the encrypt_message tool.\nMessage: ${message}\nEncryption key: ${encryptionKey}`,
                }
            }
        ]
    })
)

Der Prompt decrypt_message_prompt folgt demselben Muster — er nimmt encryptedMessage und encryptionKey als Argumente entgegen und weist das LLM an, decrypt_message aufzurufen.


6. Verbinden des MCP-Servers mit einer IDE

VS Code (automatisch)

Erstellen Sie .vscode/mcp.json im Projektstammverzeichnis. VS Code erkennt es automatisch:

{
    "servers": {
        "ciphersuite-mcp": {
            "command": "node",
            "args": [
                "--experimental-strip-types",
                "src/index.ts"
            ]
        }
    }
}

Andere IDEs / Andere Projekte

Kopieren Sie den Servereintrag von ciphersuite-mcp in die MCP-Konfigurationsdatei des Zielprojekts oder der Ziel-IDE. Der Server läuft als Unterprozess über stdio, sodass sich jeder MCP-kompatible Client damit verbinden kann.

Available Tools

2 tools
decrypt_messageA

Decrypt a message that was encrypted with the encrypt_message tool

NameRequiredDescriptionDefault
encryptionKeyYesThe same passphrase used during encryption
encryptedMessageYesThe encrypted message (format: iv:ciphertext)

Output Schema

NameRequiredDescription
decryptedMessageYesThe decrypted plain-text message

TDQS

A3.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It does not state whether the operation is read-only, has side effects, or what happens on failure (e.g., wrong key). The only behavioral detail is the requirement for the same passphrase, which partially addresses input constraints but not the tool's overall safety profile. This is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence with zero filler. It states the verb, object, and connection to the sibling tool efficiently, making it easy to scan and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, full parameter coverage, and presence of an output schema, the description is mostly complete. It correctly identifies the key requirement and relationship to encrypt_message. However, lacking behavioral disclosure (e.g., error handling, purity) means it is not fully complete for an agent deciding to invoke it safely.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so each parameter already has a description. The tool description adds minimal semantic value beyond mentioning the key matches encrypt_message, which mirrors what the schema already states. This meets the baseline for full schema coverage but does not provide additional meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Decrypt') and resource ('a message'), and explicitly ties it to the encrypt_message tool, which differentiates it from the sibling. It is not a tautology; it names the exact operation and its counterpart.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clearly implies usage context by referencing encrypt_message, indicating it is the decryption counterpart. However, it does not explicitly state when not to use it or name alternative tools beyond the implicit sibling relationship. This is clear context but lacks explicit exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

encrypt_messageC

Encrypt a message

NameRequiredDescriptionDefault
messageYesThe message to encrypt
encryptionKeyYesAny passphrase to use for encryption — the server derives a strong key from it automatically

Output Schema

NameRequiredDescription
encryptedMessageYesThe encrypted message (format: iv:ciphertext)

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden for behavioral disclosure, but it only states the action. It does not mention that encryption is irreversible (without the key), the output format, or any side effects. The schema hints at key derivation, but the description itself adds no behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, but it essentially restates the tool name without adding operational detail. While not verbose, it doesn't earn its place beyond the name—acceptable but minimal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite an output schema existing, the description is too sparse for an encryption operation. It lacks information about when encryption is appropriate, the nature of the output, or any warnings. The agent is left to infer everything from the schema and sibling naming, which is insufficient for correct invocation in varied contexts.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for both parameters, so the schema already documents 'message' and 'encryptionKey' with meaningful descriptions. The tool description adds no extra parameter information, but the baseline is 3 given high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Encrypt a message') with a specific verb and resource. It implicitly distinguishes from the sibling tool 'decrypt_message' by focusing on encryption, though it doesn't explicitly name the alternative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus decrypt_message or any other context. There is no mention of prerequisites, security considerations, or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv0.0.1
    • First observeddecrypt_message
    • First observedencrypt_message

TDQS

A3.6/5.0

Scored across 2 tools

Disambiguation5/5

The two tools are perfectly distinct: one encrypts, the other decrypts. There is no overlap or potential for confusion between them.

Naming Consistency5/5

Both tools follow the same verb_noun pattern: encrypt_message and decrypt_message. Naming is consistent and intuitive.

Tool Count4/5

At only 2 tools, the server is minimal, but the domain of encryption/decryption inherently requires exactly these two operations. The count is slightly under the typical 3-15 range but perfectly appropriate for its narrow scope.

Completeness5/5

The tool surface covers the full encryption/decryption lifecycle with no missing operations. For a cipher suite, encrypt and decrypt are the only necessary functions.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables AI memory persistence and secure credential management via vault tools for MCP-compatible clients like Claude Desktop, Cursor, and VS Code.
    12
    11 npm
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Provides AES-256-CBC encryption and decryption tools, a resource for algorithm details, and prompts for encrypting and decrypting messages, all runnable inside VS Code Copilot Chat.
    2
    ISC
  • A
    license
    C
    quality
    C
    maintenance
    Provides AES-256-CBC encryption and decryption tools, an algorithm info resource, and ready-to-use prompts for use in MCP-compatible clients like VS Code Copilot Chat.
    1
    ISC
  • A
    license
    C
    quality
    C
    maintenance
    Enables encrypting and decrypting plain-text messages with AES-256-CBC using any passphrase, with automatic scrypt key derivation and a fresh random IV per call. It also exposes a resource describing the algorithm and ready-to-use prompts, and can be run directly inside VS Code Copilot Chat or the MCP Inspector.
    2
    ISC