MCP - AI Agent Example
This example demonstrates how to enable MCP (Model Context Protocol) support in Feast, allowing AI agents and applications to interact with your features through standardized MCP interfaces.
Prerequisites
Python 3.8+
Feast installed
FastAPI MCP library
Installation
Install Feast with MCP support:
Alternatively, you can install the dependencies separately:
Setup
Navigate to this example directory within your cloned Feast repository:
Initialize a Feast repository in this directory. We'll use the existing
feature_store.yaml
that's already configured for MCP:
This will create a data
subdirectory and a feature_repo
subdirectory if they don't exist, and will use the feature_store.yaml
present in the current directory (examples/mcp_feature_store
).
Apply the feature store configuration:
Starting the MCP-Enabled Feature Server
Start the Feast feature server with MCP support:
If MCP is properly configured, you should see a log message indicating that MCP support has been enabled:
Available MCP Tools
The fastapi_mcp integration automatically exposes your Feast feature server's FastAPI endpoints as MCP tools. This means AI assistants can:
Call
/get-online-features
to retrieve features from the feature storeUse
/health
to check server status
Configuration Details
The key configuration that enables MCP support:
Last updated
Was this helpful?