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)}`
            );
          }
        }
      );
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: it's an automated login operation (implies mutation/action), uses predefined credentials (admin/AIWorkshopJuly!25), requires a Playwright server for browser automation, and has a default URL. It doesn't mention potential side effects, error conditions, or what happens after login.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero waste. The first sentence states the core purpose with key details (credentials, URL). The second sentence adds essential prerequisite context (Playwright requirement). Every element earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a login tool with no annotations and no output schema, the description covers the basic operation and prerequisites adequately. However, it doesn't explain what happens after login (success/failure states, session handling) or potential security implications, which would be valuable given the mutation nature and credential usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the single parameter (url). The description adds marginal value by mentioning the default value ('defaults to http://localhost') and that it's for login navigation, but doesn't provide additional syntax or format details beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Performs automated login') with the target resource ('to http://localhost'), and distinguishes it from siblings by specifying it uses browser automation with predefined credentials. It's not just restating the name but explaining the actual implementation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool ('requires a Playwright MCP server to be running for browser automation') and mentions the default credentials, but doesn't explicitly state when NOT to use it or name alternatives among the sibling tools (like get_login_credentials).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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