Thank you for your interest in contributing to the AT Protocol MCP Server! This document provides guidelines and information for contributors.
The AT Protocol MCP Server is an MCP (Model Context Protocol) server that enables LLM clients to interact with the AT Protocol ecosystem. Contributions to this project help improve how LLMs access and use AT Protocol functionality.
What we're building:
- MCP tools that LLMs can call to interact with AT Protocol
- MCP resources that provide context data to LLMs
- MCP prompts that help LLMs perform common tasks
- Infrastructure for deploying and scaling the MCP server
What this is NOT:
- A direct-use API or SDK for application developers
- A JavaScript/TypeScript library for importing into apps
- An end-user application
If you're looking to build applications with AT Protocol, consider using the official @atproto/api package directly instead.
- Node.js 20+
- pnpm (recommended) or npm
- Git
- Basic knowledge of TypeScript, AT Protocol, and MCP
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/atproto-mcp.git cd atproto-mcp - Install dependencies:
pnpm install # or: npm install - Start the development server:
pnpm dev # or: npm run dev
This project supports development on Windows, macOS, and Linux. All build commands are cross-platform compatible.
All development tasks are available as npm scripts that work on any platform:
# Show all available commands
npm run help
# Common development tasks
npm run dev # Start development server
npm run build # Build for production
npm test # Run tests
npm run lint # Run linter
npm run format # Format code
npm run check # Run all quality checks
npm run clean # Clean build artifacts
npm run status # Show project statusWhen contributing code, please follow these guidelines to ensure cross-platform compatibility:
- Use npm scripts for all build tasks instead of shell commands
- Avoid Unix-specific commands like
rm,chmod,grep,awk,sed - Use Node.js APIs for file operations (fs, path modules)
- Use cross-platform packages:
rimraffor deleting files/directorieschalkfor colored terminal outputcommand-existsfor checking if commands are available
- Test on multiple platforms when possible (Windows, macOS, Linux)
- Use forward slashes in paths (Node.js normalizes them automatically)
- Avoid hardcoded paths - use
path.join()orpath.resolve() - Don't assume shell availability - use Node.js scripts instead of shell scripts
Don't do this (Unix-only):
{
"scripts": {
"clean": "rm -rf dist"
}
}Do this instead (cross-platform):
{
"scripts": {
"clean": "rimraf dist"
}
}Don't do this (Unix-only):
{
"scripts": {
"build": "tsc && chmod +x dist/cli.js"
}
}Do this instead (cross-platform):
{
"scripts": {
"build": "tsc && node scripts/make-executable.js"
}
}Where scripts/make-executable.js checks the platform and only runs chmod on Unix systems.
main- Production-ready codedevelop- Integration branch for featuresfeature/feature-name- Individual featuresfix/bug-description- Bug fixesdocs/documentation-update- Documentation changes
-
Create a new branch from
develop:git checkout develop git pull origin develop git checkout -b feature/your-feature-name
-
Make your changes following our coding standards
-
Write or update tests for your changes
-
Run the test suite:
pnpm test pnpm run lint pnpm run type-check -
Commit your changes using conventional commits:
git commit -m "feat: add new AT Protocol tool for user search" -
Push to your fork and create a pull request
We use Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
# Run all tests
pnpm test
# Run tests in watch mode
pnpm test --watch
# Run tests with coverage
pnpm run test:coverage
# Run tests with UI
pnpm run test:ui- Write unit tests for all new functions and classes
- Write integration tests for MCP tools and AT Protocol operations
- Mock external dependencies (AT Protocol API calls)
- Use descriptive test names that explain the scenario
- Follow the AAA pattern (Arrange, Act, Assert)
Example test structure:
describe('createPost tool', () => {
it('should create a post with text content successfully', async () => {
// Arrange
const mockAgent = createMockAtpAgent();
const tool = new CreatePostTool(mockAgent);
// Act
const result = await tool.execute({ text: 'Hello world!' });
// Assert
expect(result.success).toBe(true);
expect(result.data.uri).toBeDefined();
});
});- Use strict TypeScript configuration
- Provide explicit return types for public functions
- Use branded types for domain-specific identifiers
- Prefer
constassertions for immutable data - Use proper error handling with custom error classes
- Organize code by feature/domain
- Use barrel exports for clean module interfaces
- Keep functions pure and side-effect free where possible
- Implement proper separation of concerns
- Use PascalCase for interfaces (prefixed with
I) - Use PascalCase for types and enums
- Use camelCase for variables and functions
- Use UPPER_CASE for enum members
- Use descriptive names that explain purpose
When adding new MCP tools that LLMs can call:
- Create the tool in
src/tools/ - Define clear schemas - Use Zod for parameter validation
- Write descriptive metadata - LLMs use descriptions to understand what tools do
- Add error handling - Return clear error messages that LLMs can explain to users
- Write tests - Unit and integration tests for the tool
- Update documentation - Add examples showing how LLMs use the tool
- Add usage examples - Show natural language requests that would trigger the tool
Example: When adding a search_users tool, document it like:
- What it does: "Allows LLMs to search for AT Protocol users by name or handle"
- Example user request: "Find users named John on Bluesky"
- What the LLM does: Calls
search_users({ query: "John" })
When adding AT Protocol features to MCP tools:
- Use official SDK - Use the
@atproto/apipackage - Handle authentication - Support both authenticated and unauthenticated modes
- Respect rate limits - Implement backoff and return clear rate limit errors
- Error handling - Translate AT Protocol errors into LLM-friendly messages
- Validate responses - Ensure data matches expected schemas before returning to LLM
- Use JSDoc comments for all public APIs
- Include parameter descriptions and examples
- Document error conditions and return types
- Keep documentation up-to-date with code changes
- Update README.md for new features
- Add examples to the docs site
- Update API reference documentation
- Include troubleshooting information
When reporting bugs:
- Use the bug report template
- Provide clear reproduction steps
- Include environment information
- Add relevant logs (remove sensitive data)
- Describe expected vs actual behavior
When requesting features:
- Use the feature request template
- Explain the use case and problem
- Provide implementation ideas if possible
- Consider AT Protocol compatibility
- Indicate priority and impact
- Ensure all tests pass
- Follow the coding standards
- Write clear commit messages
- Respond to review feedback promptly
- Keep pull requests focused and small
- Review for correctness and style
- Test the changes locally
- Provide constructive feedback
- Approve when ready for merge
By contributing to this project, you agree that your contributions will be licensed under the MIT License.
- Be respectful and inclusive
- Help others learn and grow
- Share knowledge and best practices
- Follow our Code of Conduct
- Check existing issues and discussions
- Ask questions in GitHub Discussions
- Review the documentation
- Reach out to maintainers if needed
Thank you for contributing to the AT Protocol MCP Server!