# generate-password > Generates secure passwords with customizable length and complexity. - File: `generate-password.cs` - Status: stable — Version: 1.1.0 — License: MIT — Author: XAKPC Dev Labs - Tags: password, security, utilities - Source file to download: https://anymcp.net/servers/generate-password/generate-password.cs - Page for a person: https://anymcp.net/servers/generate-password/ - Shared install guide: https://anymcp.net/install.md These steps install the server **into the current project**. The server file goes in the project, and the configuration goes in the `.mcp.json` file of the project. These steps write no file outside the project directory, and they change no other project on this computer. To install the server for all the projects of the user, read the last section. **Do all the commands on this page in the root directory of the project.** Each path is relative to that directory. Do not change the working directory between the steps. If you go into `.mcp-servers/` to read the file, go back to the root directory before the next command. If you do not go back, the relative path becomes double and the command fails. ## Before you start ``` dotnet --list-sdks ``` One line of the output must show version 10 or a later version. The `dotnet run .cs` command with `#:package` directives is a feature of the .NET 10 SDK. Each SDK before version 10 fails. An SDK after version 10 is correct. Use `--list-sdks`. Do not use `--version`: the `dotnet --version` command gives the SDK that the computer selects now, and a `global.json` file can select an earlier SDK. If no SDK is version 10 or later, read https://anymcp.net/install.md before you continue. ## 1. Put the file in the project Do these commands in the root directory of the project. In bash or zsh: ``` mkdir -p .mcp-servers curl -fsSL -o .mcp-servers/generate-password.cs "https://anymcp.net/servers/generate-password/generate-password.cs" ``` In PowerShell: ``` New-Item -ItemType Directory -Force .mcp-servers | Out-Null Invoke-WebRequest -Uri "https://anymcp.net/servers/generate-password/generate-password.cs" -OutFile ".mcp-servers/generate-password.cs" ``` The file starts with a `// ---` comment block that contains the metadata. This block is correct C#, and the `dotnet run` command ignores it. ## 2. Build one time Do this command in the root directory of the project: ``` dotnet build .mcp-servers/generate-password.cs -v q ``` **A correct build prints no text.** The `-v q` option removes the summary, and there is no `Build succeeded` line. Empty output and exit code 0 are the correct result. Do not do the command again. A build that fails prints the errors. The first build gets the packages and compiles the file. If the cache is empty, this takes from 30 seconds to two minutes. An MCP client gives a server approximately 30 seconds to start. If you do not build the server first, the client reports a failure that is only a timeout. This command adds no `bin` directory and no `obj` directory to the project. A file-based app keeps its build output in a cache of the user: `%TEMP%/dotnet/runfile/` on Windows, and `$TMPDIR/dotnet/runfile/` on the other operating systems. The project directory gets one `.cs` file and no other file, and `.gitignore` needs no new line. ## 3. Register the server in this project Each MCP client reads a different configuration file. **Ask the user which client they use, before you write a file.** Do not guess. A file for the wrong client gives a client with no server, and no error message. These are the values for this server. They are the same for each client: - Server id: `generate-password` - Server file: `./.mcp-servers/generate-password.cs` - Command: `dotnet` - Arguments: `run ./.mcp-servers/generate-password.cs -v q` The path is relative to the project. It stays correct for each person who clones the project, and on each operating system. The client finds the path from its working directory, which is the project directory. Now read the page of the client, and obey it: | Client | Configuration file | Read this page | |---|---|---| | Claude Code, Claude Desktop, Cursor, Windsurf | `.mcp.json` in the project root | https://anymcp.net/install/claude-code.md | | Codex | `.codex/config.toml` in the project root | https://anymcp.net/install/codex.md | Each client page gives the shape of the file, the way to name a secret, the way to remove the server, and the end state that you can reach. Commit the configuration file. Then each person who clones the project gets the server. **Do not test the server manually.** If you send JSON-RPC lines in one block, the server gives no output. Standard input comes to the end of the file before the host answers `initialize`, and the log shows only `transport completed reading messages`. This looks like a defective server, but the server is correct. The first client start is the test. After a person starts the client again in the project directory, `generate-password` gives 1 tool(s). Then tell the model to call `generate_password`, and make sure that a result comes back. ## Tools A `tools/list` response contains the wire name. The catalog page shows the C# name. - `generate_password` (C# `GeneratePassword`) — Generates a password with specified length and complexity ## Remove the server Delete the entry of `generate-password` from the configuration file of your client. The page of the client gives the command. Then delete the `.mcp-servers/generate-password.cs` file. ## Install the server for all the projects of one user Do this only if the user asks for it. It changes the configuration of the user, and not the configuration of the project. At this scope the path must be absolute, because each project has a different working directory. Keep the file in a permanent directory. Do not move the file, because the configuration contains the path. The page of each client gives the command: - Claude Code: https://anymcp.net/install/claude-code.md - Codex: https://anymcp.net/install/codex.md ## Notes - Keep the `-v q` option. Standard output carries the JSON-RPC stream. Without `-v q`, the build output can come to that stream and break the protocol. It is two elements, `"-v"` and `"q"`. It is not one element `"-v q"`.