This project is mcp server for mapflow.ai api
- Use context7 to get actual mcp sdk docs
- Use context7 to get actual zod docs
- Always use context7 if you work with some library or framework
- Use context7 to get actual biome docs
- Always run
bun validateto check code style and linter issues after modifying code
- When writing or modifying code, if linter(biome) errors occur — fix them first.
- After successfully fixing each linter error:
- Add a short description of the correct coding practice that prevents this error.
- Append this description to the
AGENTS.mdfile to the 'Known issues' section in the following format:## Known issues ... - short explanation of the correct way to write code
- Do not duplicate existing entries in 'Known issues'.
- Keep all descriptions concise, clear, and focused on how to write code correctly according to the linter rules.
Important Note:
These rules only apply to linter (biome) errors and do not cover logical or business logic errors.
- Use type-only imports (e.g.,
import type { Foo }) whenverbatimModuleSyntaxis enabled to satisfy TypeScript’s module rules. - Prefer
McpServerfrom@modelcontextprotocol/sdk/server/mcp.jsinstead of the deprecatedServerimport.
- Use a logging library that writes to stderr or files
- For JavaScript, be especially careful - console.log() writes to stdout by default
// ❌ Bad (STDIO)
console.log("Server started");
// ✅ Good (STDIO)
console.error("Server started"); // stderr is safe
Default to using Bun instead of Node.js.
- Use
bun <file>instead ofnode <file>orts-node <file> - Use
bun testinstead ofjestorvitest - Use
bun build <file.html|file.ts|file.css>instead ofwebpackoresbuild - Use
bun installinstead ofnpm installoryarn installorpnpm install - Use
bun run <script>instead ofnpm run <script>oryarn run <script>orpnpm run <script> - Bun automatically loads .env, so don't use dotenv.
APIs
Bun.serve()supports WebSockets, HTTPS, and routes. Don't useexpress.bun:sqlitefor SQLite. Don't usebetter-sqlite3.Bun.redisfor Redis. Don't useioredis.Bun.sqlfor Postgres. Don't usepgorpostgres.js.WebSocketis built-in. Don't usews.- Prefer
Bun.fileovernode:fs's readFile/writeFile - Bun.$
lsinstead of execa.
Testing
Use bun test to run tests.
import { test, expect } from "bun:test";
test("hello world", () => {
expect(1).toBe(1);
});For more information, read the Bun API docs in node_modules/bun-types/docs/**.md.