MCP Analytics with GitHub OAuth

by bighadj22

Not rated
GitHub

About

A remote MCP server with GitHub OAuth authentication and built-in analytics tracking.

Details

Author
bighadj22
Categories
Developer Tools, Security

Setup

Install MCP Analytics with GitHub OAuth in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/bighadj22/mcp-analytics-github-oauth

Follow the installation instructions in the repository README, then restart your MCP client.

A remote MCP server with GitHub OAuth authentication and built-in analytics tracking.

Model Context Protocol (MCP) Server + GitHub OAuth + Analytics

This is aModel Context Protocol (MCP)server that supports remote MCP connections, with GitHub OAuth authentication and built-in analytics tracking powered byMCP Analytics.

You can deploy it to your own Cloudflare account, and after you create your own GitHub OAuth client app, you'll have a fully functional remote MCP server with comprehensive analytics. Users will be able to connect to your MCP server by signing in with their GitHub account, and you'll get detailed insights into tool usage, performance, and user behavior.

- ✅GitHub OAuth Authentication- Secure user authentication via GitHub
- ✅Remote MCP Protocol- Full MCP server implementation
- ✅Analytics Tracking- Automatic tracking of tool usage, performance, and user metrics
- ✅Access Control- Role-based tool access based on GitHub usernames
- ✅Image Generation- AI-powered image generation for authorized users
- ✅Production Ready- Deployed on Cloudflare Workers with Durable Objects

- 📊Tool Usage- Which tools are used most frequently
- ⏱️Performance Metrics- Execution times and success rates
- 👥User Analytics- Active users and session data
- 🔧Error Tracking- Failed requests and error details
- 💰Revenue Tracking- Payment events (if using paid tools)

View your analytics at:https://mcpanalytics.dev

Clone the repo directly & install dependencies:

git clone <your-repo-url> cd mcp-github-oauth-analytics npm install

- Sign up athttps://mcpanalytics.dev
- Create a new project and get your API key
- Add the API key to your environment:

# For production wrangler secret put MCP_ANALYTICS_API_KEY # For local development (.dev.vars file) MCP_ANALYTICS_API_KEY=your_api_key_here

- Homepage URL:https://your-worker-name.your-subdomain.workers.dev
- Authorization callback URL:https://your-worker-name.your-subdomain.workers.dev/callback
- Note your Client ID and generate a Client secret

Create another GitHub OAuth App for development:

- Homepage URL:http://localhost:8788
- Authorization callback URL:http://localhost:8788/callback

# Create the KV namespace wrangler kv:namespace create "OAUTH_KV" # Update wrangler.toml with the returned KV ID

Edit theALLOWED_USERNAMESin your main file to control who can access the image generation tool:

const ALLOWED_USERNAMES = new Set<string>([ 'yourusername', 'teammate1', 'teammate2' ]);

Your MCP server will be available at:https://your-worker-name.your-subdomain.workers.dev/sse

npx @modelcontextprotocol/inspector@latest

Enter your server URL and test the authentication flow.
- Open Claude Desktop → Settings → Developer → Edit Config
- Add this configuration:

{ "mcpServers": { "github-mcp": { "command": "npx", "args": [ "mcp-remote", "https://your-worker-name.your-subdomain.workers.dev/sse" ] } } }

- Restart Claude Desktop and complete the OAuth flow
- Test with: "Could you use the math tool to add 23 and 19?"

Cursor: Use command format:npx mcp-remote https://your-worker-url/sse

Windsurf: Add the same JSON configuration as Claude Desktop

Simple math addition tool for testing connectivity.

AI-powered image generation using Cloudflare's Flux model.

Usage: "Generate an image of a sunset over mountains"

- prompt: Description of the image to generate
- steps: Quality steps (4-8, higher = better quality)

This server uses theAnalyticsMcpAgentwhich automatically tracks:

- ✅Tool Execution Times- How long each tool takes to run
- ✅Success/Failure Rates- Which tools work reliably
- ✅User Sessions- Who's using your server and when
- ✅Parameter Logging- What inputs users are providing (safely sanitized)
- ✅Error Details- Full error context for debugging
- ✅GitHub User Data- Email and username from OAuth (for user analytics)

Your server will be available athttp://localhost:8788/sse

The OAuth Provider library serves as a complete OAuth 2.1 server implementation, handling:

- MCP client authentication
- GitHub OAuth integration
- Token management and validation
- Secure state storage in Cloudflare KV

TheAnalyticsMcpAgentextends the base MCP functionality with:

- Automatic event tracking for all tool calls
- User identification via OAuth props
- Performance monitoring and error tracking
- Safe parameter and result logging

Provides persistent state management with:

- User session continuity
- Authentication context preservation
- Scalable real-time connections

- 🔒OAuth 2.1- Industry standard authentication
- 🔐Encrypted Tokens- All auth data encrypted in transit and storage
- 🛡️Access Control- Fine-grained permissions per GitHub user
- 🧹Data Sanitization- Sensitive data automatically redacted from logs
- ⏰Token Expiration- Automatic token refresh and expiration

"Invalid API key" in analytics: Verify yourMCP_ANALYTICS_API_KEYis set correctly

OAuth callback errors: Ensure your GitHub OAuth app URLs match your deployment URLs exactly

Tools not appearing: Check that the user's GitHub username is inALLOWED_USERNAMESfor restricted tools

Connection timeouts: Verify your Worker is deployed and responding at the correct URL

- 📖MCP Analytics Docs:https://docs.mcpanalytics.dev
- 💬GitHub Issues: For bugs and feature requests
- 📧Email Support: Available for Pro plan users

MIT License - see LICENSE file for details.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Model Context Protocol server for Skycloak managed Keycloak. Manage clusters, realms, applications, SSO and users from any MCP client.

The first MCP server governed by ICA. A remote streamable HTTP server at https://mcp.aleeth.com/mcp with 37 governed tools: every call is risk-checked by Rail Guard before it runs and sealed with a signed Ed25519 receipt on a hash-chained public ledger anchored to Bitcoin. Fails closed: no receipt, no response. OAuth 2.0 with RFC 9728 discovery; anonymous requests get 401. This repository is the public interface and provenance record: a generated tool manifest with per-tool annotations, an SBOM and vulnerability scan with digested provenance, and a TRUST.md of verify-it-yourself commands. The implementation is private by design. Independent probe grade A from mcp-spec-check, re-verified 2026-07-24.

Turn any OpenAPI spec into a hosted MCP server in 30 seconds. One typed tool per endpoint, server-side auth injection, stable URL across spec updates. EU-hosted, GDPR-native.

Discover powerful AI agents, invoke them instantly, and verify every result with Ed25519 cryptographic proofs. Nine tools — five free, four billed — all protected by OAuth 2.1.

AI-safe approval plan gated Kubernetes operations through MCP with OAuth, RBAC, audit, guardrails.

A local MCP server that breaks on demand. Test your client against auth failures, disappearing tools, flaky responses, and token expiry, all from a web UI.

An MCP server with built-in GitHub OAuth support, deployable on Cloudflare Workers.

An MCP server with built-in GitHub OAuth support, designed for deployment on Cloudflare Workers.

Hosted mock-API MCP server: agents create live REST/GraphQL mock APIs, import OpenAPI/CSV/db.json, seed fake data, query and write records — free, no auth, stateless Streamable HTTP.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.