{"ref":"artifact:lemaiwo-btp-agent","page":"/artifacts/lemaiwo-btp-agent","json":"/artifacts/lemaiwo-btp-agent.json","generated":"2026-10-26","drafted_with_ai":true,"entity":{"id":"lemaiwo-btp-agent","name":"btp-agent","artifact_type":"sample","ecosystem":"cap","serves_ecosystems":["btp","ui5"],"flavors":[{"key":"freestyle","source":{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Vision","checked":"2026-10-24","quote":"A CAP TypeScript monorepo hosting an AI agent connected to SAP BTP AI Core, with a UI5 freestyle chat interface, and multiple MCP server modules that give the agent access to BTP APIs."}}],"domain":"ai-and-agents","secondary_domains":["operations-and-runtime"],"origin_ring":"independent","use_as":"starting-point","description":{"one_line":"One [LangGraph](external:langgraph) agent in a CAP service, with a UI5 chat screen in front of it and four [odata-mcp-proxy](artifact:lemaiwo-odata-mcp-proxy) MCP server modules behind it, deployed to Cloud Foundry as a single MTA.","short":"LangGraph agent and UI5 chat screen over four BTP MCP servers","what_it_solves":"A CAP service holds the agent, a freestyle UI5 app holds the chat screen, and four modules under `packages/` hold one JSON config file each, run by [odata-mcp-proxy](artifact:lemaiwo-odata-mcp-proxy): Cloud Foundry V3, BTP core services, Audit Log and AI Core. `srv/agent.ts` assembles a [LangGraph](external:langgraph) `StateGraph` with an `agent` node for the model call, a `tools` node and an `askHuman` interrupt, and the tools are not hand-coded: `MultiServerMCPClient` from `@langchain/mcp-adapters` spawns the MCP servers and hands their tools to the graph. The model is `AzureOpenAiChatClient` from `@sap-ai-sdk/langchain` against [SAP AI Core](artifact:btp-ai-core)'s Generative AI Hub on the binding the CAP application already owns, and in production the chat service injects the caller's JWT as a bearer token so each downstream server authorises the person who asked, which the post ties to the agent, the MCP servers and the target APIs sharing one XSUAA tenant. One `mta.yaml` deploys nine modules together: the [approuter](artifact:sap-approuter), the CAP service, the UI5 chat app, a HANA deployer and the four MCP apps. The post behind it counts the agent's tools as the union of five MCP servers, of which this repository ships four.","to_build_on_it":"The limits the author hit are where the work starts: the full tool list goes to the model on every turn, five MCP servers together push well past a hundred tools, and one agent prompt decides whether a question is about integration flows, AI deployments or CF apps, which he names as no separation of concerns. His own next step is the split, one agent per MCP server with an orchestrator on top, which the following post works through with Pydantic AI. Inside this repository the places to change are `srv/agent.ts` for the graph, `srv/mcp/` for the `MultiServerMCPClient` configuration, and a JSON config under `packages/` for another API surface."},"links":{"repo":"https://github.com/lemaiwo/btp-agent","docs":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025"},"maintainers":["actor:lemaiwo"],"compat":{"runtimes":["node"],"deployment":["cf","local"]},"requires":[{"ref":"artifact:sap-cds","for":"the CAP runtime the agent, the chat service and the CDS data model run in","requirement":"required","basis":"binding","role":"framework","sources":[{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Key Dependencies","checked":"2026-10-24","quote":"`@sap/cds` + `@sap/cds-dk` — CAP runtime + dev kit"}]},{"ref":"artifact:sap-cds-dk","for":"the dev kit behind `cds watch` for a local run and `cds build --production` in the MTA build","requirement":"required","basis":"binding","sources":[{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Key Dependencies","checked":"2026-10-24","quote":"`@sap/cds` + `@sap/cds-dk` — CAP runtime + dev kit"},{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, local development","checked":"2026-10-24","quote":"git clone https://github.com/lemaiwo/btp-agent.git cd btp-agent npm install cds watch # serves the CAP app + chat UI on http://localhost:4004"}]},{"ref":"artifact:lemaiwo-odata-mcp-proxy","for":"the runtime of all four MCP server modules, each of which is a config file and nothing else","requirement":"required","basis":"binding","sources":[{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Key Design Decisions","checked":"2026-10-24","quote":"Each is a zero-code module using `odata-mcp-proxy` (npm package) with only a JSON config file"},{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Key Dependencies","checked":"2026-10-24","quote":"`odata-mcp-proxy` — config-driven MCP server for OData/REST APIs (used by all MCP modules)"}]},{"ref":"external:langgraph","for":"the graph the agent loop is built as: a `StateGraph` with an `agent` node, a `tools` node and an `askHuman` interrupt","requirement":"required","basis":"binding","role":"agent framework","sources":[{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Key Dependencies","checked":"2026-10-24","quote":"`@langchain/langgraph` — agent framework (StateGraph, MemorySaver, ToolNode)"},{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Agent Pattern","checked":"2026-10-24","quote":"`StateGraph` with nodes: `agent` (LLM call), `tools` (execute tool calls), `askHuman` (interrupt for input)"}]},{"ref":"external:langchain-mcp-adapters","for":"the client that spawns each MCP server module and hands the tools it finds to the graph","requirement":"required","basis":"binding","sources":[{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Key Design Decisions","checked":"2026-10-24","quote":"`@langchain/mcp-adapters` `MultiServerMCPClient` spawns each MCP server and exposes tools to the LangGraph agent"},{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Key Dependencies","checked":"2026-10-24","quote":"`@langchain/mcp-adapters` — MCP tool integration (MultiServerMCPClient)"}]},{"ref":"artifact:btp-ai-core","for":"the Generative AI Hub the chat model is called against, bound as the `aicore` resource on the extended plan","requirement":"required","basis":"binding","sources":[{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, How","checked":"2026-10-24","quote":"The LLM itself is AzureOpenAiChatClient from @sap-ai-sdk/langchain, which targets AI Core’s Generative AI Hub through the service binding the CAP app already owns."},{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, build and deploy","checked":"2026-10-24","quote":"The MTA ships nine modules (approuter, CAP srv, UI5 chat, HANA deployer, and four MCP-server apps) and binds xsuaa, HANA HDI, destination, connectivity, html5-repo (host+runtime) and AI Core (extended plan)."}]},{"ref":"artifact:btp-authorization-and-trust-management","for":"the one XSUAA instance the agent and all four MCP modules share, carrying the MCPViewer, MCPEditor and MCPAdmin role templates and the token that is forwarded downstream","requirement":"required","basis":"binding","sources":[{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, the shell","checked":"2026-10-24","quote":"xs-security.json defines three role templates (MCPViewer, MCPEditor and MCPAdmin)"},{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, Why","checked":"2026-10-24","quote":"When the agent, the MCP servers and the target APIs share the same XSUAA tenant, propagating the token is straightforward and each downstream service naturally enforces the caller’s authorizations."}]},{"ref":"artifact:btp-destination","for":"the deployed MCP server URLs the agent's client is pointed at in production, created as instance destinations by the MTA","requirement":"required","basis":"binding","sources":[{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, the client side","checked":"2026-10-24","quote":"In production the same configuration flips to destinations with the deployed URLs, and the chat service injects the caller’s JWT as a bearer token so the downstream MCP server authorises the user that actually asked the question."},{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, build and deploy","checked":"2026-10-24","quote":"The MTA ships nine modules (approuter, CAP srv, UI5 chat, HANA deployer, and four MCP-server apps) and binds xsuaa, HANA HDI, destination, connectivity, html5-repo (host+runtime) and AI Core (extended plan)."}]},{"ref":"artifact:btp-connectivity","for":"one of the three BTP services the MCP modules are configured for, bound to the CAP service, the approuter and every MCP module in the MTA","requirement":"required","basis":"binding","sources":[{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, MCP Server Config Pattern","checked":"2026-10-24","quote":"BTP services: destination-lite, connectivity-lite, xsuaa-application"},{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, build and deploy","checked":"2026-10-24","quote":"The MTA ships nine modules (approuter, CAP srv, UI5 chat, HANA deployer, and four MCP-server apps) and binds xsuaa, HANA HDI, destination, connectivity, html5-repo (host+runtime) and AI Core (extended plan)."}]},{"ref":"artifact:btp-hana-service","for":"the HDI container the chat sessions and messages are stored in when the application is deployed; a local run uses SQLite instead","requirement":"conditional","condition":"the application is deployed, where the CDS data model runs on HANA rather than the local SQLite database","basis":"binding","sources":[{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Key Design Decisions","checked":"2026-10-24","quote":"CDS entities for chat sessions/messages, backed by SQLite (dev) / HANA (prod)"},{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, build and deploy","checked":"2026-10-24","quote":"The MTA ships nine modules (approuter, CAP srv, UI5 chat, HANA deployer, and four MCP-server apps) and binds xsuaa, HANA HDI, destination, connectivity, html5-repo (host+runtime) and AI Core (extended plan)."}]},{"ref":"artifact:btp-html5-application-repository","for":"where the built chat app is deployed and served from, on the app-host and app-runtime plans","requirement":"conditional","condition":"the application is deployed; the chat app is served from the CDS server at dev time","basis":"binding","sources":[{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, build and deploy","checked":"2026-10-24","quote":"The MTA ships nine modules (approuter, CAP srv, UI5 chat, HANA deployer, and four MCP-server apps) and binds xsuaa, HANA HDI, destination, connectivity, html5-repo (host+runtime) and AI Core (extended plan)."}]},{"ref":"artifact:sap-approuter","for":"the entry point in front of the chat app and the CAP service, one of the nine MTA modules and also usable locally","requirement":"required","basis":"binding","sources":[{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, build and deploy","checked":"2026-10-24","quote":"The MTA ships nine modules (approuter, CAP srv, UI5 chat, HANA deployer, and four MCP-server apps) and binds xsuaa, HANA HDI, destination, connectivity, html5-repo (host+runtime) and AI Core (extended plan)."},{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, the client side","checked":"2026-10-24","quote":"Locally, it can run with an approuter and the mcp proxy server packages so I can develop without deploying anything."}]},{"ref":"artifact:ui5-community-cds-plugin-ui5","for":"serving the chat app from the CDS server at dev time, so one `cds watch` starts the service and the screen together","requirement":"conditional","condition":"running locally; the deployed chat app is built as its own MTA module","basis":"binding","sources":[{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Key Design Decisions","checked":"2026-10-24","quote":"Freestyle UI5 TypeScript app in `app/chat/`, integrated via `cds-plugin-ui5` for dev-time"},{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Key Dependencies","checked":"2026-10-24","quote":"`cds-plugin-ui5` — dev-time UI5 integration with CAP"}]},{"ref":"artifact:btp-cloud-foundry-runtime","for":"the runtime the nine MTA modules are deployed to with `cf deploy`","requirement":"required","basis":"binding","sources":[{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, build and deploy","checked":"2026-10-24","quote":"npm run build # tsc && cds build npm run build:btp # mbt build -> mta_archives/btp-agent_1.0.0.mtar cf login -a <api-endpoint> -o <org> -s <space> npm run deploy:btp # cf deploy mta_archives/btp-agent_1.0.0.mtar"},{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, prerequisites","checked":"2026-10-24","quote":"Prerequisites: Node.js 20+, the Cloud MTA Build Tool (mbt), and the Cloud Foundry CLI with the MultiApps plugin."}]}],"connects":[{"ref":"artifact:btp-ai-core","kind":"data","direction":"outbound","for":"The message history and bound tools the model node sends on every turn, and the answer it streams back, called through the service binding the CAP application already owns.","sources":[{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, How","checked":"2026-10-24","quote":"The LLM itself is AzureOpenAiChatClient from @sap-ai-sdk/langchain, which targets AI Core’s Generative AI Hub through the service binding the CAP app already owns."},{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, the graph","checked":"2026-10-24","quote":"The model node calls the chat model with the current message history and the bound tools; the tool node executes any tool calls and appends their results to the state; an edge sends control back to the model until it returns a plain message."}]},{"ref":"artifact:lemaiwo-odata-mcp-proxy","kind":"data","direction":"outbound","protocols":["mcp","http"],"via":"artifact:btp-destination","for":"Collecting the tools of the four deployed MCP server modules and running each tool call against them, over streamable HTTP in production with the caller's JWT as a bearer token, and over stdio in a local run.","sources":[{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, How","checked":"2026-10-24","quote":"Tools are not hand‑coded: they come in through @langchain/mcp-adapters MultiServerMCPClient, which spawns MCP servers over streamable HTTP connections to the deployed MCP servers in production."},{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, the client side","checked":"2026-10-24","quote":"In production the same configuration flips to destinations with the deployed URLs, and the chat service injects the caller’s JWT as a bearer token so the downstream MCP server authorises the user that actually asked the question."},{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Key Design Decisions","checked":"2026-10-24","quote":"stdio for local dev, http for production"}]}],"interfaces":[{"key":"chat-ui","kind":"ui","direction":"in","for":"The freestyle UI5 chat screen a user opens to ask the agent about their BTP landscape.","sources":[{"url":"https://raw.githubusercontent.com/lemaiwo/btp-agent/main/CLAUDE.md","title":"lemaiwo/btp-agent — CLAUDE.md, Vision","checked":"2026-10-24","quote":"A CAP TypeScript monorepo hosting an AI agent connected to SAP BTP AI Core, with a UI5 freestyle chat interface, and multiple MCP server modules that give the agent access to BTP APIs."}]},{"key":"chat-action","kind":"api","direction":"in","for":"The CDS action the agent is reached through, with the answer's tokens coming back over a WebSocket.","sources":[{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/agentic-ai-on-btp-a-single-agent-with-langgraph/ba-p/14388025","title":"Agentic AI on BTP: a Single Agent with LangGraph — SAP Community, the shell","checked":"2026-10-24","quote":"A CAP service wraps the agent behind a CDS action and streams tokens over WebSocket, so the UI feels responsive."}]}],"provenance":{"discovered_via":[{"source":"source:github"}],"first_seen":"2026-10-24"},"drafted_with_ai":true,"contributors":["actor:lemaiwo"]},"effective_normative_relations":[],"readings":{"liveness":[{"label":"Maintenance","tier":"unknown","evidence":"no release data"},{"label":"Continuity","tier":"fair","evidence":"one contributor, personally owned"},{"label":"Repository","tier":"fair","evidence":"pushed 2026-03, not archived"}],"compatibility":[{"label":"Declared for","tier":"fair","evidence":"nothing declared"},{"label":"Survived majors","tier":"unknown","evidence":"no release dates"},{"label":"Maintainer's CI","tier":"fair","evidence":"no CI configured"}],"practice":[{"label":"Tests","tier":"good","evidence":"1 test file"},{"label":"Docs","tier":"good","evidence":"docs site, README 1 KB"},{"label":"Changelog","tier":"fair","evidence":"none in the repo"}],"reach":[{"value":null,"unit":"installs/week"},{"value":5,"unit":"watching"}]},"signals":{"crawled_at":"2026-10-24","npm":"not published under this name","stars":5,"forks":1,"open_issues":0,"archived":false,"pushed_at":"2026-03-28","license_spdx":null,"org_owned":false,"default_branch":"main","created_at":"2026-03-28T10:22:21Z","open_prs":0,"tree_truncated":false,"test_files":1,"workflows":0,"other_ci":false,"readme_bytes":674,"docs_files":0,"changelog":false,"license_file":false,"dts_files":0,"first_commit":"2026-03-28","last_commit":"2026-03-28","commits":1,"contributors":1,"readme_path":"README.md","readme_sha":"dbac29eb1594d1dd9e9cd90a11879f1495caa4b6","repo_read":"2026-10-24"},"edges":{"maintainers":[{"ref":"actor:lemaiwo","name":"Wouter Lemaire","json":"/actors/lemaiwo.json"}],"contributors":[{"ref":"actor:lemaiwo","name":"Wouter Lemaire","json":"/actors/lemaiwo.json"}],"explained_by":[],"alternative_to_this":[],"needed_by":[],"available_via":[],"parts":[],"add_on_to":{"ref":"artifact:sap-cds","name":"@sap/cds","json":"/artifacts/sap-cds.json"},"add_ons":[],"answered_through_parts":[]}}