1. Conduid
  2. Search
  3. Fastmcp Scalekit Example
MCP server · Search

Fastmcp Scalekit Example

Unclaimed last commit a year ago search
30Low

Scored 7 months ago · breakdown

About Fastmcp Scalekit Example

Fastmcp Scalekit Example is an MCP server published by scalekit-inc in the Search category.

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/scalekit-inc/fastmcp-scalekit-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 Fastmcp Scalekit Example

Powered by Claude · Grounded in docs

I know everything about Fastmcp Scalekit 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 Server with Scalekit OAuth Example

This example demonstrates how to build an MCP server using the FastMCP framework with Scalekit as the OAuth provider for authentication and authorization.

Features

  • OAuth 2.1 Authentication: Uses Scalekit for secure user authentication
  • Dynamic Client Registration: Supports DCR for automated client setup
  • JWT Token Validation: Validates access tokens from Scalekit
  • Scope-based Authorization: Fine-grained access control for different operations
  • Resource Discovery: Provides OAuth resource metadata endpoint

Setup

1. Install Dependencies

pip install -r requirements.txt

2. Configure Environment Variables

Copy the example environment file and fill in your Scalekit details:

cp .env.example .env

Edit .env with your Scalekit configuration:

SCALEKIT_ENVIRONMENT_URL=https://your-env.scalekit.com
SCALEKIT_CLIENT_ID=your_client_id_from_scalekit
SCALEKIT_CLIENT_SECRET=your_client_secret_from_scalekit
SCALEKIT_RESOURCE_ID=your_resource_id_from_scalekit
SERVER_BASE_URL=https://your-server-domain.com

3. Scalekit Setup

  1. Create a Scalekit Account: Sign up at Scalekit

  2. Register Your MCP Server:

    • Go to your Scalekit dashboard
    • Create a new application
    • Note down your Client ID and Client Secret
  3. Register MCP Server Resource:

    • In your Scalekit dashboard, navigate to "Resources" or "MCP Servers"
    • Click "Register New MCP Server" or "Add Resource"
    • Fill in your MCP server details:
      • Name: Your MCP server name (e.g., "My FastMCP Server")
      • Base URL: Your server's base URL (e.g., http://localhost:8000/mcp)
      • Description: Brief description of your server's functionality
    • After registration, copy the Resource ID from the dashboard
    • This Resource ID should be used as SCALEKIT_RESOURCE_ID in your .env file
  4. Configure Scopes: Set up the required scopes in your Scalekit application:

    • profile:read
    • organizations:read
    • resources:read
    • resources:write
    • metrics:read

Running the Server

Method 1: Direct Execution

python server.py

Method 2: Using FastMCP CLI

fastmcp run server.py:mcp

Available Tools

The server provides the following authenticated tools:

  • get_user_profile(user_id): Get user profile information
  • list_organizations(): List accessible organizations (requires organizations:read scope)
  • create_resource(name, description, organization_id): Create resources (requires resources:write scope)
  • get_api_metrics(): Get API usage metrics (requires metrics:read scope)

OAuth Flow

  1. Client Registration: MCP clients can use Scalekit's Dynamic Client Registration
  2. Authorization: Users authenticate via Scalekit's OAuth flow
  3. Token Issuance: Scalekit issues JWT access tokens with appropriate scopes
  4. API Access: Clients include tokens in requests to the MCP server
  5. Token Validation: Server validates tokens using Scalekit's JWKS endpoint

Security Features

  • JWT Validation: All tokens are validated against Scalekit's JWKS
  • Scope Enforcement: Tools can check for required scopes
  • Audience Validation: Ensures tokens are intended for this server
  • Expiration Checking: Automatically rejects expired tokens

Development

Testing with curl

# Get an access token from Scalekit first, then:
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -X POST \
     -d '{"method": "tools/call", "params": {"name": "list_organizations", "arguments": {}}}' \
     http://localhost:8000

Adding New Tools

@mcp.tool
def your_new_tool(param: str) -> dict:
    """Your tool description"""
    # Add scope checking if needed
    # Implement your business logic
    return {"result": "success"}

Production Considerations

  • Use HTTPS in production
  • Set appropriate CORS policies
  • Implement rate limiting
  • Add comprehensive logging
  • Use environment-specific Scalekit configurations
  • Consider token caching strategies for performance

Resources

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

Questions

About Fastmcp Scalekit Example

How do I install Fastmcp Scalekit Example?

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

Is Fastmcp Scalekit Example safe to use with an AI agent?

Its trust score is 30 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 Fastmcp Scalekit 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.