Getting Started with Trento MCP Server
This guide provides everything you need to start developing with the Trento MCP Server. It covers environment setup, project architecture, building, running, testing, and debugging.
Building the Project
Before you begin development, ensure you have the following tools installed:
-
Go (see Go installation guide)
-
Docker or Podman (for containerization)
-
Make (for build automation)
-
Git (for version control)
Using asdf for Version Management
asdf is a version manager that allows you to use specific versions of programming languages and tools that are known to be compatible with this project, rather than relying on globally installed versions.
To get started with asdf:
-
Follow the official asdf getting started guide to install asdf.
-
Install all required plugins from the project’s
.tool-versionsfile:
cut -d' ' -f1 .tool-versions | xargs -I {} asdf plugin add {}
-
Install the specified versions:
asdf install
Project Overview
The Trento MCP Server is a Model Context Protocol (MCP) server implementation that enables AI tools and agents to interact with Trento infrastructure. The project automatically generates MCP tools from OpenAPI specifications, ensuring strong alignment between the API contract and implementation.
Project Structure
The project follows Go standard layout conventions:
mcp-server/
├── bin/ # Compiled binaries
├── cmd/ # CLI commands and entry points
│ └── root.go # Main command definitions and flags
├── docs/ # Documentation
├── hack/ # Build scripts and linters
├── internal/ # Private application code
│ ├── server/ # Server implementation
│ │ ├── auth.go # Authentication logic
│ │ └── server.go # Core server functionality
│ └── utils/ # Shared utilities
│ ├── logger.go # Logging configuration
│ └── types.go # Common types and transport definitions
├── main.go # Application entry point
├── Dockerfile # Container image definition
└── Makefile # Build automation
Building the Container Image
./bin/trento-mcp-server --port 8080 --transport sse --verbosity info
For a complete list of available flags:
./bin/trento-mcp-server --help
Testing
Linting
The project includes some linters to ensure code quality:
# Run all linters
make lint
# Individual linters
make linter-asciidoc # Documentation in AsciiDoc validation
make linter-golangci # Go code linting
make linter-license # License header verification
make linter-shellcheck # Shell script linting
make linter-yamllint # YAML file linting
Debugging
Debug Logging
Run the server with debug logging enabled:
./bin/trento-mcp-server --verbosity debug
Log levels:
* debug: Debug (most verbose)
* info: Info (default)
* warning: Warning
* error: Error (least verbose)
Common Debugging Scenarios
-
OpenAPI Specification Issues: Verify OAS documentation provided via
--oas-pathflag is valid and contains operations tagged with the tag selected via--tag-filterflag. -
Authentication Problems: Check that the provided Trento API key is correct
-
Transport Issues: Try switching between
streamableandssetransports -
Port Conflicts: Use
--portflag to specify a different port