Thanks for your interest in improving gitpulse-mcp! Contributions of all kinds are welcome — bug reports, feature ideas, docs, and code.
git clone https://github.com/ATOM00blue/gitpulse-mcp.git
cd gitpulse-mcp
npm install
npm run build
npm testsrc/
index.ts # bin entry: argv parsing, stdio transport, signal handling
server.ts # createServer(): registers all MCP tools
config.ts # CLI args -> ServerConfig
git/
exec.ts # safe git runner (execFile, no shell, timeouts)
repo.ts # repo resolution & ref validation
parse.ts # parsers for git log / numstat / blame porcelain
tools/ # one file per MCP tool
lib/
format.ts # output helpers + safeHandler wrapper
types.ts # shared types
test/ # vitest unit + integration tests (build a fixture repo)
scripts/smoke.mjs # end-to-end MCP smoke test over stdio
npm run build— compile TypeScript todist/npm run dev— compile in watch modenpm test— run the test suite (vitest)npm run test:watch— tests in watch modenpm run smoke— build first, then run the end-to-end smoke testnpm run lint— eslintnpm run format— prettier
- Read-only. gitpulse-mcp must never modify a repository. Only read commands.
- No shell. Always invoke git via
git()insrc/git/exec.ts(usesexecFilewith an arg array). Never build shell strings. - stdout is sacred. It carries JSON-RPC. All logging/diagnostics go to stderr.
- Structured + human output. Every tool returns both
content[0].text(markdown) andstructuredContent(typed JSON). - Cross-platform. Code must work on Windows, macOS, and Linux. Avoid POSIX-only assumptions; rely on git's porcelain output and normalize paths.
- Tests. Add/extend tests for any new tool or parser. Tests build a deterministic fixture repo (see
test/fixture.ts).
- Create
src/tools/myTool.tsexporting an input schema (ZodRawShape) and an async handler returning aToolResult. - Register it in
src/server.tswith a cleartitle,description, andannotations: { readOnlyHint: true }. - Add tests in
test/tools.test.tsand a check inscripts/smoke.mjs. - Document it in
README.md.
- Fork and create a branch.
- Make your change with tests; ensure
npm run build && npm test && npm run lint && npm run smokeall pass. - Open a PR describing the change and motivation.
Be kind and constructive. We're all here to build something useful.