Standalone MCP Server Example
This guide explains how to run the standalone Feast MCP server (feast mcp) against a local feature store, and how to call its tools from an MCP client.
Unlike the MCP feature store example, which enables MCP inside the feature server process, feast mcp runs as a separate server. It holds no registry or online store of its own, and instead proxies to a running Feast deployment, exposing two tool namespaces:
features_*
The feature server (feast serve)
features.url is set
registry_*
The REST registry server (feast serve_registry --rest-api)
registry.url is set
See the Standalone MCP server reference for the full list of options.
Files
feast_mcp.yaml: MCP server configuration, covering transport, upstream URLs, authentication, and logging.
mcp_client_demo.py: A minimal MCP client that lists the available tools and calls one from each namespace.
kubernetes/featurestore-mcpserver.yaml: The same deployment on Kubernetes, using the Feast Operator.
Prerequisites
Python 3.11+ environment
Feast with the MCP server extra:
pip install 'feast[mcp-server]'.
Setup
1. Create a feature repository
The MCP server needs a running Feast deployment to proxy to, so start by creating a local feature store. From this directory:
Apply the feature definitions to register the
driver_hourly_statsfeature view that the demo client queries:Load the online store, so that the feature retrieval returns actual values rather than nulls:
Note:
feast initnames the project after the directory, so the project here isfeast_demo, notmy_project.
2. Start the Feast servers
Both upstream servers run from the feature repository directory. In two separate terminals, from feast_demo/feature_repo:
Start the feature server:
Start the registry server. The registry serves gRPC by default, so
--rest-apiis required here because the MCP server talks to the registry over REST:
3. Start the MCP server
In a third terminal, from this directory:
The provided feast_mcp.yaml sets
transport: http, so the MCP endpoint is served athttp://localhost:8000/mcp. The same configuration can be passed entirely on the command line:Verify that the server is running:
Example output:
Note: Settings are resolved in the order CLI options, environment variables, config file, defaults. Because environment variables outrank the file, an exported
FEAST_MCP_TRANSPORTwill overrideserver.transportinfeast_mcp.yaml.
4. Call the tools from a client
The mcp_client_demo.py script connects over HTTP, lists the tools that the server mounted, and then calls one tool from each namespace:
Example output:
The
PRESENTstatuses confirm that the materialization step in stage 1 succeeded. If it is skipped, the statuses come back asNOT_FOUNDwith null values, while the registry tools continue to work.If only one namespace appears, the other upstream URL was not configured. Each sub-server is mounted only when its URL is set.
5. Connect an IDE client
For an HTTP transport, point the MCP client at http://localhost:8000/mcp.
For a stdio transport, let the client spawn the process instead. Since feast mcp reads feast_mcp.yaml from the working directory, pass --config with an absolute path:
6. Cleanup
Stop the three servers, then remove the generated feature repository:
Authentication
This example runs with auth.mode: passthrough, the default, which accepts connections without a token. The MCP server does not enforce its own RBAC. A token supplied by the client is forwarded to Feast, which applies its own permission model.
To give IDE clients a browser login flow, switch to OIDC. This is usually configured against the same provider already set as auth.oidc_discovery_url in feature_store.yaml:
Note: Run a single replica with
oidc. The OAuth state store is per-node and on disk, so a callback routed to a replica that did not handle the authorize request will fail.
Kubernetes authentication
This example uses --auth-mode passthrough: the client sends its Service Account or user token as a bearer token, the MCP server forwards it unchanged, and the upstream Feast servers validate it using the TokenReview API. For an in-cluster MCP deployment, --auth-mode kubernetes also validates the token at the MCP server before forwarding it. See the Kubernetes authentication requirements for the required dependencies and Service Account permissions.
The demo client sends whatever is in the MCP_TOKEN environment variable as its bearer token:
This matters when running on a cluster, as described in the next section.
Running on Kubernetes
The kubernetes/featurestore-mcpserver.yaml manifest deploys the same setup with the Feast Operator. Setting spec.services.mcpServer adds a feast mcp container to the FeatureStore deployment, exposed on its own Service on port 8100.
The Feast Operator enables Kubernetes authentication by default, so the online store and registry in this manifest both require a bearer token. Because the MCP server only relays the caller's token and never supplies one of its own, a client that connects without a token will see 401 Unauthorized errors raised from upstream.
Apply the manifest:
Wait for the MCP server to become ready:
Forward the Service port and run the same demo client against it:
Since Kubernetes auth is on, pass a token so that the demo client can reach the upstream servers:
Alternatively, for a development cluster, set
spec.authz.noAuth: trueon the FeatureStore to disable authentication entirely.To remove the deployment:
Two operator-specific behaviors are worth noting:
The operator sets
--hostand--portso that they match the generated Service. Theserver.transportvalue in the ConfigMap is still honored, butserver.hostandserver.portare not.A CEL validation rule enforces that at least one upstream is available: either
onlineStoreis not disabled (omitting it is fine — the operator defaults an online feature server), orregistry.local.server.restAPIistrue.
Last updated
Was this helpful?