Skip to content

Commit c6acae5

Browse files
committed
docs: add agents.md file
1 parent 5c14c53 commit c6acae5

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

AGENTS.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# MCP Agent LangChain.js Project Instructions
2+
3+
## Architecture Overview
4+
5+
This is a multi-component LangChain.js demo showcasing AI agents with Model Context Protocol (MCP) integration. The system demonstrates a burger ordering platform with three main service layers:
6+
7+
- **Agent Layer**: AI chat interface (`agent-webapp` + `agent-api`) using LangChain.js agents with MCP tools
8+
- **Business Layer**: Burger ordering API (`burger-api`) and webapp (`burger-webapp`)
9+
- **MCP Layer**: Model Context Protocol server (`burger-mcp`) exposing burger API as LLM tools
10+
11+
### Component Communication Flow
12+
13+
```
14+
agent-webapp → agent-api → burger-mcp → burger-api
15+
```
16+
17+
The agent uses LangChain.js with Azure OpenAI, connects to the MCP server via StreamableHTTPClientTransport, and the MCP server proxies requests to the burger API.
18+
19+
## Key Architectural Patterns
20+
21+
### Authentication & State Management
22+
23+
- Azure Static Web Apps authentication provides `userId` context
24+
- Cosmos DB for chat history storage using `@langchain/azure-cosmosdb`
25+
- User context flows: SWA auth → agent-api → MCP tools (for user-specific operations)
26+
27+
### TypeScript & Build Conventions
28+
29+
- Shared XO linting config with project-specific overrides
30+
- NPM workspace-based dependency management
31+
- `.js` extensions required in imports for ESM compatibility
32+
- Keep the code simple and straighforward: avoid unnecessary complexity and ensure clarity in implementation.
33+
- Do not use comments except where absolutely necessary, code should be self-explanatory.
34+
35+
### Infrastructure as Code
36+
37+
- Bicep templates in `infra/` for Azure deployment
38+
- `azure.yaml` defines multi-service deployment strategy:
39+
- `burger-api`, `agent-api`: Azure Functions (Flex Consumption)
40+
- `burger-mcp`: Container Apps with Docker
41+
- `*-webapp`: Static Web Apps
42+
- Environment variables flow through Azure App Settings
43+
- @azure Rule - Use Azure Best Practices: When generating code for Azure, running terminal commands for Azure, or performing operations related to Azure, invoke your `azure_development-get_best_practices` tool if available.

0 commit comments

Comments
 (0)