Skip to main content
Glama
baseergroot

MCP Server with Clerk & Express

by baseergroot

MCP Server with Clerk & Express

A minimal example of an MCP server endpoint using Express and Clerk for authentication. At the moment, it only exposes a streamable http handler. It could be adapted to handle SSE as well if necessary though. The purpose of this example is to serve as a proof of concept!

Getting started

  • Make sure you're running Node.js >= 22.18 — the dev script runs TypeScript directly using Node's type stripping.

  • Run pnpm i to install dependencies.

  • Create a Clerk application, then toggle on the Dynamic client registration option in the OAuth applications page in the Clerk Dashboard.

  • Run cp .env.example .env and copy your Clerk API keys from the API keys page in the Clerk Dashboard into the .env file.

  • Run pnpm run dev to start the server.

  • You should be able to connect to it now from any client that supports the latest version of the MCP spec. A cursor configuration is provided as a test.

Connecting to the server

To test in cursor, for example, add the following config to your mcp config file:

"mcp-clerk-express": {
  "url": "http://localhost:3000/mcp"
}

HTTPS Setup (Optional)

By default, the server runs on HTTP only. To enable HTTPS for development (useful for testing with some clients), you'll need to generate locally trusted certificates:

  1. Install mkcert (if not already installed):

    # macOS
    brew install mkcert
    
    # Windows (using Chocolatey)
    choco install mkcert
    
    # Linux
    # See https://github.com/FiloSottile/mkcert#installation
  2. Setup local certificate authority:

    mkcert -install
  3. Generate certificates:

    mkcert localhost 127.0.0.1 ::1
    mkdir -p cert
    mv localhost+2*.pem cert/
  4. Restart the server - certificate files aren't watched, so stop and rerun pnpm run dev. On startup, the server detects the certificates and starts both HTTP (port 3000) and HTTPS (port 3001) servers.

The certificates are gitignored, so each developer needs to generate their own locally trusted certificates.

F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    A secure MCP server example that demonstrates how to deploy to Google Cloud Run with authentication and identity token protection. Serves as a tutorial template for building production-ready MCP servers in the cloud.
    Last updated
  • A
    license
    -
    quality
    D
    maintenance
    A minimal Express-based MCP server that exposes a weather tool through HTTP endpoints, demonstrating how to implement the Model Context Protocol with streamable HTTP transport.
    Last updated
    21
    ISC
  • A
    license
    -
    quality
    D
    maintenance
    A Next.js-based MCP server template that implements OAuth 2.1 authentication with support for both SSE and Streamable HTTP transports. Provides a reference implementation for building authenticated MCP servers that work with Claude, Cursor, VSCode, and other MCP clients.
    Last updated
    19
    6
    MIT

View all related MCP servers

Related MCP Connectors

  • Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.

  • MCP (Model Context Protocol) server for Appwrite

  • MCP server for interacting with the Supabase platform

View all MCP Connectors

Latest Blog Posts

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/baseergroot/express-mcp-example'

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