1. Conduid
  2. Search
  3. FastMCPv2 Example
MCP server · Search

FastMCPv2 Example

Playing with https://github.com/jlowin/fastmcp

Unclaimed last commit a year ago search
34Low

Scored 7 months ago · breakdown

About FastMCPv2 Example

FastMCPv2 Example is an MCP server published by thiagorobert in the Search category: playing with https://github.com/jlowin/fastmcp.

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/thiagorobert/FastMCPv2-example

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 FastMCPv2 Example

Powered by Claude · Grounded in docs

I know everything about FastMCPv2 Example. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

FastMCP + OAuth 2.1 Dynamic Client Registration Demo

A hands-on exploration of modern authentication patterns with MCP (Model Context Protocol) using FastMCP v2, Dynamic Client Registration (RFC 7591), and multiple OAuth 2.1 authorization servers.

Key Concepts

🔌 MCP (Model Context Protocol)

MCP enables AI assistants like Claude to securely access external tools and data sources. Instead of hardcoding API integrations, MCP provides a standardized way for AI models to discover and invoke tools dynamically. This demo shows how to build MCP servers with proper OAuth authentication.

🔐 Dynamic Client Registration (RFC 7591)

Traditional OAuth requires manual client setup through provider dashboards. Dynamic Client Registration eliminates this friction by allowing applications to register OAuth clients programmatically. This is especially powerful for:

  • Development environments that need fresh clients
  • Multi-tenant applications
  • Automated testing scenarios

🛡️ OAuth 2.1 Security Enhancements

OAuth 2.1 mandates security best practices that were optional in 2.0:

  • PKCE (Proof Key for Code Exchange) - Prevents authorization code interception
  • JWT access tokens with RS256 - Cryptographically signed and verifiable
  • Strict redirect URI matching - Prevents authorization code theft

🏢 Multiple OAuth Provider Integration

Compare and contrast three different authorization server approaches:

  • Auth0 - Enterprise identity platform
  • Keycloak - Open-source identity management
  • Local OAuth Server - Custom OAuth 2.1 implementation for development

What You'll Learn

✅ MCP Integration - Build servers that AI assistants can consume
✅ OAuth 2.1 Security - PKCE, JWT tokens, and authorization flows
✅ Dynamic Registration - Programmatic client creation across providers
✅ Provider Trade-offs - Compare Auth0, Keycloak, and custom solutions

How It Works

┌─────────────────┐    ┌─────────────────────────┐    ┌─────────────────┐          ┌─────────────┐
│   MCP Client    │    │      Auth Provider      │    │   MCP Server    │          │    GitHub   │
│   (client.py)   │    │ (Auth0/Keycloak/Local)  │    │ (mcp_server.py) │          │     API     │
└─────────────────┘    └─────────────────────────┘    └─────────────────┘          └─────────────┘
         │                          │                          │                          │
         │ 1. Dynamic Client        │                          │                          │
         │     Registration         │                          │                          │
         │─────────────────────────►│                          │                          │
         │                          │                          │                          │
         │ 2. OAuth Flow            │                          │                          │
         │◄────────────────────────►│                          │                          │
         │                                                     │                          │
         │                                                     │                          │
         │ 3. Authenticated calls to MCP Tools                 │ 4. GitHub API calls      │
         │            (with JWT)                               │ (Personal Access Token)  │
         │────────────────────────────────────────────────────►│─────────────────────────►│
         │                                                     │                          │

The demo showcases the complete OAuth 2.1 + MCP integration flow:

  1. Dynamic Registration - Client registers itself programmatically
  2. PKCE OAuth Flow - Secure authorization with code challenges
  3. JWT Authentication - MCP server validates tokens from auth provider
  4. GitHub API Access - MCP server uses Personal Access Token to call GitHub API

Quick Start

1. Setup

git clone https://github.com/thiagorobert/FastMCPv2-example.git
cd FastMCPv2-example
uv sync

# Patch .venv
./scripts/apply_venv_patch.sh

# Configure environment
cp env.example .env
# Edit .env and set GITHUB_ACCESS_TOKEN

2. Try the Local OAuth Demo

Experience the complete flow with zero external dependencies:

# Terminal 1: Start local OAuth server
uv run python src/local_auth_server.py

# Terminal 2: Start MCP server with local auth
./scripts/run_asgi.sh --auth-provider local

# Terminal 3: Run the dynamic client registration demo
uv run src/client.py

What happens:

  1. client.py registers a new OAuth client dynamically
  2. Performs PKCE-enhanced OAuth flow with the local OAuth server
  3. Uses the JWT token to call authenticated MCP tools
  4. Fetches your GitHub repositories via the MCP server

Alternative Providers

🏢 Auth0 Setup

  1. Follow the Auth0 setup guide to configure your Auth0 environment
  2. Run the demo:
./scripts/run_asgi.sh --auth-provider auth0
uv run src/client.py

🔧 Keycloak Setup

  1. Start Keycloak:
podman run -p 8081:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:24.0.4 start-dev
  1. Follow the Keycloak setup guide to configure your Keycloak environment
  2. Run the demo:
./scripts/run_asgi.sh --auth-provider keycloak
uv run src/client.py

Test MCP Integration with Claude CLI

# Test direct MCP invocation from Claude CLI
./scripts/test_mcp_using_claude.sh

Note: This uses stdio transport - no OAuth authentication involved.

Resources

List of Auth providers

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

Questions

About FastMCPv2 Example

How do I install FastMCPv2 Example?

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

Is FastMCPv2 Example 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 FastMCPv2 Example still maintained?

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