Skip to main content
Glama
nahmanmate

Better Auth MCP Server

by nahmanmate

setup_better_auth

Install and configure Better-Auth authentication system in your project with secure credential handling 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 switch case that handles the execution of the 'setup_better_auth' tool. It extracts arguments, logs the action, stores the config, and returns a success response (with placeholder comment for actual implementation).
    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 entry in the ListTools response, 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, specifying required projectPath and config with projectId and apiKey.
    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"]
    }
  • Interface defining the AuthConfig type used in the setup_better_auth handler and schema.
    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 installation and configuration but fails to specify critical details like whether this modifies project files, requires specific permissions, or has side effects (e.g., overwriting existing auth setups). This leaves significant gaps for a tool that likely performs mutations.

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 front-loads the core action and resource without any wasted words. It is appropriately sized for a straightforward tool, making it easy to parse quickly.

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 installing and configuring an auth system, the description is incomplete. With no annotations and no output schema, it lacks details on behavioral traits (e.g., file modifications, error handling) and expected results. For a tool with nested parameters and likely significant side effects, this minimal description is insufficient.

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 both parameters ('projectPath' and 'config') thoroughly. The description adds no additional meaning beyond implying that 'config' relates to Better-Auth setup, which the schema's property names and descriptions already convey adequately.

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 immediately understandable. However, it does not differentiate from sibling tools like 'analyze_current_auth' or 'test_auth_flows', which focus on analysis/testing rather than installation/configuration.

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 like 'analyze_current_auth' for assessment or 'generate_migration_plan' for planning changes. It lacks context about prerequisites, such as whether the project must be initialized or if Better-Auth dependencies are needed.

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

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