Skip to main content
Glama
nieperdragon

MCP Login Server

by nieperdragon

perform_login

Automates login to localhost applications using predefined credentials. Requires Playwright MCP server for browser automation to handle authentication processes.

Instructions

Performs automated login to http://localhost using predefined credentials (admin/AIWorkshopJuly!25). This tool requires a Playwright MCP server to be running for browser automation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoThe URL to navigate to for login (defaults to http://localhost)

Implementation Reference

  • Constant object defining the predefined login credentials (username, password, target URL) used by the perform_login tool handler.
    export const LOGIN_CREDENTIALS = { username: "admin", password: "AIWorkshopJuly!25", targetUrl: "http://localhost" };
  • Zod input schema for the perform_login tool, defining an optional 'url' parameter.
    { url: z.string().url().optional().describe("The URL to navigate to for login (defaults to http://localhost)") },
  • The core handler function for 'perform_login' tool. Generates step-by-step login instructions using predefined credentials and returns a formatted response. Designed to integrate with Playwright for actual automation (demo version provides instructions).
    async ({ url = LOGIN_CREDENTIALS.targetUrl }) => { try { // Note: This is a demonstration tool that provides login instructions // In a real implementation, this would interface with the Playwright MCP server // to perform actual browser automation const loginSteps = [ `Navigate to ${url}`, `Fill username field with: ${LOGIN_CREDENTIALS.username}`, `Fill password field with: ${LOGIN_CREDENTIALS.password}`, `Click the login button`, `Wait for successful login confirmation` ]; const response = { success: true, message: "Login tool executed successfully", steps: loginSteps, credentials: { username: LOGIN_CREDENTIALS.username, target_url: url }, note: "This tool provides login instructions. To perform actual browser automation, integrate with a running Playwright MCP server." }; return { content: [ { type: "text", text: `Login Tool Response: āœ… Tool: perform_login šŸŽÆ Target URL: ${url} šŸ‘¤ Username: ${LOGIN_CREDENTIALS.username} šŸ”‘ Password: [Protected] šŸ“‹ Login Steps: ${loginSteps.map((step, index) => `${index + 1}. ${step}`).join('\n')} šŸ’” Note: This tool is designed to work with the Playwright MCP server for actual browser automation. To perform real login automation, ensure the Playwright MCP server is running and accessible. šŸ”§ For browser automation integration, this tool can be extended to: - Connect to the Playwright MCP server - Execute browser commands through MCP protocol - Handle login success/failure scenarios - Provide detailed feedback on login process` } ] }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Login tool failed: ${error instanceof Error ? error.message : String(error)}` ); } }
  • src/tools.ts:20-86 (registration)
    Function that registers the 'perform_login' tool with the MCP server, specifying name, description, input schema, and handler implementation.
    export function registerPerformLoginTool(server: McpServer): void { server.tool( "perform_login", "Performs automated login to http://localhost using predefined credentials (admin/AIWorkshopJuly!25). This tool requires a Playwright MCP server to be running for browser automation.", { url: z.string().url().optional().describe("The URL to navigate to for login (defaults to http://localhost)") }, async ({ url = LOGIN_CREDENTIALS.targetUrl }) => { try { // Note: This is a demonstration tool that provides login instructions // In a real implementation, this would interface with the Playwright MCP server // to perform actual browser automation const loginSteps = [ `Navigate to ${url}`, `Fill username field with: ${LOGIN_CREDENTIALS.username}`, `Fill password field with: ${LOGIN_CREDENTIALS.password}`, `Click the login button`, `Wait for successful login confirmation` ]; const response = { success: true, message: "Login tool executed successfully", steps: loginSteps, credentials: { username: LOGIN_CREDENTIALS.username, target_url: url }, note: "This tool provides login instructions. To perform actual browser automation, integrate with a running Playwright MCP server." }; return { content: [ { type: "text", text: `Login Tool Response: āœ… Tool: perform_login šŸŽÆ Target URL: ${url} šŸ‘¤ Username: ${LOGIN_CREDENTIALS.username} šŸ”‘ Password: [Protected] šŸ“‹ Login Steps: ${loginSteps.map((step, index) => `${index + 1}. ${step}`).join('\n')} šŸ’” Note: This tool is designed to work with the Playwright MCP server for actual browser automation. To perform real login automation, ensure the Playwright MCP server is running and accessible. šŸ”§ For browser automation integration, this tool can be extended to: - Connect to the Playwright MCP server - Execute browser commands through MCP protocol - Handle login success/failure scenarios - Provide detailed feedback on login process` } ] }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Login tool failed: ${error instanceof Error ? error.message : String(error)}` ); } } ); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nieperdragon/custom_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server