1. Conduid
  2. Security
  3. Micro Oauth Server
MCP server · Security

Micro Oauth Server

A minimal OAuth 2.1 authorization server for .NET. The main usage is to to secure MCP (Model Context Protocol) servers with standards-compliant OAuth flows.

Unclaimed last commit 9 months ago security
34Low

Scored 6 months ago · breakdown

About Micro Oauth Server

Micro Oauth Server is an MCP server published by okolobaxa in the Security category: a minimal OAuth 2.1 authorization server for .NET. The main usage is to to secure MCP (Model Context Protocol) servers with standards-compliant OAuth flows.

The repository has 1 stars and 0 forks, with the last commit 9 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/okolobaxa/micro-oauth-server

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Micro Oauth Server

Powered by Claude · Grounded in docs

I know everything about Micro Oauth Server. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

MicroOAuthServer

A minimal OAuth 2.1 authorization server for .NET. The main usage is to to secure MCP (Model Context Protocol) servers with standards-compliant OAuth flows.

See MCP protocol specification for details about authorization requirements.

Features

  • 🔐 OAuth 2.1 Compliant - PKCE-only flow (S256 method). Only Authorization Code and Refresh Token flows are supported.
  • 📋 Additional Standards Support:

Quick Start

1. Install the NuGet package

Using .NET CLI

dotnet add package MicroOAuthServer --version 0.0.2

or using Package Manager

Install-Package MicroOAuthServer -Version 0.0.2

2. Registed dependencies in your ASP.NET project's Program.cs

using MicroOAuthServer;
using MicroOAuthServer.WebApp.Data;
using MicroOAuthServer.WebApp.Services;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens;
using System.Text;

var builder = WebApplication.CreateBuilder(args);

...

builder.Services.AddMicroOAuthServer(options =>
    {
        options.JwtSigningKey = "ThisIsTotallyNotMyJWTSecretPleaseDontHackMe!";
        options.Issuer = "https://localhost:7194";
    })
    .UseEntityFrameworkCore(options => 
    { 
      options.UseDbContext<ApplicationDbContext>(); 
    })
    .AddUserStore<DemoUserStore>()
    .WithDynamicClientRegistration()
    .WithAuthorizationServerMetadata()
    .WithResourceServerMetadata();
...

// Configure default for JWT authentication ommited

...

var app = builder.Build();

...

app.UseMicroOAuthServer()            // /oauth/authorize and /oauth/token
   .UseDynamicClientRegistration()   // /oauth/register
   .UseAuthorizationServerMetadata() // /.well-known/oauth-authorization-server
   .UseResourceServerMetadata();     // /.well-known/auth-protected-resource

...

app.Run();

3. Register tables in the DbContext

// Your DbContext
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : DbContext
{
    // Your application entities (User, etc.)
    public DbSet<User> Users { get; set; }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);

        // Configure MicroOAuthServer entities
        modelBuilder.ConfigureMicroOAuthServer();
    }
}

4. Implement reqired parts

Required (Implement Your Own):

  • IUserStore - Authenticate users against your database
  • Consent screen for you appp on /oauth/authorize. See examples.

Optional (Customize as Needed):

  • IAuthorizationHandler
  • ITokenHandler
  • IClientStore, IAuthorizationCodeStore, IRefreshTokenStore

Register a custom implementation of the insterfaces after .AddMicroOAuthServer() call to replace built-in.

Example

1. Build and run


cd ./examples/MicroOAuthServer.WebAppWithMCP/
dotnet run

Or if you have .NET Aspire


cd ./examples/
aspire run

Aspire will automatically setup a Docker container with MS SQL database.

2. Test

Use MCP Inspecector to explore MCP tools in the example application. It has all OAuth-related functionality build-in, including support for dynamic client registration.

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About Micro Oauth Server

How do I install Micro Oauth Server?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Micro Oauth Server safe to use with an AI agent?

Its trust score is 34 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Micro Oauth Server still maintained?

The last commit was 9 months ago. That's long enough that you should check whether the maintainer is responding to issues before depending on it.