Skip to content

feat(examples): add delegated access examples with @grant decorator#70

Merged
Larry-Osakwe merged 2 commits intomainfrom
age-17/delegated-access-examples
Feb 12, 2026
Merged

feat(examples): add delegated access examples with @grant decorator#70
Larry-Osakwe merged 2 commits intomainfrom
age-17/delegated-access-examples

Conversation

@Larry-Osakwe
Copy link
Contributor

Summary

  • Add delegated_access example for mcp-fastmcp package demonstrating GitHub API integration
  • Add delegated_access example for mcp package (low-level integration with AccessContext as function parameter)
  • Remove commented-out @grant stubs from hello_world examples
  • Update hello_world READMEs to link to the full delegated_access examples
  • Add httpx and fastmcp to dev dependencies for example testing

Examples Structure

packages/mcp/examples/
├── hello_world_server/    # Basic auth (cleaned up)
└── delegated_access/      # Full @grant example (NEW)

packages/mcp-fastmcp/examples/
├── hello_world_server/    # Basic auth (cleaned up)
└── delegated_access/      # Full @grant example

Key Features Demonstrated

  • AuthProvider setup with ClientSecret credentials
  • @grant decorator for token exchange
  • AccessContext for accessing exchanged tokens
  • Comprehensive error handling (has_errors(), get_errors(), has_resource_error(), etc.)
  • GitHub API integration as a real-world example

Closes

AGE-17

- Add delegated_access example for mcp-fastmcp package (GitHub API integration)
- Add delegated_access example for mcp package (low-level integration)
- Remove commented @grant stubs from hello_world examples
- Update hello_world READMEs to link to delegated_access examples
- Add httpx and fastmcp to dev dependencies for example testing
@Larry-Osakwe Larry-Osakwe requested a review from mnoble February 10, 2026 18:41
Expand delegated access READMEs to explicitly document that users
must create a GitHub App with correct permissions, then configure
it as a credential provider in Keycard before setting up the API
resource.
@Larry-Osakwe Larry-Osakwe merged commit 60e5c40 into main Feb 12, 2026
6 checks passed
@Larry-Osakwe Larry-Osakwe deleted the age-17/delegated-access-examples branch February 12, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants