Logo Face Generator

Face Generator

Cộng đồng
dasheck0

MCP server for generating human face images with various shapes and sizes

Nhà phát hànhdasheck0
Kho mãface-generator
Ngôn ngữJavaScript
Bản fork
5
Sao
6
Công cụ có sẵn
1
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Face Generator 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.

  • 1 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ở

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

Face Generator MCP Server: Generate Human Faces with Ease

Smithery badge

Features

This project provides a Model Context Protocol (MCP) server for generating human face images using https://thispersondoesnotexist.com. Think of it as a tool that lets other applications, like Cline, generate realistic-looking faces on demand.

This guide is designed for beginners, so we'll walk through everything step-by-step. We'll cover:

  1. Prerequisites: What you need before you start.
  2. Installation and Setup: Getting everything up and running.
  3. Running the Server: Starting the server.
  4. Integrating with Cline: Connecting this server to the Cline VS Code extension.
  5. Troubleshooting: Common problems and solutions.
  6. Tool Parameters: A list of the parameters you can use with the generate_face tool.

1. Prerequisites

Before you begin, you'll need a few things:

  • Node.js and npm: Node.js is a JavaScript runtime that lets you run JavaScript code outside of a web browser. npm (Node Package Manager) is included with Node.js and is used to install packages (libraries of code).
    • Download Node.js. Choose the LTS (Long Term Support) version. This is the most stable version. Follow the installation instructions for your operating system. Make sure to include npm in the installation (it's usually included by default).
    • Verify Installation: After installing Node.js, open a new terminal (command prompt on Windows, Terminal on macOS/Linux) and type:
      bash
      node -v
      npm -v
      You should see version numbers for both Node.js and npm. If you see an error, Node.js might not be installed correctly, or it might not be in your system's PATH. (See Troubleshooting below).

2. Installation and Setup

Let's get the project code and set it up:

  1. Clone the Repository:

    • Using Git (command line):
      1. Open a terminal (command prompt or Terminal).
      2. Navigate to the directory where you want to store the project. For example, to put it on your Desktop:
        bash
        cd Desktop
      3. Clone the repository:
        bash
        git clone https://github.com/Moe/mcp-face-generator
      4. Change into the project directory:
        bash
        cd mcp-face-generator
    • Using GitHub Desktop:
      1. Open GitHub Desktop.
      2. Click "File" -> "Clone Repository...".
      3. In the "URL" tab, paste the repository URL.
      4. Choose a local path (where you want to save the project on your computer).
      5. Click "Clone".
  2. Install Dependencies: This downloads all the necessary libraries the project needs. In the terminal, inside the project directory, run:

    bash
    npm install

    This might take a few minutes.

  3. Build the Project: This compiles the code into an executable format.

    bash
    npm run build

3. Running the Server

You can run the server in two main ways:

  • Standalone Mode: This runs the server directly, and it will output messages to the terminal.
  • Development/Debug Mode: This runs the server with the MCP Inspector. You can open the URL that it outputs in your browser and start playing around.

3.1 Standalone Mode

To run the server in standalone mode, use the following command in the terminal (from the project directory):

bash
npm run start

You should see messages in the terminal indicating that the server is running. It will listen for connections from MCP clients. The server will keep running until you stop it (usually with Ctrl+C).

3.2 Development/Debug Mode (with Inspector)

This mode is useful for debugging.

  1. Start the server in debug mode:
    bash
    npm run dev
    This will start the server and output a message like: 🔍 MCP Inspector is up and running at http://localhost:5173 🚀. This is the URL you'll use to open the MCP inspector in your Browser.

4. Integrating with Cline

Cline is a VS Code extension that uses MCP servers to provide language support. Here's how to connect this face generator server to Cline:

  1. Install Cline: If you haven't already, install the "Cline" extension in VS Code.

  2. Open Cline Settings:

    • Open the VS Code settings (File -> Preferences -> Settings, or Ctrl+,).
    • Search for "Cline MCP Settings".
    • Click "Edit in settings.json". This will open the cline_mcp_settings.json file.
  3. Add the Server Configuration: You'll need to add an entry to the servers array in the cline_mcp_settings.json file. Here's an example:

    json
    {
      "mcpServers": {
        "face-generator": {
          "command": "node",
          "args": [
            "C:/PATH_TO/mcp-face-generator/build/index.js"
          ],
          "disabled": false,
          "autoApprove": []
        }
      }
    }
    • Replace "C:/PATH_TO/mcp-face-generator/build/index.js" with the actual path to the index.js file in your project directory. Use forward slashes (/) or double backslashes (\\) for the path on Windows.
  4. Test the Connection:

    • Cline should automatically connect to the server. You will see the Server appear in the "MCP Servers" Panel (in the Cline extension, you'll find different buttons on the top.)
    • Ask Cline to generate a face and it should mention the MCP Server and should try to use the corresponding tools

5. Troubleshooting

  • node -v or npm -v gives an error:
    • Make sure Node.js is installed correctly. Try reinstalling it.
    • Ensure that the Node.js installation directory is in your system's PATH environment variable. On Windows, you can edit environment variables through the System Properties (search for "environment variables" in the Start Menu).
  • npm install fails:
    • Make sure you have an internet connection.
    • Try deleting the node_modules folder and running npm install again.
    • If you're behind a proxy, you might need to configure npm to use the proxy. Search online for "npm proxy settings".
  • Cline doesn't connect to the server:
    • Double-check the settings in cline_mcp_settings.json. It must be the correct path to the index.js file.
    • Make sure the server is running (use npm run start to check).
    • Restart VS Code.

6. Tool Parameters

The generate_face tool accepts the following parameters:

  • outputDir: (required) Directory to save the images
  • fileName: Optional file name (defaults to timestamp)
  • count: Number of images to generate (default: 1)
  • width: Image width in pixels (default: 256)
  • height: Image height in pixels (default: 256)
  • shape: Image shape (square|circle|rounded, default: square)
  • borderRadius: Border radius for rounded shape (default: 32)
  • returnImageContent: Return image as base64 encoded content instead of file path (default: false)

Example

json
{
  "outputDir": "./output",
  "count": 3,
  "width": 512,
  "height": 512,
  "shape": "circle",
  "returnImageContent": true
}

License

MIT

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "face-generator": {
      "command": "npx",
      "args": [
        "-y",
        "@dasheck0/face-generator"
      ]
    }
  }
}

Công cụ có sẵn

  • generate_face

    Generate and save a human face image

Dùng MCP Face Generator 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 Face Generator, 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 Face Generator 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 Face Generator.
  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": {
    "face-generator": {
      "command": "npx",
      "args": [
        "-y",
        "@dasheck0/face-generator"
      ]
    }
  }
}
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 Face Generator, 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 Face Generator.
  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 Face Generator giúp tôi làm việc này không?
Face Generator
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Face Generator.

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

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

Face Generator 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 Face Generator 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 Face Generator 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 Face Generator 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 Face Generator, 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 Face Generator với TypingMind?

Face Generator 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 Face Generator cung cấp những công cụ nào trong TypingMind?

Face Generator cung cấp 1 công cụ 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 Face Generator 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 Face Generator 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 👇