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:
pip install feast[mcp]Alternatively, you can install the dependencies separately:
pip install feast
pip install fastapi_mcpSetup
Navigate to this example directory within your cloned Feast repository:
cd examples/mcp_feature_storeInitialize a Feast repository in this directory. We'll use the existing
feature_store.yamlthat's already configured for MCP:
feast init . 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:
cd feature_repo
feast apply
cd .. # Go back to examples/mcp_feature_store for the next stepsStarting the MCP-Enabled Feature Server
Start the Feast feature server with MCP support:
feast serve --host 0.0.0.0 --port 6566If MCP is properly configured, you should see a log message indicating that MCP support has been enabled:
INFO:feast.feature_server:MCP support has been enabled for the Feast feature serverAvailable 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-featuresto retrieve features from the feature storeUse
/healthto check server status
Configuration Details
The key configuration that enables MCP support:
feature_server:
type: mcp # Use MCP feature server type
enabled: true # Enable feature server
mcp_enabled: true # Enable MCP protocol support
mcp_server_name: "feast-feature-store"
mcp_server_version: "1.0.0"Last updated
Was this helpful?