Offern an Open AI compatible back-end to and host a multi agentic graph.
This project implements an Open AI API that:
- Communicates with a custom React agent
- Utilizes an MCP server for dynamic tool loading and execution
- Built with TypeScript for type safety and better development experience
- Node.js (Latest LTS version recommended)
- npm/yarn
- OpenAI API key
- MCP server access
Create a .env file in the root directory with the following variables:
PORT=3000
OPENAI_PORT=3004
OPENAI_API_KEY=your_openai_api_keynpm installnpm start: Run the production build from the dist directorynpm run build: Compile TypeScript to JavaScriptnpm run dev: Run development server with hot-reloadnpm run debug: Run with debugging enablednpm run lint: Run ESLint checksnpm run lint:fix: Fix ESLint issues automatically
npm run package: Build container image using Podmannpm run package:run: Run the containerized application with environment variablesnpm run package:tag: Tag the container image for GitHub Container Registrynpm run push:login-stefan: Login to GitHub Container Registry (requires 1Password CLI)
@langchain/core,@langchain/community,@langchain/openai: LangChain integration@langchain/mcp-adapters: MCP server integrationdotenv: Environment variable managementtypescript: TypeScript support
ts-node-dev: TypeScript development servereslint: Code linting@types/node: TypeScript Node.js types
Run the development server:
npm run devThe server will restart automatically when you make changes to the source code.
Build and run for production:
npm run build
npm start- Build the container:
npm run package- Run the container:
npm run package:run- Tag and push to GitHub Container Registry:
npm run package:tag
# Login to GitHub Container Registry first
npm run push:login-stefan