使用说明
Password Generator MCP Example
This project is a simple example of a password generator tool implemented in Go, using the mcp-golang library. It demonstrates how to register a tool that generates passwords with customizable length, character set, and case.
DISCLAIMER
Passwords will end up in the transcript with the agent making them unsafe by default unless you are using local AI and are able to remove previous conversations! Do NOT use this to generate production passwords unless you are happy with sharing them with your AI provider.
Usage
- Install
go install github.com/jadolg/password-mcp@latest
- Get the binary path
which password-mcp
Stdio (default)
Configure your MCP client using the binary path from the previous step:
{
"mcpServers": {
"password-mcp": {
"command": "/home/myuser/go/bin/password-mcp",
"args": [],
"env": {}
}
}
}
HTTP
Start the server with the --http flag:
password-mcp --http
By default it listens on :8080. Use --addr to change the address:
password-mcp --http --addr :9090
Then configure your MCP client:
{
"mcpServers": {
"password-mcp": {
"type": "http",
"url": "http://localhost:8080/mcp"
}
}
}
Adjust the URL if you used a custom --addr.
Features
- Generate passwords of any length
- Choose from different character sets: letters, letters and numbers, or letters, numbers, and symbols
- Select password case: uppercase, lowercase, or mixed