get_password
Retrieve stored passwords for specific usernames on websites to facilitate automated logins. Input website domain and username to securely access credentials.
Instructions
Retrieve the password for a username when logging into a website.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | The username or email of the account you need to login, e.g. "john.doe@example.com" | |
| website | Yes | The domain name of the website you need to login, e.g. "github.com" |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"username": {
"description": "The username or email of the account you need to login, e.g. \"john.doe@example.com\"",
"type": "string"
},
"website": {
"description": "The domain name of the website you need to login, e.g. \"github.com\"",
"type": "string"
}
},
"required": [
"website",
"username"
],
"type": "object"
}
Implementation Reference
- src/mcp.ts:51-75 (registration)Registers the 'get_password' MCP tool with name, description, Zod input schema, and handler function that delegates to Authenticator.getPassword and formats the response.this.tool( 'get_password', 'Retrieve the password for a username when logging into a website.', { website: z .string() .describe('The domain name of the website you need to login, e.g. "github.com"'), username: z .string() .describe( 'The username or email of the account you need to login, e.g. "john.doe@example.com"' ), }, async ({ website, username }, extra) => { const res = await this.authenticator.getPassword(website, username); return { content: [ { type: 'text', text: `The password is ${res.password}.`, }, ], }; } );
- src/authenticator.ts:53-67 (handler)Core handler function in Authenticator class that performs HTTP GET request to the backend API endpoint '/password' to retrieve the password for given website and username.async getPassword(website: string, username: string): Promise<GetPasswordResponse> { const url = `${this.baseUrl}/password?website=${encodeURIComponent(website)}&username=${encodeURIComponent(username)}`; const response = await fetch(url, { headers: { Authorization: `Bearer ${this.accessToken}`, }, }); if (!response.ok) { const errorBody = await response.text(); console.error(`HTTP error ${response.status} from ${url}: ${errorBody}`); throw new Error(`HTTP error ${response.status}: ${errorBody}`); } return (await response.json()) as GetPasswordResponse; }
- src/authenticator.ts:21-23 (schema)TypeScript interface defining the response structure from the password retrieval API.export interface GetPasswordResponse { password: string; }
- src/mcp.ts:54-63 (schema)Zod schema defining the input parameters for the 'get_password' tool: website and username.{ website: z .string() .describe('The domain name of the website you need to login, e.g. "github.com"'), username: z .string() .describe( 'The username or email of the account you need to login, e.g. "john.doe@example.com"' ), },