Password Generator MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Password Generator MCP Servergenerate a strong password for my email"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Password Generator MCP Server
A simple Model Context Protocol (MCP) server built using the Python MCP SDK to demonstrate the three core MCP Primitives:
π οΈ Tools β Generate a secure password.
π Resources β Expose a password policy.
π‘ Prompts β Provide a reusable prompt template for generating secure passwords.
This project accompanies my Medium article on MCP Inspector and MCP Primitives, providing a hands-on example to help you understand how these concepts work together.
Project Structure
MCP-INSPECTOR/
β
βββ prompts/
β βββ __init__.py
β βββ password_prompt.py
β
βββ resources/
β βββ __init__.py
β βββ password_resource.py
β
βββ tools/
β βββ __init__.py
β βββ password_tool.py
β
βββ .gitignore
βββ .python-version
βββ app.py
βββ pyproject.toml
βββ README.md
βββ server.py
βββ uv.lockProject Overview
app.py β Creates the FastMCP server instance.
server.py β Entry point that registers all MCP primitives and starts the server.
tools/password_tool.py β Implements the Password Generator Tool.
resources/password_resource.py β Exposes the Password Policy Resource.
prompts/password_prompt.py β Defines the reusable Prompt template.
pyproject.toml β Project configuration and project dependencies.
uv.lock β Lock file generated by UV.
README.md β Project documentation.
Clone the Repository
Clone the repository to your local machine.
git clone <YOUR_GITHUB_REPOSITORY_LINK>Navigate to the project directory.
cd MCP-INSPECTORSynchronize and install all project dependencies.
uv syncActivate the virtual environment.
Windows
.venv\Scripts\activateRunning the MCP Server with MCP Inspector
Start the MCP server using:
mcp dev server.pyThis command starts the MCP server and automatically launches MCP Inspector in your browser.
Using MCP Inspector you can:
View all registered MCP primitives.
Execute Tools.
Read Resources.
Test Prompt templates.
Validate your MCP server before integrating it with an MCP client.
Screenshot: MCP Inspector Home Page
Testing the Tool
Open the Tools section inside MCP Inspector.
Select generate_password and provide the required inputs such as:
Password Length
Include Special Characters
Execute the Tool to generate a secure password.
Screenshot: Password Generator Tool
Screenshot: Generated Password Output
Testing the Resource
Open the Resources section.
Select the password://policy resource.
The server returns the password policy and security recommendations exposed by the MCP server.
Screenshot: Password Policy Resource
Testing the Prompt
Navigate to the Prompts section.
Select create_secure_password_prompt.
Provide an account type such as:
Banking
Email
Social Media
The Prompt generates a reusable instruction template for creating a secure password.
Screenshot: Prompt Execution
Installing the MCP Server in Claude Desktop
Open a new terminal and run:
mcp install server.pyOnce the installation is complete, restart Claude Desktop if it is already running.
Claude Desktop will automatically discover the MCP server and its registered primitives.
You can now interact with the server using natural language.
For example:
Generate a strong password for my email.
or
Show me the password policy.
Claude Desktop Detecting the MCP Server
Claude Desktop Invoking the Password Generator Tool
Creating an MCP Project from Scratch
If you'd like to build your own MCP server from scratch, follow these steps.
1. Initialize a UV Project
uv init2. Create a Virtual Environment
uv venv3. Activate the Virtual Environment
Windows
.venv\Scripts\activate4. Install the MCP SDK
uv add "mcp[cli]"5. Start MCP Inspector
mcp dev server.py6. Install the MCP Server in Claude Desktop
Open a new terminal and run:
mcp install server.pyMCP Primitives Included
π οΈ Tool
generate_password()
Generates a secure password with configurable length and optional special characters.
π Resource
password://policy
Returns the password generation policy and recommended password security practices.
π‘ Prompt
create_secure_password_prompt()
Creates a reusable prompt template for generating a secure password for a specified account type.
Medium Article
If you're new to MCP and would like a detailed explanation of MCP Inspector and MCP Primitives, check out my accompanying Medium article.
Available Tools
1 toolgenerate_passwordC
Generate a secure random password.
| Name | Required | Description | Default |
|---|---|---|---|
| length | No | ||
| symbols | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It only adds the qualifiers 'secure random'; it does not describe character composition, whether symbols are included, configurable length, or any limitations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, clear sentence with no wasted words and the core action front-loaded. It is appropriately brief, though the brevity leaves behavioral and parameter details unstated.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is low-complexity and an output schema exists, so return-value documentation is not needed in the description. However, with no annotations and no explanation of how the parameters affect the generated password, the definition is only minimally complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description does not mention 'length' or 'symbols'. The parameter names are somewhat self-explanatory, but the description adds no meaning beyond the schema and does not compensate for the lack of parameter documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Generate') and resource ('secure random password'), clearly conveying what the tool does. It does not differentiate from siblings because no sibling tools are listed, so it does not reach the top score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives no guidance on when to use this tool versus alternatives, no exclusions, and no usage context. Whether to call it must be inferred entirely from the verb 'Generate'.
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 tool update
v0.1.0- First observed
generate_password
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or confusion between tools. The tool's purpose is clearly unique.
The single tool name 'generate_password' follows a clear verb_noun pattern, which is standard and predictable. No inconsistencies exist.
A single tool is borderline insufficient for a password generator, as users often expect options like length, character sets, or multiple generation methods. The server feels thin but is not extreme.
The server only offers a basic generate_password function with no parameters described. Real-world password generators typically include customization options (length, symbols, numbers, etc.), so the surface is incomplete for a robust tool.
Maintenance
Related MCP Connectors
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Hash passwords with bcrypt and issue/verify JWT session tokens over A2A + MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables users to manage tasks with priorities, perform calculations with history, generate secure passwords, and analyze text, all through MCP tools, resources, and prompts.1-
- AlicenseAqualityAmaintenanceMCP server for the Nextcloud Passwords app, enabling reading and managing password entries (list, search, create, update, delete) with strong security guarantees.14MIT
- AlicenseNot gradedqualityAmaintenanceLocal, encrypted password vault with AES-256-GCM and PBKDF2, exposing MCP tools for secure credential management, password generation, and search.MIT
- AlicenseNot gradedqualityCmaintenanceEnables to generate cryptographically-random passwords and PINs with control over character sets and length. Returns the password(s) and their entropy in bits.6 npmMIT