VS Code Integration

You can use Trento MCP Server directly on Visual Studio Code using the GitHub Copilot extension or any compatible LLM client that supports the Model Context Protocol (MCP). This allows you to interact with the Trento API and execute tools defined in the OpenAPI specification.

Using VS Code (or compatible LLM clients)

  1. Start the Server

    • Build and run the server locally or in a container. For example, type make run.

    • By default, the server will listen on a specific port (see your configuration or environment variables).

  2. Configure Your LLM Client

    • In your LLM tool or VS Code extension, set the MCP server endpoint to point to your running Trento MCP Server instance. For example:

  3. Connect and Use

    • Use the LLM tool or extension as usual. It will communicate with the MCP server for tool execution, context, and API interactions.

    • Open the Command Palette (Ctrl+Shift+P), search for your LLM extension’s settings, and set the MCP server URL to your running instance.

    • Ensure the server is accessible from your development environment.

For more details, refer to your LLM tool or extension documentation.

Example MCP Client Configuration

Authentication Setup

The Trento MCP Server requires authentication using a Trento API key. You must first generate an API key from your Trento instance:

  1. Log in to your Trento web interface

  2. Navigate to your user profile or settings

  3. Generate a new API key token

  4. Copy and securely store the generated token

Configuration with Authentication

To connect your LLM client or extension to this MCP server with proper authentication, use one of the following configuration options:

Option 1: Secure Configuration with Prompted Input

This configuration will prompt you for your API key when VS Code starts, keeping it secure:

{
  "servers": {
    "trento": {
      "type": "http",
      "url": "http://localhost:5000/mcp",
      "headers": {
        "X-TRENTO-MCP-APIKEY": "${input:trento-api-key}"
      }
    }
  },
  "inputs": [
    {
      "type": "promptString",
      "id": "trento-api-key",
      "description": "Trento API Key",
      "password": true
    }
  ]
}

Option 2: Direct Header Configuration

{
  "servers": {
    "trento": {
      "type": "http",
      "url": "http://localhost:5000/mcp",
      "headers": {
        "X-TRENTO-MCP-APIKEY": "your-actual-trento-api-key-here"
      }
    }
  }
}

Alternatively, you can use this link to install the server directly in VS Code:

Install in VS Code

Configuration Notes

  • Replace http://localhost:5000/mcp with the actual URL and port where your Trento MCP Server instance is running. If using SSE, the path becomes "/sse".

  • If you’re using a custom header name (configured with --header-name), update the header name in your configuration accordingly

  • The password: true setting in Option 1 ensures your API key input is masked when you type it

  • VS Code will remember your API key for the session, so you won’t need to re-enter it until you restart VS Code

Troubleshooting Authentication

If you encounter authentication issues:

  1. Verify your API key is valid by testing it directly with your Trento instance

  2. Check that the header name matches your server configuration (default: X-TRENTO-MCP-APIKEY)

  3. Ensure your Trento MCP Server is running and accessible

  4. Check the VS Code developer console for any error messages