-
Notifications
You must be signed in to change notification settings - Fork 0
feat(kong-mcp): add MCP OAuth gateway plugin for Kong #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fa18cc3
feat(kong-mcp): add MCP OAuth gateway plugin for Kong
appleboy 5c25762
fix(kong-mcp): harden and simplify plugin from review
appleboy af125ba
fix(kong-mcp): declare non-root USER in Dockerfile
appleboy f9ccd7c
fix(kong-mcp): harden RFC compliance and JWKS failure handling
appleboy c0f4020
fix(kong-mcp): add HEALTHCHECK to Dockerfile
appleboy 6969c58
fix(kong-mcp): fail closed on PDK errors and reject duplicate Authori…
appleboy ecaed4a
docs(kong-mcp): add macOS hands-on install and verification guide
appleboy 3ee2f57
docs(kong-mcp): add real-AuthGate config and hands-on section
appleboy 8459a87
fix(kong-mcp): reject non-access tokens and harden config validation
appleboy 668eede
fix(kong-mcp): harden plugin config and fix demo from review
appleboy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Keep the image build context to the Go sources: editing docs or the | ||
| # runtime-mounted kong.yml must not invalidate the build cache. | ||
| *.md | ||
| kong.yml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| .dockerignore | ||
| mcp-authgate | ||
| kong-mcp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Build the Go plugin as a standalone pluginserver binary, then bake it into the | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| # Kong image. go-pdk plugins are ordinary executables that speak the Kong | ||
| # pluginserver RPC protocol over stdio — no cgo, no .so loading. | ||
| # | ||
| # Pin the binary to the FINAL image's architecture. Under BuildKit, TARGETOS / | ||
| # TARGETARCH are populated (e.g. by `docker build --platform`) and the binary | ||
| # cross-compiles to that target, matching the kong image it lands in. Under the | ||
| # classic builder they are empty, and an empty GOOS/GOARCH means "use the native | ||
| # default" — which is also the daemon's arch, so both stages still agree. Either | ||
| # way the binary's arch matches the kong container. A mismatch would make the | ||
| # pluginserver fail with `exec format error` and emit *nothing* on stdout, and | ||
| # Kong would die at init with `failed decoding plugin info: Expected value but | ||
| # found T_END at character 1` (an empty `-dump`). | ||
| FROM golang:1.26 AS build | ||
| ARG TARGETOS | ||
| ARG TARGETARCH | ||
| WORKDIR /src | ||
| COPY go.mod go.sum ./ | ||
| RUN go mod download | ||
| COPY . . | ||
| RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \ | ||
| go build -trimpath -ldflags="-s -w" -o /mcp-authgate . | ||
|
|
||
| FROM kong:3.9 | ||
| COPY --from=build /mcp-authgate /usr/local/bin/mcp-authgate | ||
| USER kong | ||
| HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ | ||
| CMD kong health | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Docs] 「All examples」的環境變數說明對 kong-mcp 不成立
kong-mcp 不讀任何環境變數、也不載入
.env——設定全在kong.yml的 plugin block(issuer、gateway_origin、jwks_uri...)。使用者照本節 exportAUTHGATE_URL/CLIENT_ID或寫kong-mcp/.env完全不會生效,且沒有任何訊息把他導向kong.yml。修法(本 commit):本行與下方
.env載入說明各加上 kong-mcp 例外。