Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ba1feb6
Revert "fix: Update milvus connect function to work with remote insta…
franciscojavierarceo May 29, 2025
86b6a20
test: Add Operator E2E tests for Feast Apply and Materialize function…
Srihari1192 May 29, 2025
1ed32d4
fix: Updating milvus connect function to work with remote instance (#…
Fiona-Waters May 30, 2025
2bb7248
feat: Add MCP support to feature server configuration
YassinNouh21 May 31, 2025
479eb7a
fix linter
YassinNouh21 May 31, 2025
edbb58f
add example
YassinNouh21 May 31, 2025
a8b17e1
test: add test cases for the mcp server
YassinNouh21 May 31, 2025
bc00dba
fix linter
YassinNouh21 May 31, 2025
e3a30d7
formatting
YassinNouh21 May 31, 2025
8a644b5
docs: update README for MCP setup instructions
YassinNouh21 May 31, 2025
08c4dd6
fix: update transformation service endpoint and refactor MCP integration
YassinNouh21 May 31, 2025
6c6f6ee
feat: add Model Context Protocol (MCP) support and update documentation
YassinNouh21 May 31, 2025
c3043c1
fix: update entity key serialization version and improve README clarity
YassinNouh21 May 31, 2025
8b26804
Merge branch 'master' into feat/mcp
YassinNouh21 May 31, 2025
1bec81f
fix: refactor MCP imports to use the correct module path
YassinNouh21 May 31, 2025
8aa31a7
feat: Add MCP server implementation files
YassinNouh21 Jun 1, 2025
9409e6a
test: MCP server unit tests and integration tests
YassinNouh21 Jun 1, 2025
426744b
fix formatting
YassinNouh21 Jun 1, 2025
c40809b
fix formatting
YassinNouh21 Jun 1, 2025
6135cde
adding compiled requirements
franciscojavierarceo Jun 4, 2025
b31cc87
Merge branch 'master' into feat/mcp
franciscojavierarceo Jun 4, 2025
b9a84f3
fix linter
franciscojavierarceo Jun 4, 2025
dc71713
reverting duckdb change
franciscojavierarceo Jun 4, 2025
ba6f51a
needed to do file source and duckdb
franciscojavierarceo Jun 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add example
Signed-off-by: yassinnouh21 <yassinnouh21@gmail.com>
  • Loading branch information
YassinNouh21 committed May 31, 2025
commit edbb58f6c477d416e5faf68a351dddbce926d6d1
142 changes: 142 additions & 0 deletions examples/mcp_feature_store/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Feast MCP Feature Server Example
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this!

I'd also add this to the GenAI docs and make it an extra that we enable with pip install feast[mcp]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@franciscojavierarceo done can u check it


This example demonstrates how to enable MCP (Model Context Protocol) support in Feast, allowing AI agents and applications to interact with your feature store through standardized MCP interfaces.
Comment thread
YassinNouh21 marked this conversation as resolved.
Outdated

## Prerequisites

1. Python 3.8+
2. Feast installed
3. FastAPI MCP library

## Installation

1. Install Feast if you haven't already:
```bash
pip install feast
```

2. Install the MCP dependencies:
```bash
pip install fastapi_mcp
```

## Setup

1. Initialize the Feast repository:
```bash
feast init feast_mcp_example
cd feast_mcp_example
```

2. Replace the default `feature_store.yaml` with the MCP-enabled configuration:
```bash
cp ../feature_store.yaml .
```

3. Apply the feature store configuration:
```bash
feast apply
```

4. Materialize some sample data (optional):
```bash
feast materialize-incremental $(date +%Y-%m-%d)
```

## Starting the MCP-Enabled Feature Server

Start the Feast feature server with MCP support:

```bash
feast serve --host 0.0.0.0 --port 6566
```

If 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 server
```

## Available MCP Tools

The server exposes the following MCP tools that can be used by AI agents:

- `get_online_features`: Retrieve feature values for entities
- `list_feature_views`: List all available feature views
- `list_feature_services`: List all available feature services
- `get_feature_store_info`: Get information about the feature store

## Available MCP Resources

- `feast://feature-views`: JSON resource with all feature views
- `feast://feature-services`: JSON resource with all feature services

## Testing MCP Functionality

You can test the MCP functionality by connecting an MCP-compatible client to the server endpoint. The exact method depends on your MCP client.

## Example MCP Client Interaction

```python
# Example of how an MCP client might interact with the server
# (This would be implemented by your MCP client library)

# Get feature store information
store_info = await mcp_client.call_tool("get_feature_store_info")
print(f"Feature store: {store_info}")

# List available feature views
feature_views = await mcp_client.call_tool("list_feature_views")
print(f"Available feature views: {feature_views}")

# Get features for specific entities
features = await mcp_client.call_tool("get_online_features", {
"entities": {"driver_id": [1001, 1002]},
"features": ["driver_hourly_stats:conv_rate", "driver_hourly_stats:acc_rate"]
})
print(f"Features: {features}")
```

## Configuration Details

The key configuration that enables MCP support:

```yaml
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"
```

## Troubleshooting

### MCP not working
- Ensure `fastapi_mcp` is installed: `pip list | grep fastapi_mcp`
- Check that `mcp_enabled: true` in your `feature_store.yaml`
- Look for error messages in the server logs

### Server starts but no MCP support
- Verify the feature server type is set to "mcp"
- Check that both `enabled: true` and `mcp_enabled: true` are set
- Make sure the fastapi_mcp library is properly installed

### Dependencies missing
If you see warnings about missing dependencies:
```bash
pip install fastapi_mcp
```

Then restart the server.

## Next Steps

1. Integrate with your preferred MCP client
2. Customize the MCP server configuration for your use case
3. Add authentication and security as needed for production deployment
4. Explore additional MCP tools and resources as they become available

## Security Note

In production environments, ensure proper authentication and authorization are configured for your Feast deployment when exposing MCP endpoints.
22 changes: 22 additions & 0 deletions examples/mcp_feature_store/feature_store.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
project: feast_mcp_example
registry: data/registry.db
provider: local

online_store:
type: sqlite
path: data/online_store.db

offline_store:
type: file

# MCP Feature Server Configuration
feature_server:
type: mcp
enabled: true
mcp_enabled: true # Enable MCP support - defaults to false
mcp_server_name: "feast-feature-store"
mcp_server_version: "1.0.0"
feature_logging:
enabled: false

entity_key_serialization_version: 2
Comment thread
YassinNouh21 marked this conversation as resolved.
Outdated