Logo MCP Secret Wrapper

MCP Secret Wrapper

Tổ chức
astrix-security

Astrix Security MCP Secret Wrapper

Nhà phát hànhastrix-security
Kho mãmcp-secret-wrapper
Ngôn ngữTypeScript
Bản fork
8
Sao
51
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépApache-2.0
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    MCP Secret Wrapper cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    51 sao và 8 bản fork từ kho mã được liên kết.

License: Apache 2.0

Securely inject secrets from vault systems into MCP (Model Context Protocol) servers without exposing credentials in configuration files.

Usage

Convert any MCP Server configured for your client and uses a static secret in 2 simple steps:

  1. Add the secret to one of the supported vaults
  2. Replace the server's settings in the configuration file to use MCP Secret Wrapper:
    • Run MCP Secret Wrapper with npx
    • Pass any environment variables that should be injected. Their value is the secret location.
    • Place the separator (--) followed by the previous command and all its arguments
    • Add the required VAULT_TYPE environment variable and any additional optional environment variables either in the env section or as CLI arguments (--vault-type). You can find examples of both usages in our Example MCP Server

Example Usage - GitHub MCP with AWS Secret Manager

Before: Config Environment Variable (❌ Insecure - Hardcoded Secret)

json
{
  "mcpServers": {
    "githubApi": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "ghcr.io/github/github-mcp-server"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "github_pat_EXAMPLE"
      }
    }
  }
}

After: Using Vault (✅ No Exposed Secret)

json
{
  "mcpServers": {
    "githubApi": {
      "command": "npx",
      "args": [
        "-y",
        "@astrixsecurity/mcp-secret-wrapper",
        "GITHUB_PERSONAL_ACCESS_TOKEN=arn:aws:secretsmanager:us-east-1:123456789012:secret:example-ABCDE",
        "--",
        "docker",
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "ghcr.io/github/github-mcp-server"
      ],
      "env": {
        "VAULT_TYPE": "aws",
        "VAULT_PROFILE": "aws-profile",
        "VAULT_REGION": "us-east-1"
      }
    }
  }
}

https://github.com/user-attachments/assets/9af6e6b3-3694-49de-b107-8749e0630db3

See what's going on behind-the-scenes by using our example MCP server: Example MCP Server

JSON Path Extraction

When your vault stores secrets as JSON objects, you can extract specific values using dot-notation paths. This is useful when a single secret contains multiple values that need to be injected as separate environment variables.

How It Works

Append a # delimiter followed by a JSON path to your secret ID. The path uses dot notation to navigate through nested JSON objects.

Format: SECRET_ID#path.to.value

Example: Database Configuration

Suppose your vault contains a secret with the following JSON structure:

json
{
  "db": {
    "credentials": {
      "username": "demo_user",
      "password": "demo_password"
    },
    "host": "postgres",
    "port": 5432,
    "name": "demo"
  }
}

You can extract individual values using these paths:

  • db.credentials.username - Extracts "demo_user"
  • db.credentials.password - Extracts "demo_password"
  • db.host - Extracts "postgres"
  • db.port - Extracts 5432 (converted to string)

Usage Example

json
{
  "mcpServers": {
    "myServer": {
      "command": "npx",
      "args": [
        "-y",
        "@astrixsecurity/mcp-secret-wrapper",
        "DB_USERNAME=arn:aws:secretsmanager:us-east-1:123456789012:secret:my-db-config#db.credentials.username",
        "DB_PASSWORD=arn:aws:secretsmanager:us-east-1:123456789012:secret:my-db-config#db.credentials.password",
        "DB_HOST=arn:aws:secretsmanager:us-east-1:123456789012:secret:my-db-config#db.host",
        "--",
        "node",
        "/path/to/server.js"
      ],
      "env": {
        "VAULT_TYPE": "aws",
        "VAULT_REGION": "us-east-1"
      }
    }
  }
}

Important Notes

⚠️ Secret ID and the # Delimiter: The # character is used as the delimiter for JSON path extraction.

Why this delimiter? Using # in secret names is generally considered bad practice across vault systems (AWS Secrets Manager, GCP Secrets Manager, etc.), so it's unlikely to appear in real secret IDs. This makes it a safe choice for our delimiter.

What happens if your secret ID contains #?

  • ❌ Without JSON path: If your secret ID is my#secret and you use it without a JSON path (API_KEY=my#secret), the parser will incorrectly split it, treating my as the secret ID and secret as a JSON path. This will cause the lookup to fail.

  • ✅ With JSON path: If your secret ID is my#secret and you use it with a JSON path (API_KEY=my#secret#db.password), it will work correctly because the parser splits on the last # character.

Best practice: Avoid using # in your secret names entirely. This follows vault naming conventions and prevents parsing issues when you're not using JSON path extraction.

Supported Value Types

JSON path extraction supports extracting primitive values:

  • Strings: Returned as-is
  • Numbers: Converted to string representation
  • Booleans: Converted to string ("true" or "false")

Not supported:

  • Arrays
  • Objects (nested objects)
  • null values

If you need to extract a nested object or array, you'll need to store it as a separate secret or use a different approach.

Support

Vault TypeStatusDescription
AWS Secrets Manager✅ SupportedFull support for AWS Secrets Manager with IAM authentication
GCP Secret Manager✅ SupportedFull support for GCP Secret Manager with service account and ADC authentication
HashiCorp Vault🚧 In-ProgressSupport for HashiCorp Vault
Azure Key Vault✅ SupportedFull support for Azure Key Vault with DefaultAzureCredential and service principal authentication

📚 Detailed Documentation: Vault Specific Guides

Why?

MCP servers are becoming the backbone of AI agent infrastructure, but most implementations lead to severe risk by exposing hardcoded credentials. Our analysis of 5,000+ MCP server implementations revealed that over 50% use static, hardcoded API keys and secrets in their configuration files.

The Problem

  • Exposed Credentials: API keys, tokens, and secrets stored in plain text
  • No Rotation: Static credentials that never expire or rotate
  • Access Control: No fine-grained access control
  • Compliance: Violates security best practices and compliance requirements

The Solution

MCP Secret Wrapper provides:

  • Dynamic Secret Retrieval: Secrets are fetched at runtime from secure vaults
  • No Hardcoded Secerts: No secrets are present on the local machine
  • Multi-Vault Support: Works with AWS, HashiCorp, Azure, and Google vaults

Read our research: Blog - An analysis of 5,000 MCP server implementations and their identity security gap.

Contributing

We welcome contributions - this tool can and should be improved by the community. Here's how you can help:

Quick Start

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/your-feature
  3. Make your changes and add tests
  4. Commit your changes: git commit -m 'Add your feature'
  5. Push to your branch: git push origin feat/your-feature
  6. Open a Pull Request

Adding New Vault Support

  1. Create a new plugin in src/vaults/plugins/
  2. Implement the VaultPlugin interface
  3. Add tests for your implementation
  4. Update the registry and documentation

For more details, see our Contributing Guidelines.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Acknowledgements

  • Yuval Sasson - For pioneering the initiative to dynamically retrieve secrets for MCP servers
  • Omer Alon - For developing and releasing the MCP Secert Wrapper tool
  • Oshri Shmuel - For developing and releasing the MCP Secert Wrapper tool
  • Neta Ravid - For developing, releasing, and maintaining the MCP Secret Wrapper tool
  • MCP Community - For creating and maintaining the MCP framework

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "astrix-security-mcp-secret-wrapper": {
      "command": "npx",
      "args": [
        "-y",
        "@astrixsecurity/mcp-secret-wrapper"
      ]
    }
  }
}

Dùng MCP MCP Secret Wrapper với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối MCP Secret Wrapper, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm MCP Secret Wrapper làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của MCP Secret Wrapper.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "astrix-security-mcp-secret-wrapper": {
      "command": "npx",
      "args": [
        "-y",
        "@astrixsecurity/mcp-secret-wrapper"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của MCP Secret Wrapper, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của MCP Secret Wrapper.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng MCP Secret Wrapper giúp tôi làm việc này không?
MCP Secret Wrapper
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng MCP Secret Wrapper.

Câu hỏi thường gặp

Máy chủ MCP MCP Secret Wrapper dùng để làm gì?

MCP Secret Wrapper là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP MCP Secret Wrapper với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng MCP Secret Wrapper với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP MCP Secret Wrapper với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối MCP Secret Wrapper, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP MCP Secret Wrapper với TypingMind?

MCP Secret Wrapper hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP MCP Secret Wrapper cung cấp những công cụ nào trong TypingMind?

MCP Secret Wrapper cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP MCP Secret Wrapper không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu MCP Secret Wrapper yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇