中
◀ Back to feed
AWS

Serverless MCP server for AI agent data lake access on Amazon ECS Fargate

Published 2026-11-06 Collected 2026-11-07 04:00 AI news #ai#enterprise
Full text

Artificial Intelligence

Serverless MCP server for AI agent data lake access on Amazon ECS Fargate

Organizations building applications powered by artificial intelligence (AI) face a recurring challenge: giving large language model (LLM) agents access to enterprise data lakes without duplicating integration logic across every agent and application. Most teams begin by wiring agents directly to databases and APIs, with no shared gateway such as a Model Context Protocol (MCP) server in between. Each new dataset demands custom code, and each agent reimplements its own access control. As the number of datasets or agents grows, permission enforcement drifts, and onboarding a new data source becomes a multi-day engineering effort.

Our team supports Amazon’s North America Sort Center (NASC) network, where planning teams rely on operational data to manage capacity, labor, and package flow. To give those teams conversational access to that data, we built a serverless Model Context Protocol (MCP) server on Amazon Elastic Container Service (Amazon ECS) with AWS Fargate to address this problem for planning teams in NASC. The server acts as a centralized, agent-agnostic gateway between AI agents and our enterprise data lake. Exposing a new dataset requires only a JSON metadata file that the server discovers automatically on the next pipeline sync.

In this post, we describe the architecture, show how a metadata-driven approach removes the need for per-dataset integration code, and explain how the serverless infrastructure supports multiple agents and applications in a multi-tenant environment.

Problem statement and design goals

Two interrelated challenges shaped how we designed this system: fragmented data access patterns and an unsustainable onboarding model.

Integration challenge at scale

Our data lake contains thousands of datasets spanning operational metrics, business analytics, and domain-specific data. Multiple teams wanted AI assistants that could query this data conversationally, but each built its own integration from scratch. Each agent embedded its own SQL generation logic, schema knowledge, and connection handling, so a schema change meant patching every agent individually. Access control was fragmented, with no single audit point for data access decisions. Onboarding a new dataset required custom tool code, query validation, and redeployment, typically a multi-day effort per table.

Design goals

We established four requirements:

  • Configuration-driven data lake access. Adding a dataset requires only a metadata file, not code.
  • Agent-agnostic tool interfaces. Any MCP-compatible client can invoke the same tools.
  • Centralized permission enforcement. Access control is enforced at the MCP server layer.
  • Elastic infrastructure. The system scales with bursty AI workload patterns.

Solution overview

The architecture separates concerns into four layers (client, MCP server, tools, and knowledge-base refresh), each independently scalable and deployable. A metadata catalog underpins the tools layer, storing schema descriptions, column-level semantics, and table relationships that the AI agent references when generating SQL. Because the agent derives schema knowledge from the catalog at query time, there is no need to hardcode table structures or redeploy when schemas change. The knowledge-base refresh layer keeps that catalog current, indexing new dataset metadata as it arrives. The following sections describe each layer in detail.

Architecture walkthrough

The following diagram shows the request flow from user query to data layer across all four layers. A user submits a query from a client application (web chat, Slack, an IDE plugin, or an external agent). The request resolves through Amazon Route 53 for DNS and reaches an Application Load Balancer in a public subnet, configured with HTTPS and AWS WAF. The load balancer routes to Amazon Cognito, which authenticates the user and enriches the request. Authenticated traffic then enters the private subnet, where the client layer runs on Amazon ECS Fargate. This layer handles session state in Amazon DynamoDB and forwards requests through an internal Application Load Balancer to the MCP server layer, also on Amazon ECS Fargate. In the MCP server layer, an AI agent powered by Amazon Bedrock orchestrates tools built with FastMCP (a Python framework for building MCP servers). Amazon Bedrock Guardrails is applied to every model interaction. On the right, the data layer holds the tool backends. Amazon Athena and Amazon Redshift run SQL queries against the data lake, and Amazon Bedrock Knowledge Bases, the fully managed Retrieval Augmented Generation (RAG) capability, handles semantic search. Data ingestion into Amazon Simple Storage Service (Amazon S3) and the knowledge bases is handled by AWS Lambda. Each layer is described in detail in the sections that follow.

MCP client layer: Authentication and session management

A request flows from the client application through Amazon Route 53 for DNS resolution to an Application Load Balancer configured with HTTPS and AWS WAF. The load balancer forwards traffic to the Amazon ECS Fargate client service, which integrates with Amazon Cognito for JSON Web Token (JWT) authentication and Amazon DynamoDB for session storage.

A context mapping configuration drives this enrichment, scoping each query to only the relevant tables. In our testing, this scoping keeps end-to-end interaction latency in the 15–20 second range. The following example shows a context mapping configuration:

When a context specifies tables, the MCP server narrows its search of the metadata catalog to those tables, reducing noise and improving SQL generation accuracy. Adding a new business domain requires only adding an entry to this mapping.

MCP server layer: Stateless execution with conversation state

The MCP server runs on its own ECS Fargate cluster, isolated from the client layer. Requests reach it through Amazon Route 53 and an internal Application Load Balancer in a private subnet. The server handles full orchestration including query analysis, tool selection, execution, and response generation. Through the MCP protocol endpoint (/mcp), a FastMCP-powered JSON-RPC interface, external MCP-compatible clients such as Amazon Q Developer or IDE extensions can discover and invoke tools directly.

Fargate tasks are stateless with conversation state persisted in DynamoDB, so tasks can be replaced or scaled without data loss. When a request arrives, the agent retrieves session history, analyzes user intent using Amazon Bedrock, discovers and invokes appropriate tools, and streams results back to the user.

Tools layer and metadata-driven data lake access

Each tool is registered with FastMCP and discoverable at runtime:

| Sr.no | Tool | Backend | Purpose | | 1 | SQL query tools | Amazon Athena Amazon Redshift | SQL queries against any configured dataset in the data lake and Redshift | | 2 | Document and metadata search | Amazon Bedrock Knowledge Bases | Semantic search over internal documentation, table metadata and team wikis | | 3 | Policy search | Amazon Bedrock Knowledge Bases | Search operational policies and standard procedures |

The Athena query tools are the primary interface to the data lake. The agent first queries the metadata catalog to understand available schemas, generates an optimized SQL query through Amazon Bedrock, validates and auto-corrects the SQL for Athena compatibility, then executes it. Results flow back to the orchestrating agent for natural language synthesis.

Responsible AI controls

Amazon Bedrock Guardrails is applied to all LLM interactions and is designed to filter harmful content, enforce grounding checks, and help block prompt injection attempts. These guardrails operate as production controls at the MCP server layer, so every connected agent benefits from the same content safety policies regardless of how it connects. The Athena query tools enforce SELECT-only queries, rejecting write operations at the tool level before they reach the data lake.

Knowledge base refresh layer: Dataset onboarding with a single JSON file

The entire system is built around configuration-driven extensibility. Adding a new dataset requires a metadata JSON file describing the table and an optional context mapping entry. The file captures the table’s schema, business context, and column-level semantics. It serves as the single source of truth that the AI agent uses to understand and query the dataset:

The business_description_for_the_table field carries engine-specific query hints, such as “always use date() to wrap string literals,” that reduce SQL validation failures. The column_details field pairs each column_name [type] with a natural language description and sample values, giving the agent both schema awareness and business semantics. The sample_values field matters for accurate WHERE clause generation because the agent learns real data patterns, for instance that warehouse_id holds codes like FC-EAST-07 rather than spelled-out names like “East region facility.”

The pipeline picks up metadata files, generates vector embeddings with Amazon Titan Text Embeddings, and indexes them into Amazon Bedrock Knowledge Bases. Once indexed, the table is discoverable by all connected agents without manual re-indexing or server restarts.

To improve accuracy for specific applications, an engineer can optionally associate the dataset with a business context. This narrows the search scope, so the agent prioritizes the right tables. The following example shows a context mapping entry:

If no context is specified, the agent searches across all indexed tables. The context mapping reduces latency and improves SQL accuracy by limiting the search space. This scoping is optional and can be added at any time without modifying the metadata files themselves.

Putting it together: A query in action

When a user asks, “What were our top 10 highest-value orders last month?”, the client enriches the request with business context to narrow scope. The agent converts the question into a vector embedding, searches the metadata catalog for matching schemas, and selects the most relevant table via a lightweight LLM call.

Using the selected schema, column descriptions, and engine-specific query hints, the agent generates a SQL statement such as:

The SQL is validated and auto-corrected for engine compatibility, then executed against Amazon Athena. The agent formats the results into a natural language response and streams it back to the user. In our testing, this end-to-end flow completes within 15–20 seconds.

The same orchestration extends beyond pure SQL. Because document search is registered as another tool on the same server, the agent can answer questions that span structured and unstructured sources in a single turn, such as “What was our return rate for Q4, and what does the product team’s analysis say about the root causes?” For that request, the agent runs an Athena query for the return-rate figure and a Knowledge Bases document search for the analysis, then combines both into one response.

Security and multi-tenant access

That single-turn orchestration works only because every tool call passes through the same controlled gateway. The architecture uses layered security rather than a single enforcement point. The MCP server runs in private subnets behind an internal Application Load Balancer and is not reachable from the internet. Only the client layer, which sits behind a public-facing Application Load Balancer with AWS WAF, can route requests to it. Amazon Cognito validates user identity at the client layer, and only authenticated, token-bearing requests are forwarded downstream. At the tool level, the Athena query tools enforce SELECT-only queries, rejecting write operations before they reach the data lake. All tool invocations are logged to Amazon CloudWatch with structured JSON, which gives security teams a single audit point for data access across every agent and application. This architecture is available in the AWS Regions where Amazon Bedrock and Amazon Bedrock Knowledge Bases are available.

This centralized design is also what makes the server multi-tenant. Because the standardized /mcp endpoint accepts any MCP-compatible client regardless of which LLM or orchestration framework it uses, multiple agents share the same tools and the same access controls. Adding a new agent requires only pointing it at the server endpoint, so onboarding another team extends the system without weakening or duplicating the security model.

Serverless infrastructure and scaling

Each layer scales through a mechanism suited to its workload pattern:

| Layer | Scaling mechanism | Trigger | | Client (ECS Fargate) | ECS Service Auto Scaling | CPU utilization (50% threshold) | | MCP Server (ECS Fargate) | ECS Service Auto Scaling | CPU/Memory utilization | | Athena | Serverless (automatic) | Query concurrency | | Amazon Bedrock | Managed service scaling | Inference requests |

Amazon ECS Fargate provides serverless compute with no EC2 instances to manage. Downstream services (Athena, Bedrock) scale automatically, so the system handles a single query or hundreds of concurrent queries without configuration changes.

Use cases and extensions

This architecture supports several patterns beyond basic question-answering. Enterprise knowledge assistants can combine data lake queries with document search to answer complex questions spanning both structured data and unstructured knowledge, such as “What’s our return rate for Q4, and what does the product team’s analysis say about the root causes?” Internal analytics copilots let business users query the data lake conversationally without writing SQL, relying on the metadata descriptions and query hints to guide the agent toward accurate, performant query patterns.

The standardized /mcp endpoint also supports multi-agent workflows. Multiple specialized agents for data analysis, document retrieval, and operational alerting can share the same MCP server, each accessing the full tool suite through a common protocol. Onboarding a new team’s data follows the same configuration-driven pattern. They add a metadata JSON file, and within one pipeline sync cycle their dataset is discoverable by every connected agent and application.

Conclusion

A centralized MCP server on Amazon ECS Fargate provides a scalable, secure gateway between AI agents and enterprise data lakes. The metadata-driven approach removes the need for per-dataset integration code, and the Model Context Protocol standard means any MCP-compatible client can connect without custom adapters.

The key architectural decision is separating the tool layer from the agent layer. Agents evolve rapidly, but data access patterns should outlive any single agent implementation. Treating extensibility as a configuration problem rather than a code problem accelerates onboarding.

To learn more, see Amazon ECS on AWS Fargate, Amazon Bedrock, the Amazon Bedrock Knowledge Bases user guide, Amazon Athena, and the Model Context Protocol specification.

Next steps

We are extending this architecture in two directions. First, finer-grained access control where table owners can mark sensitive columns as restricted per permission group, and the agent automatically excludes those columns from generated SQL without prompt-level changes.

Second, closing the feedback loop so that when queries fail or produce low-confidence results, the system captures the failure pattern and surfaces targeted suggestions for improving column descriptions, adding query hints.

Source
Title
Serverless MCP server for AI agent data lake access on Amazon ECS Fargate
Author
Aishwarya Pawar et al.
Site
AWS
Published
2026-11-06
Collected
2026-11-07 04:00 · 2026-11-07-04-ai.json
Link
https://aws.amazon.com/blogs/machine-learning/serverless-mcp-server-for-ai-agent-data-lake-access-on-amazon-ecs-fargate/
Open original ↗

Reposted. Will be removed on request. All rights belong to the original author.

More from this batch

04:00batch · 2026-11-0712 items
>

Meta introduces Spaces, a new way to collaborate with your Muse agent

Meta adds Spaces so Muse can spin up topic-specific trackers and planners that stay synced with connected apps, after Muse Voice and a claim…

TechCrunch
>

Hundreds of Artex AI hacking tools found publicly exposed to the web

Censys found 800+ passwordless Artex AI penetration-testing deployments on the open web, some tied to prior attacks; Artex is moving closed-…

TechCrunch
>

Meta 撤回「可疑」商业条款更新:不再强迫 Facebook 主页主人允许 AI 训练外链内容

Ars 标题直译社区吐槽「Meta 以为我们不会读吗」——公司放弃一版被指含糊、可能扩大对关联内容 AI 训练授权的商业条款改动。对品牌与企业主页运营方,是数据授权边界被公开压力扳回的信号;具体条款以 Meta 最新文本为准。

Ars Technica
>

中期选举「蓝潮」之后:AI 产业会不会迎来艰难两年?播客梳理监管与数据中心政治风险

Equity 播客讨论民主党大胜后,公众对数据中心与 AI 的反感如何转化为立法与地方审批压力,以及大厂资本开支叙事可能被改写。偏宏观产业分析,可与本周纳指抛售、数据中心公投新闻交叉阅读;非单一公司公告。

TechCrunch / Equity
>

大学图书馆被 AI 爬虫「淹没」:公共访问承压,机构开始限流与封禁

CBC 报道多所大学图书馆系统遭大规模 AI 数据抓取机器人冲击,影响正常读者访问。Hacker News 热议(约 113 分)。对企业与高校:开放知识库、文档站、API 网关都要按「Agent 流量」重新设限流、鉴权与缓存策略,而不只是防传统爬虫。

CBC / HN
>

Teaching AI to build scientific models

Anthropic Science guests argue AI should return distributions of plausible scientific models—and which alternatives failed—not a single best…

Anthropic
>

Anthropic IPO 买方估值预期压到约 1.1 万亿美元一带(HN 转 Bloomberg)

Hacker News 热帖摘要 Bloomberg:部分潜在买家把估值预期压到约 1.1 万亿美元量级,低于此前约 1.5 万亿叙事。与本周科技股抛售、缺 10 月收入数字等压力同向。细节以彭博原文付费墙为准;作「市场出价下修」信号记录。

Bloomberg / HN
>

SageMaker Inference 支持 MIG:一张 GPU 切成多实例,提高端点利用率

正式支持 NVIDIA Multi-Instance GPU,把单卡划成隔离实例给多模型/多租户端点。偏推理成本与密度优化;托管在 SageMaker(非自托管)。对要把多个中小模型挤进同一硬件池的企业推理平台有直接价值。

AWS
>

Bedrock AgentCore + Okta Cross App Access(其二):把「一个受管 Agent」扩成企业网关模式

接上篇:用 AgentCore Gateway 做企业级扩容,统一治理多应用访问。偏 IAM/身份与 Agent 工具权限;需 AWS + Okta 栈。成熟度:官方教程级,适合已试点 AgentCore、要上生产权限模型的安全/平台组。

AWS
>

Greenlight Financial:在 Bedrock AgentCore 上建自治 SOC,月最高约 4000 单里 90%+ 无需人工

儿童金融科技公司案例:安全与风险工单由 Agent 自动处理,宣称超九成可无人值守闭环。展示 AgentCore 在安全运营场景的成熟度信号;闭源产品集成,非可自托管开源 SOC。对金融合规团队可作对标,需自行核实指标口径。

AWS
>

Taxbit Assist:带引用、按角色权限的企业税务 Agent,嵌在仪表盘里跑在 AgentCore 上

税务合规 SaaS 把助手嵌进控制台:回答带出处、按角色可见数据。强调 grounded + permission-aware,而非裸聊天。商业 SaaS 功能,非开源;对企业「受控 RAG Agent」落地形态是清晰样板。

AWS
>

把 Claude Code 接到 Bedrock AgentCore 远程会话:隔离沙箱 + 安全控件

每项编码任务在客户账户隔离会话中跑,延长 Claude Code 到远程 Agent。适合已用 Claude Code、又要企业网络隔离与审计的团队;依赖 Bedrock/AgentCore,非本地私有化。集成有一定门槛(会话、权限、网络策略)。

AWS