Skip to main content
Glama

MCP Redirect Server

by marcos2872

MCP Redirect Server

Servidor MCP (Model Context Protocol) construído com NestJS e autenticação OAuth integrada.

🚀 Características

  • 🔐 Autenticação OAuth 2.1 com GitHub

  • 🛠️ MCP Tools - Exponha métodos como ferramentas MCP

  • 📡 SSE Transport - Server-Sent Events para comunicação em tempo real

  • 🔒 Guard-based Security - Proteção de rotas com JWT

  • 💉 Dependency Injection - Sistema DI completo do NestJS

📦 Instalação

pnpm install

⚙️ Configuração

1. Criar GitHub OAuth App

  1. Acesse: https://github.com/settings/developers

  2. Clique em "New OAuth App"

  3. Preencha:

    • Application name: mcp-redirect-server

    • Homepage URL: http://localhost:3000

    • Authorization callback URL: http://localhost:3000/auth/callback

  4. Copie o Client ID e Client Secret

2. Configurar variáveis de ambiente

Crie um arquivo .env baseado no .env.example:

cp .env.example .env

Edite o .env e adicione suas credenciais:

# OAuth Provider (GitHub) GITHUB_CLIENT_ID=seu_client_id_aqui GITHUB_CLIENT_SECRET=seu_client_secret_aqui # JWT Configuration (mínimo 32 caracteres) JWT_SECRET=my-super-secure-jwt-secret-key-with-at-least-32-characters # Server Configuration SERVER_URL=http://localhost:3000 RESOURCE_URL=http://localhost:3000/sse # Port PORT=3000

🏃 Executar o projeto

# desenvolvimento pnpm run start:dev # produção pnpm run start:prod

O servidor estará disponível em: http://localhost:3000

🔌 Endpoints OAuth

  • GET /.well-known/oauth-authorization-server - Metadata do servidor OAuth (RFC 8414)

  • GET /.well-known/oauth-protected-resource - Metadata MCP (RFC 9728)

  • POST /auth/register - Registro dinâmico de cliente (RFC 7591)

  • GET /auth/authorize - Endpoint de autorização

  • GET /auth/callback - Callback OAuth

  • POST /auth/token - Endpoint de token

  • POST /auth/revoke - Revogação de token

🧪 Testar com MCP Inspector

MCP Inspector

  1. npx @modelcontextprotocol/nspector
  2. Configure o Inspector:

    • Transport Type: SSE

    • URL: http://localhost:3000/sse

    • Connection Type: Via Proxy

  3. Clique em Authentication para configurar OAuth

  4. Clique em Connect

🛠️ Tools Disponíveis

  • tool

📚 Documentação

📝 Licença

MIT licensed

Description

Nest framework TypeScript starter repository.

Project setup

$ pnpm install

Compile and run the project

# development $ pnpm run start # watch mode $ pnpm run start:dev # production mode $ pnpm run start:prod

Deployment

When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the deployment documentation for more information.

If you are looking for a cloud-based platform to deploy your NestJS application, check out Mau, our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:

$ pnpm install -g @nestjs/mau $ mau deploy

With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.

Resources

Check out a few resources that may come in handy when working with NestJS:

  • Visit the NestJS Documentation to learn more about the framework.

  • For questions and support, please visit our Discord channel.

  • To dive deeper and get more hands-on experience, check out our official video courses.

  • Deploy your application to AWS with the help of NestJS Mau in just a few clicks.

  • Visualize your application graph and interact with the NestJS application in real-time using NestJS Devtools.

  • Need help with your project (part-time to full-time)? Check out our official enterprise support.

  • To stay in the loop and get updates, follow us on X and LinkedIn.

  • Looking for a job, or have a job to offer? Check out our official Jobs board.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

A Model Context Protocol server built with NestJS that provides OAuth 2.1 authentication with GitHub and exposes MCP tools through Server-Sent Events transport. Enables secure, real-time communication with JWT-based protection and dependency injection.

  1. 🚀 Características
    1. 📦 Instalação
      1. ⚙️ Configuração
        1. 1. Criar GitHub OAuth App
        2. 2. Configurar variáveis de ambiente
      2. 🏃 Executar o projeto
        1. 🔌 Endpoints OAuth
          1. 🧪 Testar com MCP Inspector
            1. MCP Inspector
              1. 🛠️ Tools Disponíveis
                1. 📚 Documentação
                  1. 📝 Licença
                    1. Description
                      1. Project setup
                        1. Compile and run the project
                          1. Deployment
                            1. Resources
                              1. Support
                                1. Stay in touch
                                  1. License

                                    MCP directory API

                                    We provide all the information about MCP servers via our MCP API.

                                    curl -X GET 'https://glama.ai/api/mcp/v1/servers/marcos2872/mcp-redirect-server'

                                    If you have feedback or need assistance with the MCP directory API, please join our Discord server