Skip to main content
Glama
nieperdragon

MCP Login Server

by nieperdragon

perform_login

Automate login to localhost web applications using predefined credentials via the Playwright MCP server, enabling secure and efficient browser automation.

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

  • The core handler function for the 'perform_login' tool. It generates login steps using predefined credentials, formats a detailed response message, and returns it as structured content. Includes error handling with McpError.
    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)}` ); } }
  • Zod input schema for 'perform_login' tool defining an optional 'url' parameter validated as a string URL.
    { url: z.string().url().optional().describe("The URL to navigate to for login (defaults to http://localhost)") },
  • src/tools.ts:21-86 (registration)
    The server.tool call within registerPerformLoginTool that registers the 'perform_login' tool, specifying name, description, schema, and handler.
    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)}` ); } } ); }
  • Helper constant providing hardcoded login credentials (username, password, targetUrl) used by the perform_login handler.
    export const LOGIN_CREDENTIALS = { username: "admin", password: "AIWorkshopJuly!25", targetUrl: "http://localhost" };
  • src/tools.ts:242-242 (registration)
    Call to registerPerformLoginTool inside registerAllTools function, which is invoked during server setup.
    registerPerformLoginTool(server);

Other Tools

Related Tools

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