MCP Server Reference Implementation
LocalAbout MCP Server Reference Implementation
A TypeScript reference implementation of draft MCP authorization-spec updates, intended for developers testing OAuth-based authorization flows. It supports Cognito and self-hosted Keycloak providers and validates the `mcp:access` scope.
Key features
- 01Draft authorization spec implementation
- 02Cognito and Keycloak providers
- 03`mcp:access` scope validation
- 04TypeScript SDK based
Use cases
- 01Testing MCP authorization flows
- 02Configuring Cognito-backed resource servers
- 03Experimenting with Keycloak authentication
MCP support
Implements a reference MCP server for the draft authorization specification, including authorization-server discovery-related updates. MCP clients can use it to test authorized access.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Server Reference Implementation
This is a reference MCP Server implementation of the draft Authorization spec updates using the official typescript sdk.
This repo can be used with this Postman collection
Authentication Providers
There are two separate auth provider options:
- Cognito
- Keycloak (self-hosted)
We validate the scope: mcp:access, with <resource-id>/mcp:access. For example, https://mcp-server.com/mcp:access
Important Note
Keep in mind that OAuth 2.1 doesn't allow http protocol, so you will want to use ngrok with a static url (available for free from ngrok) to properly test this out.
If you want to use localhost without ngrok because you don't care, you can override the PORT and PROTOCOL env variables for the authorization and resource servers by setting them in .envs (check config folder if you're confused)
Setup with ngrok
-
Build and start the server:
npm i npm run build npm run start -
The MCP server will start on port 1335.
-
In another terminal, create the ngrok tunnel to the MCP server:
ngrok http --domain=<get-a-custom-domain-from-ngrok(free)-and-place-here> 1335 -
Configure this resource server in the
Domainstab of your AWS Cognito dashboard
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.