Skip to main content
Glama
nieperdragon

MCP Login Server

by nieperdragon

MCP Login Server

A Model Context Protocol (MCP) server that provides automated login functionality for http://localhost using predefined credentials. This server is designed to work with browser automation tools like the Playwright MCP server.

Features

  • Automated Login: Provides tools to perform login operations with predefined credentials

  • Playwright Integration: Designed to work with the Playwright MCP server for browser automation

  • Connection Testing: Includes tools to test connectivity to the target URL

  • Credential Management: Secure handling of login credentials

  • Extensible Architecture: Easy to add new tools with separated tool definitions

Related MCP server: hap-oauth-mcp

Project Structure

src/
├── index.ts          # Main server setup and entry point
├── tools.ts          # Tool definitions and registration
└── index.js          # Compiled JavaScript (auto-generated)

The codebase is structured for easy extensibility:

  • index.ts: Contains the main server setup, startup logic, and process management

  • tools.ts: Contains all tool definitions, registration functions, and configuration

  • ADDING_TOOLS.md: Detailed guide for adding new tools to the server

Installation

npm install
npm run build

Usage

Running the Server

npm start

Or for development:

npm run dev

Available Tools

The server provides the following MCP tools:

  1. perform_login - Performs automated login to http://localhost using predefined credentials

  2. get_login_credentials - Returns the login credentials for verification

  3. test_connection - Tests if the target URL is accessible

Configuration

The server is configured with the following credentials:

  • Target URL: http://localhost

  • Username: admin

  • Password: AIWorkshopJuly!25

These credentials are configured for the OrangeHRM system running on localhost.

MCP Configuration

To use this server with an MCP client (like Claude for Desktop), add the following configuration:

Windows

{
  "mcpServers": {
    "login-server": {
      "command": "node",
      "args": ["C:\\ABSOLUTE\\PATH\\TO\\PROJECT\\build\\index.js"]
    }
  }
}

macOS/Linux

{
  "mcpServers": {
    "login-server": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/PROJECT/build/index.js"]
    }
  }
}

Integration with Playwright MCP Server

This server is designed to work alongside the Playwright MCP server for complete browser automation. The perform_login tool provides the necessary information and steps that can be executed by the Playwright MCP server.

Example Workflow

  1. Use the test_connection tool to verify the target URL is accessible

  2. Use the perform_login tool to get login instructions

  3. Use Playwright MCP server tools to execute the browser automation steps

Development

Project Structure

src/
├── index.ts          # Main server implementation
├── types.ts          # TypeScript type definitions (if any)
build/                # Compiled JavaScript output
.github/              # GitHub configuration
├── copilot-instructions.md  # Copilot development guidelines

Building

npm run build

Scripts

  • npm run build - Compile TypeScript to JavaScript

  • npm start - Run the compiled server

  • npm run dev - Build and run in development mode

  • npm run clean - Clean build directory

Dependencies

  • @modelcontextprotocol/sdk - MCP SDK for TypeScript

  • zod - Runtime type validation

  • typescript - TypeScript compiler

Error Handling

The server includes comprehensive error handling for:

  • Connection failures

  • Invalid credentials

  • Network timeouts

  • MCP protocol errors

Security

  • Credentials are stored as constants in the code

  • No sensitive data is logged to stdout (only to stderr for debugging)

  • Connection testing uses safe HTTP HEAD requests

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Test thoroughly

  5. Submit a pull request

License

ISC License

Available Tools

4 tools
get_login_credentialsB

Returns the login credentials that will be used for authentication to http://localhost

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It states what the tool returns but doesn't disclose critical traits like whether credentials are stored securely, if this is a read-only operation, potential rate limits, or error conditions (e.g., missing credentials).

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?

The description is a single, efficient sentence that directly states the tool's function and target. It's front-loaded with the core action ('Returns the login credentials') and includes necessary context ('for authentication to http://localhost') without any wasted words.

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

Completeness2/5

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

For a tool handling sensitive authentication data with no annotations and no output schema, the description is insufficient. It lacks details on return format (e.g., structured object vs. plain text), security implications, error handling, or how it integrates with sibling authentication tools, leaving significant gaps for an agent.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description appropriately focuses on the tool's purpose without redundant parameter details, meeting the baseline for parameter-less tools.

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

Purpose4/5

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

The description clearly states the tool's purpose with a specific verb ('Returns') and resource ('login credentials'), and specifies the authentication target ('to http://localhost'). However, it doesn't explicitly differentiate from sibling tools like 'perform_login' or 'test_connection', which prevents a perfect score.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., whether credentials must be pre-configured), timing (e.g., before or after login attempts), or relationships to sibling tools like 'perform_login' or 'test_connection'.

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

perform_loginA

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.

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

TDQS

A4.1/5.0
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.

test_connectionA

Tests if the target URL (http://localhost) is accessible

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses the tool's basic behavior (testing URL accessibility) but lacks details about what 'accessible' means (e.g., HTTP status codes, timeout behavior, error handling). It doesn't mention whether this is a read-only operation or has side effects.

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?

The description is a single, efficient sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized for a simple tool with no parameters.

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 simple connectivity test tool with no parameters and no output schema, the description is minimally adequate but lacks important context. It doesn't specify what constitutes 'accessible' (e.g., successful HTTP response, network reachability) or what the output might contain. Without annotations or output schema, more behavioral detail would be helpful.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, and it correctly focuses on the tool's purpose instead.

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 ('Tests') and target resource ('target URL (http://localhost)'), with explicit mention of the accessibility check. It distinguishes this tool from sibling tools like get_login_credentials or perform_login by focusing on connectivity testing rather than authentication or navigation.

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

Usage Guidelines3/5

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

The description implies usage for checking URL accessibility, but provides no explicit guidance on when to use this tool versus alternatives or any prerequisites. The context suggests it might be used before login operations, but this is not stated directly.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.0.0
    • Changedget_login_credentials1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
    • Changednavigate_to_pim1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
    • Changedtest_connection1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
  2. 4 tool updates
    • First observedget_login_credentials
    • First observednavigate_to_pim
    • First observedperform_login
    • First observedtest_connection

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: get_login_credentials retrieves stored credentials, perform_login executes the login process, navigate_to_pim handles post-login navigation, and test_connection checks URL accessibility. There is no overlap or ambiguity between these functions.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern (get_login_credentials, navigate_to_pim, perform_login, test_connection) with clear, descriptive names that uniformly use snake_case. No deviations or mixed conventions are present.

Tool Count5/5

With 4 tools, this server is well-scoped for its login automation purpose. Each tool earns its place by covering distinct aspects: credential management, login execution, navigation, and connectivity testing, without being overly sparse or bloated.

Completeness4/5

The tool set covers core login workflows (testing, credential retrieval, login, post-login navigation) effectively. A minor gap exists in logout functionality, but agents can work around this, and the surface is largely complete for the stated domain.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers