Skip to main content

dole

Project description

dole

summary & introduction

this package provides some helper classes needed for using fastmcp with azure authentication. in particular, fastmcp 2.12.5 has certain problems when trying to use the provided fastmcp.server.auth.AzureProvider with a py-key-value-aio RedisStore as described in the fastmcp documentation.

usage

from fastmcp import FastMCP
from dole.azure import azure_auth
from dole.health import add_health_endpoint, add_logging_health_filter

add_logging_health_filter()

tenant_id = 'my entra tenant id'
client_id = 'my entra app client id'
client_secret = '.......'
redis_host = 'redis'
redis_db = '0'
redis_port = '6379'
base_url = 'http://localhost:8000' # note that we do not include the mcp suffix
auth = azure_auth(
    tenant_id, client_id, client_secret, base_url,
    redis_host, redis_db, redis_port)

mcp = FastMCP(
    name="my-mcp-server",
    instructions="""
    """,
    auth=auth,
)
add_health_endpoint(mcp)

n.b., the following environment variables can also be used in lieu of parameters to azure_auth:

env var description
TENANT_ID the entra tenant id
CLIENT_ID found on the entra app registration overview
CLIENT_SECRET from the app registration certificates & secrets
REDIS_HOST the redis host or ip address
REDIS_PORT the redis port
REDIS_DB the redis db
BASE_URL the base url of the mcp server (without the /mcp suffix)
FERNET_ENCRYPTION_KEY the optional encryption key to encrypt values in redis

powered by angry penguins.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dole-0.2.tar.gz (6.9 kB view details)

Uploaded Source

File details

Details for the file dole-0.2.tar.gz.

File metadata

  • Download URL: dole-0.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for dole-0.2.tar.gz
Algorithm Hash digest
SHA256 df40d465c1ca1caa3f93339b8831fb903fe6d6f36c6a300810ec2edf45822f37
MD5 57a06b948c12287032d37d06223419a1
BLAKE2b-256 9fcab1e122441b5980688f0ac2629a5492e23cdf7161f8c7c6bfe1333f107fc2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page