Thank you for considering contributing to document-reader-mcp! This guide will help you get started.
git clone https://github.com/ifmelate/document-reader-mcp.git
cd document-reader-mcppython3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activatepip install -r requirements.txtpython -m server.mainThe server should start and be ready to accept MCP requests over stdio.
This project follows these conventions:
- Python: PEP 8 with 4-space indentation
- EditorConfig: Respect
.editorconfigsettings - Commit Messages: Use Conventional Commits
feat:for new featuresfix:for bug fixesdocs:for documentation updatesrefactor:for code refactoringtest:for test additions/changeschore:for maintenance tasks
To add a new document format:
-
Create an extraction function in
server/main.py:def _extract_text_from_<format>(path: str, **kwargs) -> str: """Extract text from <format> file.""" # Implementation here pass
-
Add format routing in
extract_text_from_file():elif ext_lower == ".<format>": text = _extract_text_from_<format>(expanded_path)
-
Add streaming support in
extract_text_from_file_stream():elif ext_lower == ".<format>": # Stream implementation here pass
-
Update documentation:
- Add format to README.md supported formats table
- Update docstrings in tool functions
- Add any new dependencies to
requirements.txt
-
Test thoroughly:
- Test with various sample files
- Test edge cases (empty files, large files, malformed files)
- Verify rate limiting works correctly
-
Create a feature branch from
main:git checkout -b feat/add-xyz-support
-
Make your changes following the code style guidelines
-
Test your changes thoroughly:
- Test basic functionality
- Test error handling
- Test with edge cases
-
Commit with conventional commit messages:
git commit -m "feat: add support for XYZ file format" -
Push and create a pull request:
git push origin feat/add-xyz-support
-
Describe your changes in the PR:
- What problem does it solve?
- How did you test it?
- Any breaking changes?
- Screenshots/examples if applicable
All submissions require review. We'll review:
- Code quality and maintainability
- Test coverage
- Documentation updates
- Security considerations
- Performance implications
If you discover a security vulnerability:
- Do NOT open a public issue
- Email details to the maintainers privately
- Wait for confirmation before disclosing
- Open an issue for bugs or feature requests
- Start a discussion for general questions
- Check existing issues before creating new ones
By contributing, you agree that your contributions will be licensed under the MIT License.