Thank you for your interest in contributing! This guide will help you get started.
- Python 3.12+
- uv package manager
# Clone the repository
git clone https://github.com/eliasbiondo/reddit-mcp-server.git
cd reddit-mcp-server
# Install dependencies (including dev)
uv sync
# Run the server
uv run reddit-mcp-server --helpThis project follows hexagonal architecture (ports & adapters). Please maintain this separation when contributing:
- Domain (
domain/) β Pure business logic, exceptions, value objects. No framework imports. - Ports (
ports/) β Abstract interfaces (ABCs) defining contracts. - Application (
application/) β Use cases that orchestrate business logic via ports. - Adapters β Concrete implementations:
- Inbound (
adapters/inbound/) β Entry points: CLI, MCP server, MCP tools. - Outbound (
adapters/outbound/) β Infrastructure: redd client, config loading.
- Inbound (
- Container (
container.py) β Dependency injection composition root.
- Domain and Application layers must never import from Adapters.
- Application layer depends only on Ports, never on concrete implementations.
- Only
container.pyimports concrete adapter classes to wire everything together. - MCP tools import only from Application (use cases) and Inbound adapters (serialization, error mapping).
We use Ruff for linting and formatting:
# Lint
uv run ruff check src/
# Format
uv run ruff format src/
# Fix auto-fixable issues
uv run ruff check --fix src/- Line length: 100 characters
- Target Python version: 3.12
- Use type hints everywhere
- Use
frozen=Truedataclasses for value objects - Use
async/awaitin ports and adapters (redd uses async client)
# Run tests
uv run pytest
# Run with coverage
uv run pytest --cov=reddit_mcp_server- Add method to
RedditPort(ports/reddit.py) if the underlying redd client supports it. - Implement in
ReddClientAdapter(adapters/outbound/redd_client.py). - Create a use case in
application/. - Register in Container (
container.py). - Create MCP tool in
adapters/inbound/mcp_tools/. - Register in
mcp_server.py(adapters/inbound/mcp_server.py).
- Fork the repository and create your branch from
main. - Follow the architecture guidelines above.
- Add tests for new functionality.
- Run linting and formatting before submitting.
- Update the README if you're adding new tools or configuration options.
By contributing, you agree that your contributions will be licensed under the MIT License.