Skip to main content
Glama
mcp-server-rules.md1.29 kB
# General Rules for Creating MCP Servers ## 1. Tool Design - Each tool must have a clear, single responsibility. - Input and output schemas must be strictly validated. - Tool names must be unique and descriptive. ## 2. Error Handling - All errors must be structured with `success: false`, `error`, and `errorCode`. - Validation errors must be clear and actionable. ## 3. Mocking - All external dependencies must be mockable for tests. - Mock state must be reset between tests to ensure isolation. ## 4. Testing - 100% test coverage is required. - Use test data generators for all entity creation. - All tests must pass in both mock and real API modes. ## 5. Documentation - Every tool must be documented with input/output schemas and examples. - Update the changelog for every release. ## 6. Security - Never commit secrets or API keys. - Use environment variables for all sensitive data. ## 7. CI/CD - All code must pass linting, formatting, and type checks before merging. - Docker image must be built and validated in CI. ## 8. Versioning - Use semantic versioning for all releases. - Update `CHANGELOG.md` for every release. ## 9. Extensibility - New tools/features must follow the same structure and conventions. - All new features must include tests and documentation.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/asachs01/float-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server