{
"mcpServers": {
"go-mcp-server-example": {
"command": "<see-readme>",
"args": []
}
}
}No install config available. Check the server's README for setup instructions.
Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Sample implementation of a Model Context Protocol (MCP) server protected by OAuth 2.1, written in Go.
Is it safe?
No package registry to scan.
No authentication — any process on your machine can connect.
MIT. View license →
Is it maintained?
Last commit 43 days ago. 2 stars.
Will it work with my client?
Transport: http. Compatibility not confirmed.
Context cost
1 tool.
No automated test available for this server. Check the GitHub README for setup instructions.
No known vulnerabilities.
echoSimple MCP tool that returns the input message
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Persistent memory using a knowledge graph
Privacy-first. MCP is the protocol for tool access. We're the virtualization layer for context.
Pre-build reality check. Scans GitHub, HN, npm, PyPI, Product Hunt — returns 0-100 signal.
Monitor browser logs directly from Cursor and other MCP compatible IDEs.
MCP Security Weekly
Get CVE alerts and security updates for Go Mcp Server Example and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
Sample implementation of a Model Context Protocol (MCP) server protected by OAuth 2.1, written in Go.
This project demonstrates how to implement an MCP server with OAuth protection using the MCP Go SDK and Keycloak as the authorization server.
OAuth 2.1 Flow (DCR, Authorization Code)
┌───────────────────────────────────────────────────────────┐
│ │
│ ▼
┌───┴─────────┐ HTTP + Bearer Token ┌─────────────┐ ┌───────────────┐
│ MCP Client │────────────────────────►│ MCP Server │ │ Keycloak │
│ (Inspector) │ │ (This repo) │ │ (AuthZ Server)│
└─────────────┘ └─────────────┘ └───────────────┘
│ │
│◄──────────────────┘
│ JWKS (RS256 Public Key)
│
▼
JWT Access Token Validation:
• Signature verification
• iss, exp, aud claims
• scope claim
cd authz-server
docker-compose up -d
Keycloak will be available at http://localhost (admin/admin).
demomcp:tools:
Onaudience-confighttp://localhost:8000mcp:toolsgo run . \
-authz-server-url="http://localhost/realms/demo" \
-jwks-url="http://localhost/realms/demo/protocol/openid-connect/certs" \
-resource-url="http://localhost:8000"
Run MCP Inspector and connect to http://localhost:8000.
The MCP Inspector will:
http://localhost:8000/.well-known/oauth-protected-resource.
├── authz-server/ # Keycloak setup
│ ├── docker-compose.yml
│ └── nginx.conf
├── main.go # MCP server implementation
├── oauth_middleware.go # OAuth middleware & JWT Access Token validation
└── README.md
The server exposes metadata at /.well-known/oauth-protected-resource:
{
"resource": "http://localhost:8000",
"authorization_servers": ["http://localhost/realms/demo"],
"scopes_supported": ["mcp:tools"]
}
The middleware validates: