Thank you for your interest in contributing to @mcp-ts/sdk! This guide will help you understand how to make meaningful contributions to the project.
- Getting Started
- Development Setup
- Project Structure
- Making Changes
- Testing
- Commit Messages
- Pull Request Process
- Common Contribution Types
- Node.js: >= 18.0.0
- npm: >= 9.0.0
- Git: Latest stable version
# Fork the repository on GitHub, then:
git clone https://github.com/YOUR_USERNAME/mcp-ts.git
cd mcp-ts
# Add upstream remote
git remote add upstream https://github.com/zonlabs/mcp-ts.gitnpm installnpm run build # Build all entry points
npm run dev # Watch mode for development
npm run type-check # TypeScript validation
npm test # Run tests
npm run test:ui # Run tests in UI mode
npm run test:debug # Debug tests
npm run clean # Clean build artifactssrc/
├── server/ # Server-side implementations
│ ├── mcp/ # Core MCP client & OAuth
│ ├── storage/ # Storage backends (Redis, SQLite, File, Memory)
│ └── handlers/ # SSE & Next.js handlers
├── client/ # Client-side implementations
│ ├── core/ # SSE client & core logic
│ ├── react/ # React hooks
│ └── vue/ # Vue composables
├── adapters/ # Framework integrations (Vercel AI, LangChain, Mastra, AG-UI)
└── shared/ # Shared types & utilities
tests/ # Playwright integration tests
examples/ # Working examples
docs/ # Docusaurus documentation
- Check existing issues and PRs
- For large features, open an issue first to discuss the approach
- Sync with upstream:
git fetch upstream && git rebase upstream/main
- TypeScript: Strict mode, fully typed
- Imports: Use explicit
.jsextensions for ESM:import { example } from './module.js'; // ✅ Good
- Optional Dependencies: Use dynamic imports for peer dependencies
npm test # Run all tests
npm test -- tests/storage/ # Run specific test
npm run test:ui # Interactive mode- Unit tests for new logic
- Integration tests for features
- All tests pass:
npm test - Type check passes:
npm run type-check
Use conventional commit format:
<type>(<scope>): <subject>
<body>
<footer>
Types: feat, fix, docs, refactor, test, chore, perf
Scopes: server, client, adapters, storage, types, docs, ci
Examples:
feat(storage): add MongoDB backend
fix(client): resolve SSE connection timeout
docs: update installation guide
- Create a feature branch:
git checkout -b feat/your-feature - Make your changes
- Run checks:
npm run type-check npm run build npm test - Commit and push:
git commit -m "feat(scope): description" git push origin feat/your-feature
Use this template when creating a pull request:
## What is the type of this PR?
- [ ] Bugfix
- [ ] Feature
- [ ] Refactoring
- [ ] Documentation
- [ ] Other
## Which area of the project does this PR affect?
- [ ] `server` (MCP client, handlers)
- [ ] `client` (React, Vue, SSE client)
- [ ] `adapters` (Vercel AI, LangChain, Mastra, AG-UI)
- [ ] `storage` (Redis, SQLite, File, Memory backends)
- [ ] `docs` (Docusaurus documentation)
- [ ] `examples` (Example applications)
- [ ] `ci` (GitHub workflows)
- [ ] Other
## Description of the change
<!-- Please provide a clear and concise description of what this PR does. -->
## Is this a breaking change?
- [ ] Yes
- [ ] No
## Checklist
- [ ] Code follows TypeScript strict mode guidelines
- [ ] Tests added/updated
- [ ] Documentation updated (if user-facing change)
- [ ] Build succeeds (`npm run build`)
- [ ] Type check passes (`npm run type-check`)
- [ ] All tests pass (`npm test`)
- [ ] Commit messages follow conventional format
## Related Issue
<!-- If your PR fixes an open issue, link it here. -->
Closes #- Implement
StorageBackendinterface insrc/server/storage/your-storage.ts - Add dynamic import in
src/server/storage/index.ts - Add peer dependency to
package.json - Add tests in
tests/storage/your-storage.test.ts - Document in
docs/docs/storage-backends.md
- Create
src/adapters/your-framework-adapter.ts - Implement conversion from
MultiSessionClientto framework format - Add peer dependency to
package.json - Add export to
package.jsonandtsup.config.ts - Add tests in
tests/adapters/your-framework.test.ts - Document in
docs/docs/adapters.md
- Create a test that reproduces the bug first
- Fix with minimal changes
- Ensure tests pass
- Use commit type
fixwith clear description
Update docs in docs/docs/:
installation.md- Setup changesapi-reference.md- API changesstorage-backends.md- Storage backend docs- Framework guides:
react.md,nextjs.md,vue.md, etc.
When adding new exports:
- Create the module in
src/ - Update
package.jsonexports field - Update
tsup.config.tsentry points - Run
npm run build - Test:
import { item } from '@mcp-ts/sdk/your-module'
- Questions? Open a discussion
- Found a bug? Open an issue
- Want to suggest a feature? Open an issue
- At least one maintainer review required
- All CI checks must pass
- Address feedback promptly
- Squash and merge to main
Thank you for contributing to @mcp-ts/sdk! 🚀