Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Integrating AI Agents with Existing Backend Using MCP and Strands Agents SDK

Description and use

Integrating an AI agent into an existing app with MCP and Strands Agents SDK enables direct read access to MongoDB and safe write operations through a controlled API, preserving business logic.

Problem

Traditional web applications lack a standardized way to expose functionality to AI agents, leading to inefficient custom tool creation and potential data integrity risks.

Outcome

The dual‑server MCP strategy enabled the AI agent to perform unlimited analytical queries on inventory data while ensuring all write operations adhered to existing business rules, eliminating the need for custom tool development and maintaining data integrity.

Workflow

  • 1. Expose a JSON‑RPC MCP endpoint at '/mcp' on the SpringBoot backend.
  • 2. Deploy a MongoDB MCP server to provide read‑only tools and resources to the agent.
  • 3. Configure the Strands Agents SDK to add clients for both MCP servers.
  • 4. Use the SDK’s context‑adding methods to restrict the agent’s access to authorized data (e.g., tenant info, user roles).
  • 5. Connect the SDK to Amazon Bedrock (Claude Sonnet) by setting AWS credentials in the environment.
  • 6. Deploy the agent, which now can read inventory data via the Database MCP and write updates via the Application MCP while respecting business logic.

Evidence

The MCP server does not use AI. It is simply a JSON RPC endpoint served at '/mcp' allowing the agent to retrieve the following, Tools, Resources, Prompts.

Source

I highly recommend a dual-server approach.

Source

Connecting to Amazon Bedrock models require almost zero configuration.

Source

  • Record date: 2026-09-11T14:00:39.646Z