Skip to content

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

Open
Larry-Osakwe wants to merge 1 commit intomainfrom
age-17/delegated-access-examples
Open

feat(examples): add delegated access examples with @grant decorator#70
Larry-Osakwe wants to merge 1 commit 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
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.

1 participant