Skip to content

Conversation

wyangsun
Copy link
Contributor

@wyangsun wyangsun commented Aug 5, 2025

  • Add a Github Action to push helm chart.
  • Rename release workflow name.
  • Fix release workflow docker cache image naming to lowercase.
  • Fix Docker image permission issue: move app out from /root folder.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Introduced automated publishing of Helm charts to the GitHub Container Registry via a new workflow.
  • Chores
    • Updated Docker image build workflow to use a lowercase repository name for image naming and cache references.
  • Refactor
    • Changed the working directory in the Docker container from /root/ to /app for improved consistency.
    • Improved OAuth URL handling and logging in the server for better endpoint accuracy.
    • Centralized OAuth metadata URLs to use a configured base URL for consistency.
  • Bug Fixes
    • Disabled default ALB ingress annotations in Helm chart configuration while preserving them as commented references.
  • Documentation
    • Added new environment variable MCP_URL to README for configuring public MCP server URL.
    • Enhanced OAuth documentation with an Okta OAuth workflow example diagram.

Copy link

coderabbitai bot commented Aug 5, 2025

Walkthrough

A new GitHub Actions workflow for publishing Helm charts to the GitHub Container Registry was added. The release workflow was updated to use a lowercase repository name for Docker image caching and renamed for clarity. The Dockerfile was modified to use /app as the working directory instead of /root/. Additionally, ingress annotations in the Helm chart values were commented out to disable default ALB settings. OAuth-related documentation and server code were enhanced to use a configurable MCP URL, improve logging, and centralize URL construction. Minor formatting cleanups and additions to OAuth config and handlers were also made.

Changes

Cohort / File(s) Change Summary
Helm Chart Publishing Workflow
.github/workflows/push-helm-chart.yml
Introduces a new GitHub Actions workflow for packaging and publishing Helm charts to the GitHub Container Registry, triggered by pushes, releases, or manual dispatch.
Release Workflow Updates
.github/workflows/release.yml
Renames the workflow, adds a step to downcase the repository name for Docker image cache references, and updates cache parameters to use the new lowercase variable.
Dockerfile Directory Change
Dockerfile
Changes the working directory in the final container stage from /root/ to /app.
Helm Chart Values Update
charts/mcp-trino/values.yaml
Comments out ALB ingress annotations, disabling them while preserving the original configuration as documentation.
OAuth Documentation Addition
docs/oauth.md
Adds an Okta OAuth workflow example with a Mermaid sequence diagram illustrating the OAuth 2.0 authorization flow involving MCP client, MCP server, and Okta server.
OAuth Configuration and Handler Enhancements
internal/oauth/handlers.go, internal/oauth/config.go, internal/oauth/metadata.go
Adds MCPURL field to OAuth2Config, a getter method for config, refactors OAuth metadata handlers to use centralized MCPURL for constructing URLs, removes some debug logging, and adjusts formatting and logging styles.
MCP Server Improvements
internal/mcp/server.go
Updates logging to include client addresses, uses OAuth handler config URLs for OAuth metadata and callback endpoints, and cleans up formatting and whitespace.
Internal Code Formatting Cleanup
internal/mcp/handlers.go
Removes trailing whitespace and blank lines without changing logic or behavior.
README Documentation Update
README.md
Documents new MCP_URL environment variable for configuring the MCP server public URL, including usage notes and example environment variables.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant MCP_Server
    participant Okta_Server

    Client->>MCP_Server: Request resource without token
    MCP_Server->>Client: 401 Unauthorized with OAuth URL
    Client->>MCP_Server: Request OAuth URL
    MCP_Server->>Client: Redirect to Okta OAuth URL
    Client->>Okta_Server: OAuth authorization request
    Okta_Server->>MCP_Server: Callback with authorization code
    MCP_Server->>Client: Proxy OAuth callback response
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇
A hop, a skip, a chart to send,
Helm and Docker now ascend.
Lowercase names, a tidy touch,
Workflows polished, not too much.
OAuth flows with URLs bright,
Logs and docs now shine with light.
From /root/ to /app we leap—
In CI gardens, changes keep!
🌱✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🔭 Outside diff range comments (1)
Dockerfile (1)

30-55: Final stage should switch to scratch instead of alpine:latest.

Internal guideline for every Dockerfile in this repo: “The Docker build must use a multi-stage build with a scratch base image for minimal size.”
Keeping alpine:latest (plus ca-certificates) increases the image by ~6-7 MB and violates that rule.

-FROM --platform=$TARGETPLATFORM alpine:latest
-RUN apk --no-cache add ca-certificates
+FROM --platform=$TARGETPLATFORM scratch
+# Copy minimal cert bundle produced in builder stage (adds <300 kB)
+COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

After switching to scratch, ensure the binary is built with CGO_ENABLED=0 (already done) and no other shared libs are required.

🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

89-92: Environment variable created via $GITHUB_ENV cannot be used in expressions of the same step.

Here you append IMAGE_NAME to $GITHUB_ENV, which only becomes available to later steps.

No problem now (you use it later), but consider defining it once in the env: block of the job to avoid an extra step:

env:
  IMAGE_NAME: ${{ github.repository && toLower(github.repository) }}

This keeps the job log cleaner and prevents accidental use inside the same step.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b71ad7e and b380876.

📒 Files selected for processing (3)
  • .github/workflows/push-helm-chart.yml (1 hunks)
  • .github/workflows/release.yml (3 hunks)
  • Dockerfile (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
Dockerfile

📄 CodeRabbit Inference Engine (CLAUDE.md)

The Docker build must use a multi-stage build with a scratch base image for minimal size.

Files:

  • Dockerfile
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Docker images must be published to GHCR as part of the build/release process.
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Multi-platform builds must be performed via GoReleaser as part of the build/release process.
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Automated releases must be triggered on main branch pushes in the CI pipeline.
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Go mod tidy must be run and verified as part of the CI pipeline.
📚 Learning: applies to dockerfile : the docker build must use a multi-stage build with a scratch base image for ...
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to Dockerfile : The Docker build must use a multi-stage build with a scratch base image for minimal size.

Applied to files:

  • Dockerfile
  • .github/workflows/release.yml
📚 Learning: applies to .github/workflows/build.yml : docker images must be published to ghcr as part of the buil...
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Docker images must be published to GHCR as part of the build/release process.

Applied to files:

  • .github/workflows/release.yml
  • .github/workflows/push-helm-chart.yml
📚 Learning: applies to .github/workflows/build.yml : multi-platform builds must be performed via goreleaser as p...
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Multi-platform builds must be performed via GoReleaser as part of the build/release process.

Applied to files:

  • .github/workflows/release.yml
  • .github/workflows/push-helm-chart.yml
📚 Learning: applies to .github/workflows/build.yml : automated releases must be triggered on main branch pushes ...
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Automated releases must be triggered on main branch pushes in the CI pipeline.

Applied to files:

  • .github/workflows/release.yml
  • .github/workflows/push-helm-chart.yml
📚 Learning: applies to .github/workflows/build.yml : slsa provenance generation must be included for supply chai...
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : SLSA provenance generation must be included for supply chain security in the CI pipeline.

Applied to files:

  • .github/workflows/release.yml
📚 Learning: applies to .github/workflows/build.yml : dependency verification must be performed in the ci pipelin...
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Dependency verification must be performed in the CI pipeline.

Applied to files:

  • .github/workflows/release.yml
📚 Learning: applies to .github/workflows/build.yml : sbom generation with spdx format must be included in the ci...
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : SBOM generation with SPDX format must be included in the CI pipeline.

Applied to files:

  • .github/workflows/release.yml
📚 Learning: applies to .github/workflows/build.yml : code coverage must be collected with atomic mode and upload...
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Code coverage must be collected with atomic mode and uploaded to Codecov in the CI pipeline.

Applied to files:

  • .github/workflows/release.yml
🔇 Additional comments (2)
Dockerfile (1)

35-38: Change to /app looks good but remember to update health-check paths in Helm chart.

Moving the working directory from /root to /app is fine.
Double-check any readiness/liveness probes or docker exec instructions that may still assume /root.

.github/workflows/release.yml (1)

102-108: Confirm that ${{ env.IMAGE_NAME }} is populated at this point.

Because IMAGE_NAME is injected by the previous step, it should be available here, but any typo (step skipped, conditional false) will break cache references and the build will silently fall back to the remote layer cache.

Please re-run the workflow once to verify that:

Buildx build context ...
INFO    Using cache mount: ghcr.io/<repo-lower>:cache

appears in the log.

Comment on lines +31 to +35
- name: Set up OCI Helper
run: |
echo "Installing Helm plugins..."
helm plugin install https://github.com/chartmuseum/helm-push || true

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Chartmuseum plugin is unnecessary and may fail for OCI without HELM_EXPERIMENTAL_OCI.

Helm ≥ 3.8 includes native OCI push support via
helm chart push … – the extra plugin adds complexity and still needs:

export HELM_EXPERIMENTAL_OCI=1

Proposed simplification:

-helm plugin install https://github.com/chartmuseum/helm-push || true
+echo "Using built-in OCI push (no plugin needed)"

and later replace helm push with helm chart push.

🤖 Prompt for AI Agents
In .github/workflows/push-helm-chart.yml around lines 31 to 35, the current
setup installs the Chartmuseum Helm plugin which is unnecessary for Helm
versions 3.8 and above because they support native OCI push commands. Remove the
plugin installation step and update subsequent commands to use `helm chart push`
instead of `helm push`. Also, ensure that the environment variable
`HELM_EXPERIMENTAL_OCI` is not required or set, simplifying the workflow and
avoiding potential failures.

Comment on lines +61 to +71
- name: Push Helm Chart to GHCR
run: |
PACKAGE_NAME=$(ls .cr-release-packages/mcp-trino-*.tgz)
PACKAGE_VERSION=$(basename $PACKAGE_NAME | sed 's/mcp-trino-\(.*\)\.tgz/\1/')
echo "Publishing Helm chart $PACKAGE_NAME (version $PACKAGE_VERSION) to GHCR..."

# Push using Helm OCI
echo "Pushing to OCI registry..."
helm push $PACKAGE_NAME oci://ghcr.io/${{ env.REPO_LOWER }}/charts

echo "Helm chart published to ghcr.io/${{ env.REPO_LOWER }}/charts/mcp-trino:$PACKAGE_VERSION"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Switch to native helm chart push and add a registry login to guarantee auth.

-helm push $PACKAGE_NAME oci://ghcr.io/${{ env.REPO_LOWER }}/charts
+helm registry login ghcr.io -u "${{ github.actor }}" -p "${{ secrets.GITHUB_TOKEN }}"
+helm chart push $PACKAGE_NAME oci://ghcr.io/${{ env.REPO_LOWER }}/charts

This removes the experimental plugin dependency and works with current Helm releases.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Push Helm Chart to GHCR
run: |
PACKAGE_NAME=$(ls .cr-release-packages/mcp-trino-*.tgz)
PACKAGE_VERSION=$(basename $PACKAGE_NAME | sed 's/mcp-trino-\(.*\)\.tgz/\1/')
echo "Publishing Helm chart $PACKAGE_NAME (version $PACKAGE_VERSION) to GHCR..."
# Push using Helm OCI
echo "Pushing to OCI registry..."
helm push $PACKAGE_NAME oci://ghcr.io/${{ env.REPO_LOWER }}/charts
echo "Helm chart published to ghcr.io/${{ env.REPO_LOWER }}/charts/mcp-trino:$PACKAGE_VERSION"
- name: Push Helm Chart to GHCR
run: |
PACKAGE_NAME=$(ls .cr-release-packages/mcp-trino-*.tgz)
PACKAGE_VERSION=$(basename $PACKAGE_NAME | sed 's/mcp-trino-\(.*\)\.tgz/\1/')
echo "Publishing Helm chart $PACKAGE_NAME (version $PACKAGE_VERSION) to GHCR..."
# Push using Helm OCI
echo "Pushing to OCI registry..."
helm registry login ghcr.io -u "${{ github.actor }}" -p "${{ secrets.GITHUB_TOKEN }}"
helm chart push $PACKAGE_NAME oci://ghcr.io/${{ env.REPO_LOWER }}/charts
echo "Helm chart published to ghcr.io/${{ env.REPO_LOWER }}/charts/mcp-trino:$PACKAGE_VERSION"
🤖 Prompt for AI Agents
In .github/workflows/push-helm-chart.yml around lines 61 to 71, replace the
current helm push command that uses the experimental plugin with the native
'helm chart push' command. Additionally, add a step before pushing to perform a
'helm registry login' to GHCR using appropriate credentials to ensure
authentication. This change removes the dependency on the experimental plugin
and aligns with current Helm release capabilities.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
charts/mcp-trino/values.yaml (1)

32-36: Keep ALB example comments at the same indentation level for clarity

The ALB-related examples are indented two spaces deeper than the surrounding keys, which visually implies they belong inside the empty annotations map. Flattening them avoids that confusion and keeps the file consistent.

-  # annotations for ALB ingress controller
-    # kubernetes.io/ingress.class: alb
-    # alb.ingress.kubernetes.io/scheme: internal
-    # alb.ingress.kubernetes.io/target-type: ip
+  # Example ALB ingress annotations:
+  # kubernetes.io/ingress.class: alb
+  # alb.ingress.kubernetes.io/scheme: internal
+  # alb.ingress.kubernetes.io/target-type: ip
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b380876 and d0c1d6e.

📒 Files selected for processing (1)
  • charts/mcp-trino/values.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Docker images must be published to GHCR as part of the build/release process.
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Multi-platform builds must be performed via GoReleaser as part of the build/release process.
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Automated releases must be triggered on main branch pushes in the CI pipeline.
🔇 Additional comments (1)
charts/mcp-trino/values.yaml (1)

32-36: Confirm the chart version was bumped

The push-to-OCI workflow will publish the version declared in Chart.yaml. If that version was not incremented, you’ll overwrite the existing artifact in GHCR and break any consumers relying on immutable tags. Please ensure charts/mcp-trino/Chart.yaml has its version (and, if applicable, appVersion) bumped in this PR.

* PE-7208: Support hostname in MCP URL

Signed-off-by: Yang Wang <wyangsun@163.com>

* Update oauth.md

Signed-off-by: Yang Wang <wyangsun@163.com>

* Update oauth.md

Signed-off-by: Yang Wang <wyangsun@163.com>

---------

Signed-off-by: Yang Wang <wyangsun@163.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0c1d6e and 3593191.

📒 Files selected for processing (7)
  • README.md (2 hunks)
  • docs/oauth.md (1 hunks)
  • internal/mcp/handlers.go (6 hunks)
  • internal/mcp/server.go (11 hunks)
  • internal/oauth/config.go (1 hunks)
  • internal/oauth/handlers.go (21 hunks)
  • internal/oauth/metadata.go (7 hunks)
✅ Files skipped from review due to trivial changes (5)
  • internal/oauth/config.go
  • internal/mcp/handlers.go
  • docs/oauth.md
  • internal/mcp/server.go
  • internal/oauth/handlers.go
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to .github/workflows/build.yml : Docker images must be published to GHCR as part of the build/release process.
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Distribution must include GitHub Releases, GHCR, and Homebrew tap (tuannvm/mcp).
📚 Learning: 2025-07-25T23:51:10.585Z
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to internal/handlers/trino_handlers.go : All MCP tool endpoints must handle parameter validation and error handling consistently.

Applied to files:

  • internal/oauth/metadata.go
  • README.md
📚 Learning: 2025-07-25T23:51:10.585Z
Learnt from: CR
PR: tuannvm/mcp-trino#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-25T23:51:10.585Z
Learning: Applies to internal/handlers/trino_handlers.go : All MCP tool endpoints (execute_query, list_catalogs, list_schemas, list_tables, get_table_schema) must return JSON-formatted responses and handle parameter validation.

Applied to files:

  • README.md
🪛 markdownlint-cli2 (0.17.2)
README.md

876-876: Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (6)
internal/oauth/metadata.go (3)

85-89: Excellent URL construction refactor.

The consistent use of h.config.MCPURL for all OAuth endpoints ensures proper URL generation for remote deployments and improves maintainability by centralizing URL construction logic.

Also applies to: 94-94


117-118: Consistent URL construction implementation.

The refactoring to use h.config.MCPURL maintains consistency across all protected resource metadata endpoints and supports proper remote deployment configuration.

Also applies to: 121-124


154-162: Clean formatting improvements.

The alignment and formatting changes improve code readability while maintaining all existing functionality.

README.md (3)

710-710: Essential documentation for remote deployments.

This addition clearly explains when MCP_URL is required and why it's important for OAuth metadata and client discovery. This directly supports the code changes that centralize URL construction.


718-718: Helpful production deployment example.

Adding MCP_URL to the production deployment example provides clear guidance for users configuring remote MCP servers.


876-876: Complete configuration documentation.

The addition of MCP_URL to the configuration table provides users with clear information about the variable's purpose and default value, supporting the centralized URL configuration approach.

"supported_flows": []string{"claude_code", "mcp_remote"},
"mcp_version": "1.0.0",
"server_version": h.config.Version,
"provider": h.config.Provider,
"authorization_endpoint": fmt.Sprintf("%s://%s:%s/oauth/authorize", h.config.Scheme, h.config.MCPHost, h.config.MCPPort),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Inconsistent URL construction in metadata endpoint.

While other metadata endpoints have been updated to use h.config.MCPURL, this authorization endpoint still uses manual URL construction. This could lead to inconsistent URLs being returned by different metadata endpoints.

Apply this diff to maintain consistency:

-		"authorization_endpoint": fmt.Sprintf("%s://%s:%s/oauth/authorize", h.config.Scheme, h.config.MCPHost, h.config.MCPPort),
+		"authorization_endpoint": fmt.Sprintf("%s/oauth/authorize", h.config.MCPURL),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"authorization_endpoint": fmt.Sprintf("%s://%s:%s/oauth/authorize", h.config.Scheme, h.config.MCPHost, h.config.MCPPort),
"authorization_endpoint": fmt.Sprintf("%s/oauth/authorize", h.config.MCPURL),
🤖 Prompt for AI Agents
In internal/oauth/metadata.go at line 42, the authorization_endpoint URL is
manually constructed using scheme, host, and port, unlike other metadata
endpoints that use h.config.MCPURL. To fix this inconsistency, replace the
manual URL construction with h.config.MCPURL concatenated with
"/oauth/authorize" to ensure all metadata endpoints use the same base URL
format.

Copy link
Owner

@tuannvm tuannvm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tuannvm tuannvm merged commit 5d05cea into tuannvm:main Aug 11, 2025
3 checks passed
tommynguyen-vungle pushed a commit to Vungle/mcp-trino that referenced this pull request Aug 19, 2025
* PE-7046: Deploy Trino MCP Server

* PE-7046: Fix workflow

* PE-7046: Fix workflow

* PE-7046: Fix workflow

* remove default annotations for ALB ingress controller

* PE-7208: Support hostname in MCP URL (#3)

* PE-7208: Support hostname in MCP URL

Signed-off-by: Yang Wang <wyangsun@163.com>

* Update oauth.md

Signed-off-by: Yang Wang <wyangsun@163.com>

* Update oauth.md

Signed-off-by: Yang Wang <wyangsun@163.com>

---------

Signed-off-by: Yang Wang <wyangsun@163.com>

---------

Signed-off-by: Yang Wang <wyangsun@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants