This face generator MCP server provides a convenient way to generate realistic human face images using thispersondoesnotexist.com. It allows applications like Cline to request and generate human faces on demand through the Model Context Protocol (MCP).
Before getting started, make sure you have:
Verify your installation by running:
node -v
npm -v
Both commands should display version numbers, confirming successful installation.
Follow these steps to install and set up the MCP server:
Clone the Repository:
git clone https://github.com/Moe/mcp-face-generator
cd mcp-face-generator
Install Dependencies:
npm install
Build the Project:
npm run build
You can run the server in two different modes:
Run the server directly with:
npm run start
The server will start and listen for connections from MCP clients.
Start the server with the MCP Inspector for debugging:
npm run dev
This will output a URL (typically http://localhost:5173) that you can open in your browser to access the MCP Inspector.
To connect the face generator server to the Cline VS Code extension:
Install the Cline extension in VS Code if you haven't already.
Open Cline Settings:
Add Server Configuration to the cline_mcp_settings.json
file:
{
"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.
Test the Connection: Cline should automatically connect to the server and display it in the "MCP Servers" panel.
The generate_face
tool accepts these parameters:
{
"outputDir": "./output",
"count": 3,
"width": 512,
"height": 512,
"shape": "circle",
"returnImageContent": true
}
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "face-generator" '{"command":"npx","args":["face-generator"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"face-generator": {
"command": "npx",
"args": [
"face-generator"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"face-generator": {
"command": "npx",
"args": [
"face-generator"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect