Skip to content

rekog-labs/mcp-nest-auth-starter

Repository files navigation

MCP Nest Auth Starter

Deploy on Railway

A starter template for building MCP Servers that implement the MCP Authorization flow.

Getting Started

The fastest way to try out Remote MCP servers with built-in authentication is by deploying on Railway with the template below:

Deploy on Railway

For the deployment you need the following:

  1. Create a New GitHub App, required for user authentication
    • For the "Authorization callback URL" add the placeholder http://localhost:3000/auth/callback and create the app, you will update it at step 5.
  2. Add the GitHub Client ID and Client Secret in the Deploy panel on Railway, and click "Deploy"
  3. After the app is deployed, the Custom Domain is available in the railway deployment settings page.
  4. Update the "Authorization callback URL" of the GitHub app to the custom domain with the postfix as shown here: https://<custom-domain>.up.railway.app/auth/callback.

And you are ready to roll!

Open MCP Inspector at https://<custom-domain>.up.railway.app/mcp to see the available resources and tools.

Local Installation

Clone the repository and install dependencies:

git clone https://github.com/rekog-labs/mcp-nest-auth-starter.git
cd mcp-nest-auth-starter
npm install

Set the environment variables in a .env file at the root of the project. You can use the provided .env.example as a template.

SERVER_URL=http://localhost:3000
GITHUB_CLIENT_ID=<your_github_client_id>
GITHUB_CLIENT_SECRET=<your_github_client_secret>
JWT_SECRET=<your_jwt_secret>

Environment Variables

  • SERVER_URL - The base URL of your application.
  • GITHUB_CLIENT_ID - Your GitHub OAuth client ID.
  • GITHUB_CLIENT_SECRET - Your GitHub OAuth client secret.
  • JWT_SECRET - Your JSON Web Token secret.

Running the App

Development

npm run start:dev

Production

npm run build
npm run start:prod

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published