Skip to main content
Glama
onimsha

Airtable OAuth MCP Server

by onimsha

list_bases

Retrieve all accessible Airtable bases using a standardized interface with secure OAuth 2.0 authentication, enabling integration with AI assistants and applications.

Instructions

List all accessible Airtable bases

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler and registration for 'list_bases'. Retrieves authenticated client and returns list of accessible bases.
    @self.mcp.tool(description="List all accessible Airtable bases") async def list_bases() -> list[dict[str, Any]]: """List all accessible Airtable bases.""" client = await self._get_authenticated_client() response = await client.list_bases() return [ { "id": base.id, "name": base.name, "permissionLevel": base.permission_level, } for base in response.bases ]
  • Pydantic models AirtableBase and ListBasesResponse used for parsing the Airtable API response in list_bases.
    class AirtableBase(BaseModel): """Represents an Airtable base.""" id: str name: str permission_level: str = Field(alias="permissionLevel") class ListBasesResponse(BaseModel): """Response from listing Airtable bases.""" bases: list[AirtableBase]
  • AirtableClient.list_bases method: makes the actual API request to /v0/meta/bases and parses response.
    async def list_bases(self) -> ListBasesResponse: """List all accessible Airtable bases. Returns: Response containing list of bases """ logger.info("Listing Airtable bases") return await self._make_request( "GET", "/v0/meta/bases", response_model=ListBasesResponse, )
  • Helper method to create an authenticated AirtableClient using the OAuth access token from the context.
    async def _get_authenticated_client(self) -> AirtableClient: """Get an authenticated Airtable client using access token from context. Returns: Authenticated AirtableClient instance Raises: AirtableAuthError: If authentication fails """ # Get access token from authentication context (set by middleware) access_token = AuthContext.require_access_token() try: # Use the OAuth provider provider = self._get_oauth_provider() if not provider: raise AirtableAuthError( "OAuth provider not available - ensure OAuth endpoints are enabled and credentials are configured" ) # Set the access token in the provider provider.access_token = access_token return AirtableClient(provider) except Exception as e: logger.error(f"Failed to create authenticated client: {e}") raise AirtableAuthError(f"Authentication failed: {e}") from e

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/onimsha/airtable-mcp-server-oauth'

If you have feedback or need assistance with the MCP directory API, please join our Discord server