AI agent that integrates with Visa Intelligent Commerce (VIC) to demonstrate agentic commerce capabilities. Supports both MCP server integration and direct VDP API calls.
- LangGraphJS - Agent orchestration
- Next.js - Web UI
- TypeScript
- Anthropic Claude / OpenAI GPT - LLM providers
This demo supports two VIC integration approaches, controlled by the USE_DIRECT_API environment variable:
| Mode | USE_DIRECT_API |
Description |
|---|---|---|
| MCP Server | false (default) |
Routes API calls through VIC MCP server using @visa/mcp-client |
| Direct VDP API | true |
Calls VDP APIs directly using @visa/api-client with X-Pay authentication |
Both modes provide the same functionality. See the main README for more details on each approach.
- Node.js (v18+)
- Visa credentials (see
.env.example) - LLM API keys (Anthropic/OpenAI)
-
Navigate to agent directory:
cd vic-agent -
Install dependencies:
npm install
-
Build shared packages:
npm run build:packages --prefix ..
Required on first setup to compile shared packages (
@visa/mcp-client,@visa/api-client,@visa/token-manager). -
Configure environment:
cp .env.example .env cp apps/web/.env.example apps/web/.env.local
Edit both
.envfiles with your credentials. SetUSE_DIRECT_API=truefor direct VDP calls orfalsefor MCP server mode. -
Run the application:
npm run dev
- Agent backend: http://localhost:2024
- Web UI: http://localhost:3000
For VTS authentication and Passkey support, the application must run at https://localsongbird.com:8188/.
-
Add hosts entry:
# Add to /etc/hosts (macOS/Linux) or C:\Windows\System32\drivers\etc\hosts (Windows) 127.0.0.1 localsongbird.com -
Generate SSL certificate:
cd apps/web mkdir -p .certs openssl req -x509 -newkey rsa:4096 -keyout .certs/key.pem -out .certs/cert.pem -days 365 -nodes \ -subj "/C=US/ST=State/L=City/O=Organization/CN=localsongbird.com" \ -addext "subjectAltName=DNS:localsongbird.com,DNS:*.localsongbird.com"
-
Trust the certificate:
- macOS:
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain apps/web/.certs/cert.pem - Linux:
sudo cp apps/web/.certs/cert.pem /usr/local/share/ca-certificates/localsongbird.crt && sudo update-ca-certificates - Windows: Double-click
cert.pem, install to "Trusted Root Certification Authorities" - Browser: Import certificate in browser settings if needed
- macOS:
-
Start the application:
# From the root agent folder npm run dev -
Access:
https://localsongbird.com:8188/
vic-agent/
└── apps/
├── agent/ # LangGraph agent implementation
└── web/ # Next.js web interface
- Visa MCP Hub
- Main Project README - Integration approaches and package documentation
- @visa/mcp-client - MCP client package
- @visa/api-client - Direct API client package
- LangGraphJS Documentation
- Agent Chat UI