Thank you for your interest in contributing! This document provides guidelines and instructions for contributing.
- 🐛 Report bugs
- 💡 Suggest new features
- 📝 Improve documentation
- 🔧 Submit bug fixes
- ✨ Add new features
- 🧪 Write tests
# Fork the repository on GitHub, then:
git clone https://github.com/YOUR_USERNAME/langfuse-mcp-python.git
cd langfuse-mcp-python# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Create a feature branch
git checkout -b feature/your-feature-name
# Or for bug fixes
git checkout -b fix/bug-description- Files:
snake_case.py - Classes:
PascalCase - Functions/Methods:
snake_case - Constants:
UPPER_SNAKE_CASE - Private members:
_leading_underscore
- Add docstrings to all public functions/classes
- Use Google-style docstrings
- Update README.md if adding features
- Add examples for new functionality
Example:
def fetch_agent_traces(agent_name: str, limit: int = 100) -> List[Trace]:
"""
Fetch traces for a specific agent.
Args:
agent_name: Name of the agent to fetch traces for
limit: Maximum number of traces to return (default: 100)
Returns:
List of trace objects
Raises:
ValueError: If agent_name is empty
LangfuseError: If API request fails
Example:
>>> traces = fetch_agent_traces("research_agent", limit=50)
>>> print(len(traces))
50
"""
passUse conventional commits format:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
git commit -m "feat(tools): add compare_agent_versions tool"
git commit -m "fix(metrics): correct latency calculation"
git commit -m "docs(readme): update installation instructions"- Push your branch:
git push origin feature/your-feature-name - Go to GitHub and create a Pull Request
- Fill out the PR template
- Link any related issues
- Wait for review
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Refactoring
## Testing
- [ ] Added tests
- [ ] All tests pass
- [ ] Manual testing completed
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-reviewed code
- [ ] Commented complex code
- [ ] Updated documentation
- [ ] No breaking changes (or documented)
## Related Issues
Fixes #123- Check existing issues
- Try the latest version
- Collect relevant information
**Describe the Bug**
Clear description of the bug
**To Reproduce**
Steps to reproduce:
1. Go to '...'
2. Run '...'
3. See error
**Expected Behavior**
What you expected to happen
**Actual Behavior**
What actually happened
**Environment**
- OS: [e.g., macOS 13.0]
- Python: [e.g., 3.11.5]
- Package version: [e.g., 1.0.0]
**Additional Context**
- Error messages
- Logs
- Screenshots**Feature Description**
Clear description of the feature
**Use Case**
Why is this feature needed?
**Proposed Solution**
How should it work?
**Alternatives Considered**
Other approaches you've thought about
**Additional Context**
Mockups, examples, etc.LANGFUSE-MCP-PYTHON/
├── src/
│ └── langfuse-mcp-python/
│ ├── __init__.py
│ ├── server.py # Main MCP server
│ ├── tools/ # Individual MCP tools
│ ├── integrations/ # External service integrations
│ └── utils/ # Utility functions
├── pyproject.toml # Package configuration
└── README.md # Main documentation
Create src/langfuse-mcp-python/tools/your_tool.py:
"""Your Tool - Description"""
from typing import Any, Dict
class YourTool:
"""Tool description"""
def __init__(self, langfuse_client):
self.langfuse = langfuse_client
async def execute(self, args: Dict[str, Any]) -> str:
"""Execute the tool"""
# Implementation
return "Result"Add to server.py:
Tool(
name="your_tool",
description="Tool description",
inputSchema={
"type": "object",
"properties": {
"param": {"type": "string"}
}
}
)Create tests in tests/test_your_tool.py
- Add to README.md
- Add examples
- Update QUICK_REFERENCE.md
- Be respectful and inclusive
- Accept constructive criticism
- Focus on what's best for the community
- Show empathy towards others
- Harassment or discrimination
- Trolling or insulting comments
- Publishing others' private information
- Other unprofessional conduct
Every contribution, no matter how small, is valuable. Thank you for helping make this project better!
Happy Contributing! 🎉