Title: feat: Add structured audit logging for MCP feature server · Issue #6452 · feast-dev/feast · GitHub
Open Graph Title: feat: Add structured audit logging for MCP feature server · Issue #6452 · feast-dev/feast
X Title: feat: Add structured audit logging for MCP feature server · Issue #6452 · feast-dev/feast
Description: Is your feature request related to a problem? Please describe. Feast can expose the Python feature server as an MCP server (feature_server.type: mcp, mcp_enabled: true, endpoint /mcp) via fastapi_mcp. Operators and platform teams need a ...
Open Graph Description: Is your feature request related to a problem? Please describe. Feast can expose the Python feature server as an MCP server (feature_server.type: mcp, mcp_enabled: true, endpoint /mcp) via fastapi_m...
X Description: Is your feature request related to a problem? Please describe. Feast can expose the Python feature server as an MCP server (feature_server.type: mcp, mcp_enabled: true, endpoint /mcp) via fastapi_m...
Opengraph URL: https://github.com/feast-dev/feast/issues/6452
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: Add structured audit logging for MCP feature server","articleBody":"### Is your feature request related to a problem? Please describe.\n\nFeast can expose the Python feature server as an MCP server (`feature_server.type: mcp`, `mcp_enabled: true`, endpoint `/mcp`) via `fastapi_mcp`. Operators and platform teams need a clear **audit trail** for agent/MCP access: who invoked which tool, what resource was accessed, whether authentication and authorization succeeded or failed, and a correlation ID that links MCP calls to internal REST requests.\n\nToday, MCP integration only logs startup/errors (`sdk/python/feast/infra/mcp_servers/mcp_server.py`). That is not enough for security and operations use cases:\n\n| Mechanism | What it does | Gap for MCP audit |\n|-----------|--------------|-------------------|\n| `feature_logging` | Logs **served feature values** to the offline store | Not a security audit log; not wired on the Python FastAPI MCP server |\n| Uvicorn access logs | HTTP path/status (off by default) | No principal, no MCP tool name |\n| RBAC logs | Unstructured permission messages in app logs | No MCP correlation; often DEBUG-only for allows |\n\n**With `auth.type: no_auth`:** MCP tool calls are effectively anonymous — no principal in logs.\n\n**With `auth.type: oidc` / `kubernetes`:** RBAC applies on secured REST routes when the MCP client forwards `Authorization` (default in `fastapi_mcp`), but there is still no structured audit stream for MCP `tools/call`, successful reads, or request correlation. The `/mcp` transport itself is not audited.\n\nRegistry MCP (`registry.mcp.enabled: true`) has the same gap.\n\n### Describe the solution you'd like\n\nAdd **structured audit logging** (JSONL) for the Python MCP feature server, separate from `feature_logging`:\n\n1. **Config** under `feature_server` (e.g. `audit_logging.enabled`, `sink`, `file_path`, `require_auth_for_mcp`, `log_successful_reads`).\n2. **Audit events** with stable schema: `event_type`, UTC `timestamp`, `request_id`, **`principal`**, `source` (IP, transport), `action` (MCP tool / HTTP path), `resource`, `outcome`, `duration_ms`.\n3. **Two emission layers:**\n - MCP middleware on `/mcp` (`mcp.tools.call`, session events).\n - REST + RBAC hooks (`authn.*`, `authz.decision`, `http.request`) on secured endpoints.\n4. **Header propagation** via `FastApiMCP(headers=[...])` so MCP and REST events share `request_id` (and optionally tool name).\n5. **No sensitive payloads** in audit logs (no tokens, entity rows, or feature values).\n\nOptional follow-ups: registry MCP parity, OTEL sink, operator CRD fields.\n\nExample config:\n\n```yaml\nfeature_server:\n type: mcp\n mcp_enabled: true\n audit_logging:\n enabled: true\n sink: stdout\n```\n\nExample event (JSONL):\n\n```json\n{\n \"event_type\": \"mcp.tools.call\",\n \"timestamp\": \"2026-05-28T12:00:00.000Z\",\n \"request_id\": \"…\",\n \"principal\": {\n \"username\": \"jane.doe@company.com\",\n \"roles\": [\"feast-reader\", \"ml-engineer\"],\n \"auth_type\": \"oidc\"\n },\n \"source\": { \"ip\": \"10.0.0.1\", \"transport\": \"mcp-http\" },\n \"action\": { \"mcp_tool\": \"get_online_features\", \"path\": \"/get-online-features\" },\n \"resource\": { \"type\": \"feature_service\", \"name\": \"driver_activity_v1\", \"actions\": [\"READ_ONLINE\"] },\n \"outcome\": \"success\",\n \"duration_ms\": 42\n}\n```","author":{"url":"https://github.com/patelchaitany","@type":"Person","name":"patelchaitany"},"datePublished":"2026-05-29T07:01:56Z","url":"https://github.com/feast-dev/feast/issues/6452"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:23a95068-74cf-db49-dffa-cc9a759d649e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DAA:6B7A6:EFE0EC:13BE345:6AFE981C |
| html-safe-nonce | 6d70947f84f9500f9272219717d7f322b466ac36396e40661221f84fc24b8a39 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REFBOjZCN0E2OkVGRTBFQzoxM0JFMzQ1OjZBRkU5ODFDIiwidmlzaXRvcl9pZCI6IjczMjcwNDY4ODI3NTg0NTQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7c5679d3bdbfc2056015e44f153f67c6c31be162bd9ee0b763a8322e8433acba |
| hovercard-subject-tag | issue:4546411914 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/6452/issue_layout |
| twitter:image | https://opengraph.githubassets.com/282edcc8e523c28b8a9622cd6607ccf6f2e0d38f10ba75c238fe357d1d67b83f/feast-dev/feast/issues/6452 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/282edcc8e523c28b8a9622cd6607ccf6f2e0d38f10ba75c238fe357d1d67b83f/feast-dev/feast/issues/6452 |
| og:image:alt | Is your feature request related to a problem? Please describe. Feast can expose the Python feature server as an MCP server (feature_server.type: mcp, mcp_enabled: true, endpoint /mcp) via fastapi_m... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | patelchaitany |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width