# MCP Servers Monorepo This repository is a monorepo that contains a collection of Model Context Protocol (MCP) servers that can be used to extend LLM agent capabilities. ## Repository This repository is hosted at: https://codeberg.org/knightdave/dawids-mcp-servers.git ## Getting Started ```bash # Clone the repository git clone https://codeberg.org/knightdave/dawids-mcp-servers.git cd dawids-mcp-servers ``` ## Project Structure ``` dawids-mcp-servers/ ├── servers/ # Individual MCP servers │ ├── hello_world/ # Example server │ │ ├── src/ # Server source code │ │ ├── tests/ # Server tests │ │ ├── Dockerfile # Server container definition │ │ └── pyproject.toml # Server package configuration │ └── ... # Other servers └── .woodpecker.yml # CI/CD configuration ``` ## Coding Rules for LLM Agent When implementing new servers or extending existing ones, follow these guidelines: ### Python Package Structure - Each server is a separate Python package - Use Python language with uv package manager - Follow PEP 8 style guidelines - Use type hints for all functions and methods - Document all public APIs with docstrings - Run all commands in uv context ### Code Quality - Use ruff for linting - Maintain at least 80% test coverage - Write unit, integration, and end-to-end tests - Use pytest for testing ### Server Implementation - Each server must support two transport methods: 1. stdio transport for local development and testing 2. Remote endpoint (HTTP) for production use - Transport method should be selectable via input parameter - Follow the MCP protocol specification ### Containerization - Each server should have its own Dockerfile - Follow Docker best practices: - Use multi-stage builds - Run as non-root user - Include health checks - Minimize image size - Lint Dockerfiles with hadolint ### Dependencies - Clearly specify dependencies in pyproject.toml - Pin dependency versions for reproducibility - Use virtual environments for development ## Creating a New Server Use servers/hello-world as a template to create a new server. Copy directory to servers/server_name and implement changes. ## Testing Run tests for a specific server: ```bash cd servers/server_name uv run pytest ``` Run tests with coverage: ```bash cd servers/server_name uv run pytest --cov=server_name ``` ## Building and Running Build a server Docker image: ```bash cd servers/server_name docker build -t server_name . ``` ### Using MCP Servers To use any of the MCP servers in this repository, you can run them using `uv` from the repository root: ```bash # Example: Run GitLab glab server ⚠️ **DEPRECATION NOTICE:** The `gitlab_glab` server is deprecated. Use `gitlab_python` instead: # Example: Run GitLab Python server (recommended) uv --directory /path-to-repo/dawids-mcp-servers/servers/gitlab_python run mcp-gitlab-python --transport stdio # (Legacy) Run GitLab glab server uv --directory /path-to-repo/dawids-mcp-servers/servers/gitlab_glab run mcp-gitlab-glab --transport stdio # Example: Run hello world server uv --directory /path-to-repo/dawids-mcp-servers/servers/hello_world run mcp-hello-world --transport stdio ``` Replace `/path-to-repo` with the actual path to where you cloned this repository. ### Repository This repository is hosted at: https://codeberg.org/knightdave/dawids-mcp-servers.git ### Alternative: Running from server directory You can also run servers by navigating to their directory first: Run a server with stdio transport: ```bash cd servers/server_name uv run server_name --transport stdio ``` Run a server with HTTP transport: ```bash cd servers/server_name uv run server_name --transport remote --host 0.0.0.0 --port 8080 ``` Run a server in Docker: ```bash docker run -p 8080:8080 server_name ``` ## Development Best Practices ### Error Handling - Log errors with context information - Return meaningful error messages to clients ### Security - Don't include sensitive information in logs or responses - Validate all input data - Use HTTPS for remote transport in production - Follow the principle of least privilege ### Performance - Optimize resource-intensive operations - Use async/await for I/O-bound operations - Implement proper caching strategies - Monitor and profile server performance ### Documentation - Document the purpose and capabilities of each server - Include examples of how to use the server's tools and resources - Document the API schema for each tool and resource - Keep documentation up-to-date with code changes ## Contributing When contributing to this repository, please follow these steps: 1. Create a new branch for your feature or bugfix 2. Implement your changes following the coding rules 3. Write tests for your changes 4. Update documentation as needed 5. Submit a pull request ## License This project is licensed under the MIT License - see the LICENSE file for details.