Thank you for your interest in contributing to tokencost-dev! We welcome bug reports, feature requests, and pull requests.
- Node.js >=18
- npm
-
Clone the repository
git clone https://github.com/atriumn/tokencost-dev.git cd tokencost-dev -
Install dependencies
npm install
-
Build the project
npm run build
-
Watch mode for development
npm run dev
Run the test suite:
npm test # Run tests in watch mode
npm run test:run # Run tests once and exitAll tests must pass before submitting a pull request.
This project uses Biome for linting and formatting:
npm run lint # Check for lint and formatting issues
npm run lint:fix # Auto-fix issuesCI enforces linting — run npm run lint before pushing.
To build the TypeScript code:
npm run buildTo start the server:
npm start- Use TypeScript for all code
- Follow ESM module conventions (this project uses
"type": "module") - Run
npm run lintto check formatting and lint rules (Biome enforces style automatically) - Keep code readable and maintainable
- Comments should explain the "why", not the "what"
-
Fork and branch — Create a feature branch from
main:git checkout -b feat/your-feature-name
-
Make your changes — Implement your feature or fix, keeping commits logical and atomic
-
Test thoroughly
- Run
npm run test:runand ensure all tests pass - Add tests for new functionality
- Test the MCP server with Claude Code or Cursor
- Run
-
Commit with clear messages
git commit -m "type: description"Examples:
feat: add model filtering by capabilityfix: handle missing pricing data gracefullydocs: clarify fuzzy matching behavior
-
Push and create a pull request
- Push to your fork:
git push origin feat/your-feature-name - Open a PR against
main - Provide a clear description of what you changed and why
- Push to your fork:
-
Address feedback — Respond to review comments and update as needed
Found a bug? Have a feature idea?
- GitHub Issues — Open an issue
- Include:
- What you expected vs. what happened
- Steps to reproduce (for bugs)
- Your Node.js version and OS (if relevant)
The project is organized as follows:
src/index.ts— Server setup and stdio transportsrc/tools.ts— Tool definitions and dispatch logicsrc/pricing.ts— Fetch and cache LiteLLM pricing datasrc/search.ts— Fuzzy model name matching
For larger contributions, familiarize yourself with the MCP protocol (modelcontextprotocol.io).
- Check existing GitHub Issues
- Open a discussion or ask in an issue if something is unclear
This project has adopted the Contributor Covenant. By participating, you are expected to uphold this code of conduct.
Happy contributing! 🎉