This is a project created with the create-honc-app template, extended to function as an MCP (Model Context Protocol) server with user authentication via GitHub, powered by better-auth.
Learn more about the HONC stack on the website or the main repo. There is also an Awesome HONC collection with further guides, use cases and examples.
If your MCP client has first class support for remote MCP servers, the client will provide a way to accept the server URL (https://better-auth-mcp.cjjdxhdjd.workers.dev/sse) directly within its interface.
If your client does not yet support remote MCP servers, you will need to set up its respective configuration file using mcp-remote to specify which servers your client can access.
Replace the content with the following configuration:
{
"mcpServers": {
"cloudflare": {
"command": "npx",
"args": [
"mcp-remote",
"https://better-auth-mcp.cjjdxhdjd.workers.dev/sse"
]
}
}
}Make sure you have Neon set up and configured with your database.
- Node.js and npm/yarn/pnpm
- A Neon database (or other PostgreSQL provider)
- A GitHub OAuth Application for user authentication.
- Cloudflare account and wrangler CLI installed and configured.
Create a .dev.vars and .env(for better-auth schema generation) file for
local development (copied from .env.example) and set up secrets/variables in
your Cloudflare Worker environment for deployment.
- Clone the repository.
git clone https://github.com/dead8309/better-auth-mcp-hono/- Install dependencies:
pnpm install-
Set up environment variables: Create a
.dev.varsand.envfiles from.env.example. -
Run the development server:
pnpm dev
Set your secrets (and any other secrets you need) with wrangler:
pnpm wrangler secret bulk .dev.varsDeploy with wrangler:
pnpm deploy