This file (symlinked as CLAUDE.md and AGENTS.md) provides context and guidelines for AI agents working on the MCP Toolbox for Databases project. It summarizes key information from CONTRIBUTING.md and DEVELOPER.md.
MCP Toolbox for Databases is a Go-based project designed to provide Model Context Protocol (MCP) tools for various data sources and services. It allows Large Language Models (LLMs) to interact with databases and other tools safely and efficiently.
- Language: Go (1.23+)
- Documentation: Hugo (Extended Edition v0.146.0+)
- Containerization: Docker
- CI/CD: GitHub Actions, Google Cloud Build
- Linting:
golangci-lint
cmd/: Application entry points.internal/sources/: Implementations of database sources (e.g., Postgres, BigQuery).internal/tools/: Implementations of specific tools for each source.tests/: Integration tests.docs/: Project documentation (Hugo site).
- Go 1.23 or later.
- Docker (for building container images and running some tests).
- Access to necessary Google Cloud resources for integration testing (if applicable).
- Build Binary:
go build -o toolbox - Run Server:
go run .(Listens on port 5000 by default) - Run with Help:
go run . --help - Test Endpoint:
curl http://127.0.0.1:5000
- Unit Tests:
go test -race -v ./cmd/... ./internal/... - Integration Tests:
- Run specific source tests:
go test -race -v ./tests/<source_dir> - Example:
go test -race -v ./tests/alloydbpg - Add new sources to
.ci/integration.cloudbuild.yaml
- Run specific source tests:
- Linting:
golangci-lint run --fix
- Hugo (Extended Edition v0.146.0+)
- Node.js (for
npm ci)
- Navigate to
.hugodirectory:cd .hugo - Install dependencies:
npm ci - Start server:
hugo server
- Deploy In-development docs: Merges to main ->
/dev/. - Deploy Versioned Docs: New Release ->
/<version>/and root. - Deploy Previous Version Docs: Manual workflow for older versions.
- Tool Name:
snake_case(e.g.,list_collections,run_query).- Do not include the product name (e.g., avoid
firestore_list_collections).
- Do not include the product name (e.g., avoid
- Tool Type:
kebab-case(e.g.,firestore-list-collections).- Must include the product name.
- Branch Naming:
feat/,fix/,docs/,chore/(e.g.,feat/add-gemini-md). - Commit Messages: Conventional Commits format.
- Format:
<type>(<scope>): <description> - Example:
feat(source/postgres): add new connection option - Types:
feat,fix,docs,chore,test,ci,refactor,revert,style.
- Format:
- Create a new directory:
internal/sources/<newdb>. - Define
ConfigandSourcestructs ininternal/sources/<newdb>/<newdb>.go. - Implement
SourceConfiginterface (SourceConfigType,Initialize). - Implement
Sourceinterface (SourceType). - Implement
init()to register the source. - Add unit tests in
internal/sources/<newdb>/<newdb>_test.go.
- Create a new directory:
internal/tools/<newdb>/<toolname>. - Define
ConfigandToolstructs. - Implement
ToolConfiginterface (ToolConfigType,Initialize). - Implement
Toolinterface (Invoke,ParseParams,Manifest,McpManifest,Authorized). - Implement
init()to register the tool. - Add unit tests.
- Add source documentation to
docs/en/resources/sources/. - Add tool documentation to
docs/en/resources/tools/.