Skip to main content
Glama
LexiconAlex

Better Auth MCP Server

by LexiconAlex

setup_better_auth

Install and configure Better-Auth authentication in your project with secure credential management and multi-protocol support.

Instructions

Install and configure Better-Auth in the project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the project root
configYesBetter-Auth configuration options

Implementation Reference

  • The handler logic for the 'setup_better_auth' tool within the CallToolRequestSchema switch statement. It extracts projectPath and config from arguments, logs the action, stores the config globally, and returns a success message.
    case "setup_better_auth": {
      const { projectPath, config } = request.params.arguments as { 
        projectPath: string, 
        config: AuthConfig 
      };
      logger.info(`Setting up Better-Auth in ${projectPath}`);
      authConfig = config;
      // Implementation would install dependencies and configure Better-Auth
      return {
        content: [{
          type: "text",
          text: `Better-Auth setup complete in ${projectPath}`
        }]
      };
    }
  • src/index.ts:74-97 (registration)
    The tool registration in the ListToolsRequestSchema handler, defining the name, description, and input schema for 'setup_better_auth'.
    {
      name: "setup_better_auth",
      description: "Install and configure Better-Auth in the project",
      inputSchema: {
        type: "object",
        properties: {
          projectPath: {
            type: "string",
            description: "Path to the project root"
          },
          config: {
            type: "object",
            description: "Better-Auth configuration options",
            properties: {
              projectId: { type: "string" },
              apiKey: { type: "string" },
              environment: { type: "string" }
            },
            required: ["projectId", "apiKey"]
          }
        },
        required: ["projectPath", "config"]
      }
    },
  • The input schema definition for the 'setup_better_auth' tool.
    inputSchema: {
      type: "object",
      properties: {
        projectPath: {
          type: "string",
          description: "Path to the project root"
        },
        config: {
          type: "object",
          description: "Better-Auth configuration options",
          properties: {
            projectId: { type: "string" },
            apiKey: { type: "string" },
            environment: { type: "string" }
          },
          required: ["projectId", "apiKey"]
        }
      },
      required: ["projectPath", "config"]
    }
  • Type definition for AuthConfig used in the setup_better_auth tool handler.
    interface AuthConfig {
      projectId?: string;
      apiKey?: string;
      environment?: string;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'Install and configure,' implying a mutation operation, but fails to detail critical aspects like required permissions, whether it modifies existing files, potential side effects, or error handling. This leaves significant gaps for safe and effective use.

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, direct sentence that efficiently conveys the core action without unnecessary words. It is front-loaded and wastes no space, making it highly concise and well-structured for quick comprehension.

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?

Given the complexity of a setup/configuration tool with no annotations and no output schema, the description is insufficient. It lacks details on what 'Install and configure' entails operationally, expected outcomes, error scenarios, or how it interacts with sibling tools, making it incomplete for informed agent use.

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?

The input schema has 100% description coverage, clearly documenting the two parameters ('projectPath' and 'config') and their nested properties. The description does not add any extra meaning beyond the schema, such as explaining the purpose of 'config' options or providing examples, so it meets the baseline for adequate but unenriched parameter information.

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 action ('Install and configure') and the target resource ('Better-Auth in the project'), making the purpose understandable. However, it does not explicitly differentiate this tool from siblings like 'analyze_current_auth' or 'generate_migration_plan', which might involve related but distinct operations, so it falls short of 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?

The description provides no guidance on when to use this tool versus alternatives, such as whether it's for initial setup versus updates, or how it relates to sibling tools like 'analyze_current_auth' or 'test_auth_flows'. It lacks context on prerequisites or exclusions, leaving usage ambiguous.

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/LexiconAlex/better-auth-mcp-server'

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