git clone <repo>
cd mcp
npm ci
npm run dev- Create
src/tools/new.tools.ts:
export const myTool: Tool = {
name: 'platformos.my.tool',
description: 'Does X',
inputSchema: z.object({ foo: z.string() }),
handler: async (input) => ({ result: input.foo.toUpperCase() })
};
export const myTools = [myTool];- Register in
src/tools/index.ts:
export const allTools = [
...environmentTools,
...myTools,
// ...
];- Add tests
src/__tests__/my.tools.test.ts - Update TOOLS.md
When working on @platformos/* packages (linter, LSP, parser, etc.) you can link a local
platformos-tools checkout into pos-cli
so that changes are picked up immediately without publishing to npm.
# Build platformos-tools first
cd /path/to/platformos-tools
yarn build
# Link all @platformos packages into pos-cli
npm run link:tools -- /path/to/platformos-tools# Restore the npm-published versions
npm run unlink:toolsAfter linking, both pos-cli check and pos-cli lsp will use your local package code.
Remember to rebuild platformos-tools (yarn build) after making changes there.
npm run lint
npm run test
npm run buildnpm version patch/minor/majornpm publish- Update CHANGELOG.md
- TypeScript strict
- Zod for all schemas
- 90%+ test coverage
- No
anytypes - JSDoc for complex functions
| Type | Command | Purpose |
|---|---|---|
| Unit | npm test |
Tool handlers, wrappers |
| Integration | npm test |
Express endpoints |
| E2E | Manual | nock + real flows |
Questions? Open an issue!","path":"CONTRIBUTING.md