Thanks for taking the time to contribute. This document covers everything you need to get started.
- Getting the code running
- Project structure
- How to contribute
- Types of contributions
- Code style
- Submitting a pull request
- Reporting bugs
# Fork the repo on GitHub, then:
git clone https://github.com/<your-username>/AgentM.git
cd AgentMcp .env.example .envOpen .env and add at least one AI API key:
OPENAI_API_KEY=your_openai_key_here
# or
GEMINI_API_KEY=your_gemini_key_herenpm installThis installs everything for both the app and backend workspaces in one step.
npm startThe backend starts on port 8787. The Electron window opens automatically.
If you want to run them separately:
# Terminal 1 — backend (auto-reloads on TypeScript changes)
npm run dev:backend
# Terminal 2 — Electron app (Vite HMR for the renderer)
npm run dev:appAgentM/
├── app/ # Electron + React frontend
│ ├── electron/ # Main process (Node.js): DB connections, IPC, storage
│ └── src/ # Renderer process (React): UI components, contexts
├── backend/ # Express API server (TypeScript): AI calls only
└── package.json # npm workspace root
Key things to know:
- All database operations run in the Electron main process (
app/electron/). They never go through the backend. - The backend (
backend/) only handles AI API calls. It holds no user data. - The renderer (
app/src/) communicates with the main process via IPC (seeapp/electron/preload.jsfor the exposed API).
- Create a branch from
main:git checkout -b fix/short-description
- Make your change, commit, and push.
- Open a pull request.
- Open an issue first and describe what you want to build. This avoids duplicate work and lets us discuss the approach before you invest time in it.
- Once discussed, fork, branch, build, and open a PR that references the issue.
Found something broken? Check if there's already an open issue. If not, open one with steps to reproduce, then submit a fix.
The app currently supports MongoDB and PostgreSQL. Adding a new database type means:
- Creating a new adapter in
app/electron/database/adapters/ - Following the same interface as
mongodb-adapter.jsorpostgresql-adapter.js - Registering it in
app/electron/database/connection-manager.js - Adding connection string examples to
app/src/components/connection/ConnectionForm.jsx
AI providers live in backend/src/services/. Adding one means:
- Creating a new service file following the pattern of
openai.service.tsorgemini.service.ts - Registering it in
backend/src/services/manager.ts - Adding the model names to the
/modelsendpoint inbackend/src/v1/agent.routes.ts
The frontend uses React 18 and Material UI 7. Components live in app/src/components/. Keep new UI consistent with the existing style.
Improving the README, fixing incorrect docs, or adding inline comments to complex code is always welcome.
- No strict linting config — follow the surrounding code style
- Use functional components and hooks
- Prefer
async/awaitover.then()chains
The backend has ESLint configured. Before submitting, run:
cd backend
npm run lint
npm run typecheckFix any errors before opening a PR.
- Keep commits focused — one logical change per commit
- Write clear commit messages that describe why, not just what
- Don't add comments that just narrate what the code does
- Make sure the app still starts and works with your change (
npm start) - Run the backend linter and typecheck (see above)
- Push your branch and open a PR against
main - Fill in the PR description:
- What does this change?
- Why is it needed?
- Any trade-offs or known limitations?
- Link any related issues
A maintainer will review and either merge, request changes, or explain if it's out of scope.
Open an issue and include:
- What you did — steps to reproduce
- What you expected — what should have happened
- What actually happened — the actual behavior or error
- Environment — OS, Node.js version, which database, which AI provider
- Logs — any error messages from the Electron DevTools console or backend terminal
Thank you for contributing.