MCP Demo TypeScript: Local, SSE, Streamable HTTP and Authorized MCP Servers

MCP Demo TypeScript: Local, SSE, Streamable HTTP and Authorized MCP Servers

mcp-server-template-akoskm•by0itsuki0

A collection of TypeScript MCP server implementations (stdio, SSE, Streamable HTTP) and corresponding clients, including an OAuth2 authorization example with a resource server.

License: Not specified•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides a local stdio MCP server exposing a create-mcp-server-app tool that creates a new project with sample MCP server code in the desktop folder.
  • •Provides a remote SSE MCP server that supports multiple clients via SSEServerTransport.
  • •Provides a remote Streamable HTTP MCP server supporting client connections, messaging, standalone SSE, and tools including one that sends multiple messages with notifications.
  • •Provides a remote MCP resource server using StreamableHTTPServerTransport with OAuth2 authorization, protected resource metadata discovery, and JWT token validation.

BEST FOR

  • •Developers learning how to set up MCP servers and hosts across stdio, SSE, and Streamable HTTP transports.
  • •Developers implementing MCP authorization with separate Authorization Server and Resource Server roles.

ABOUT MCP-SERVER-TEMPLATE-AKOSKM

MCP Demo TypeScript: Local, SSE, Streamable HTTP and Authorized MCP Servers is cataloged as an MCP server attributed to 0itsuki0. A collection of TypeScript MCP server implementations (stdio, SSE, Streamable HTTP) and corresponding clients, including an OAuth2 authorization example with a resource server. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP Demo TypeScript: Local, SSE, Streamable HTTP and Authorized MCP Servers are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What does the local stdio MCP server do?

It exposes a create-mcp-server-app tool; running it creates a new MCP server project with sample code in the desktop folder.

What authorization-related features does the MCP Resource Server provide?

It provides a protected resource metadata discovery endpoint and requires authorization to access features such as connections, messaging, and tools; JWT tokens are validated based on RFC9068.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 348f3e346a98 · 采集于 2026-11-13 11:33:27 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Demo of Model Context Protocol

For more details, please refer to my article:

Table of Contents

Local MCP with stdio

Local MCP Server


An MCP server that exposes a create-mcp-server-app tool to MCP hosts.

By running this tool, either with Claude for Desktop or some other host, a new project for creating an MCP server with necessary set ups and sample code will be created in the desktop folder.

Sample Code will include the following.

  • creating a server instance
  • defining available tools
  • handling tools execution
  • starting the server

Set Up

  1. Run npm install to install necessary dependency
  2. Run npm run build to build the project
  3. build/index.js will the server path to set up in the MCP host

Test with Claude for desktop

  1. Download Claude for Desktop
  2. Open the configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json
    • If the file does not exist, create one with the same name
  3. Add server configuration
{
    "mcpServers": {
        "create-mcp-app": {
            "command": "node",
            "args": [
                "/absolute-path-to/build/index.js"
            ]
        }
    }
}
  1. Save the file and restart Claude for Desktop.
  2. Enter the prompt create a new mcp server project. You should see a sample MCP Server project created at desktop directory with some responses indicating the success.

Local Host with MCP Clients

An OpenAI-chatbot host that uses MCP clients to connect to MCP servers.

Set up

  1. Set up OPENAI_API_KEY in .env.
  2. Add MCP server configurations to connect the host in server-config.json.
{
    "some-server-name-1": {
        "command": "node",
        "args": [
            "/absolut-path-to-local-server-folder-1/build/index.js"
        ]
    },
    "some-server-name-2": {
        "command": "uv",
        "args": [
             "--directory",
            "/absolut-path-to-local-server-folder-2",
            "run",
            "main.py"
        ]
    }
}
  1. Run npm install to install necessary dependency
  2. Run npm run build to build the project
  3. Start client by running node build/index.js

Remote MCP with SSE

Remote MCP Server with SSE

An MCP server that is able to connect to multiple client with SSEServerTransport.

Set up

  1. Run npm install to install necessary dependency
  2. (Optional) Change the endpoint url. By default, the endpoint for connection will be /connect, and that for messaging will be /messages.
  3. Run npm run build to build the project
  4. Start server by running node build/index.js. This will start a localhost listenining to port 3000.

MCP Client for remote Server with SSE

An MCP client connect to remote server with SSEClientTransport.

Set up

  1. Run npm install to install necessary dependency
  2. (Optional) Change the server url. By default, it will use http://localhost:3000/connect.
  3. Run npm run build to build the project
  4. Start client by running node build/index.js.

Remote MCP with Streamable HTTP

Remote MCP Server with Streamable HTTP

An MCP server that is able to connect to multiple client with StreamableHTTPServerTransport.

Features

This server supports:

  • Basic functionalities, ie: Client establishing connections and sneding messages (or requests such as list tools, list resources, call tools and etc.) to the server and server responding.
  • Standalone SSE to open an SSE stream to support server-initiated messgaes
  • Tools
    • A regular tool that return a single response
    • A tool that sends multiple messages back to the client with notifications

Set up

  1. Run npm install to install necessary dependency
  2. (Optional) Change the endpoint url. By default, the endpoint will be /mcp.
  3. Run npm run build to build the project
  4. Start server by running node build/index.js. This will start a localhost listenining to port 3000.

MCP Client for remote Server with Streamable Http

An MCP client connect to remote server with SSEClientTransport.

Features

Upon start, the client will

  1. Connect to the server
  2. Set up notifications to receive update on Logging messages and tool changes
  3. List tools and call tools

Set up

  1. Run npm install to install necessary dependency
  2. (Optional) Change the server url. By default, it will use http://localhost:3000/mcp.
  3. Run npm run build to build the project
  4. Start client by running node build/index.js.

Remote MCP (Streamable HTTP) + Authorization

This demo is created conforming the new MCP Authorization specifciation where the Authorization Server and Resource server are seperated and the flow consists of four roles

  • End user
  • MCP Client
  • MCP Resource Server
  • Authorization Sever

Authorization Server

An OAuth2 authorization server with dynamic client registration implemented using the node-oauth/oauth2-server library.

NOTE: For simplification, instead of an actual database, runtime variables are used in the example to store code/token/user data.

Protocol Endpoints

Basic implementations for the following endpoints are provided conforming to the IETF specifications.

  • Authorization endpoint
    • on GET, shows a simple login form to collect user information that will POST to the same endpoint to start authorization flow.
  • Token endpoint (for both authorization code exchange and refresh token exchange)
  • Registration endpoint for dynamic client registration
  • Revocation endpoint for revoking access tokens and refresh tokens
  • /.well-known/oauth-authorization-server for Server Metadata discovery

Other Endpoints

  • Error endpoint to display errors related to client's redirect_uri

MCP Resource Server

A Remote MCP Resource Server using StreamableHTTPServerTransport.

Features

  • /.well-known/oauth-protected-resource end point for Protected Resource Metadata discovery
  • requires Authorization in order to access the following supported features.
    • Basic functionalities, ie: Client establishing connections and sneding messages (or requests such as list tools, list resources, call tools and etc.) to the server and server responding.
    • Tools
      • A regular tool that return a single response
      • A tool that sends multiple messages back to the client with notifications

Authorization (Token validation)

The access token required will be in the form of an JWT Token and the validation is performed by checking the signature, header, and payloads based on the specification(RFC9068).

Errors are handled based on Error Response specification using the WWW-Authenticate Response Header Field

MCP Client

An MCP client connect to remote server with StreamableHTTPClientTransport and providing an OAuthClientProvider to handle authorization as needed.

By using an OAuthClientProvider, the SDK will

  1. connect to the server with any existing access token from the provider (OAuthClientProvider.tokens) if there is any or try to connect without specifying any authorization parameters.
  2. If the access token has expired, and we try to connect or send messages to the server, for example, by calling listTools, the provider is used to refresh the token.
  3. If token refresh fails or no access token exists, and auth is required, OAuthClientProvider is then used to start the authorization flow and an UnauthorizedError will be thrown from connect or the function we used to send messages.

Internal authorization flow managed by OAuthClientProvider:

  1. call OAuthClientProvider.clientInformation to try to load any existing client id and secret
  2. If not exist and dynamic client registration is supported, try client registration and call OAuthClientProvider.saveClientInformation to save the registered client information
  3. Call OAuthClientProvider.redirectToAuthorization with the authorization url
  4. After we call transport.finishAuth with the authorization code, exchange the code for access token.

Features

Upon start, the client will

  1. Try to Connect to the server without existing authorization info
  2. Upon getting an UnauthorizedError and OAuthClientProvider.redirectToAuthorization called, start a local server to receive authorization call back and open the browser with the authorization url
  3. Wait for the user to log in to complete and receive authorization code (or error) within the callback
  4. Call StreamableHTTPClientTransport.finishAuth with the authorization code to have the SDK to exchange the code for an access token to
  5. Upon authorization finish, Reconnect and make some tools calls to confirm the the authorization is successful

A Little Additional

For those who want to manage authorization using other libraries, I have also included some sample code on how to perform the enitre authorization flow using openid-client.

Run the Example

SDK Set up

Since the current Typescript SDK is not supporting the authorization flow from the newest authorization specification yet, I have forked the repository and added some changes.

PS: I have created a PR for it if anyone is being super nice and wants to give it a review!

To test out the examples in this demo

  1. Download the auth-client branch of the fork
  2. In tsconfig, remove dist from exclude. Ie: "exclude": ["node_modules"]
  3. npm run build
  4. Use the build as the dependency

Environments

Change the following as needed in .env.

For Client ID Encryption & Decryption
  • CIPHER_KEY
  • CIPHER_IV
  • CIPHER_KEY_ENCODING
  • CIPHER_IV_ENCODING
For JWT Token signing
  • ACCESS_TOKEN_SIGN_ALGORITHM
  • ACCESS_TOKEN_SIGN_SECRET

Other Configurations

Change the following as needed in .

Auth Server
  • AUTHORIZATION_SERVER_PORT
  • AUTHORIZATION_SERVER_HOSTNAME
  • AUTHORIZATION_SERVER_PROTOCOL
  • OAUTH_ROUTER_ENDPOINT
  • AUTHORIZE_ENDPOINT
  • TOKEN_ENDPOINT
  • OTHER_ERROR_ENDPOINT
  • REVOCATION_ENDPOINT
  • REGISTRATION_ENDPOINT
  • AUTH_METHODS
  • GRANT_TYPES
  • MCP_SCOPE
  • RESPONSE_TYPES
  • CODE_CHALLENGE_METHODS
  • ACCESS_TOKEN_LIFETIME
  • REFRESH_TOKEN_LIFETIME
Resource Server
  • RESOURCE_SERVER_PORT
  • RESOURCE_SERVER_PROTOCOL
  • RESOURCE_SERVER_HOSTNAME
  • MCP_ENDPOINT
Client
  • CLIENT_SERVER_PORT
  • CLIENT_SERVER_HOSTNAME
  • CLIENT_SERVER_PROTOCOL
  • CLIENT_SERVER_CALLBACK_PATH

Full Example

Run npm run dev to

  • build the project
  • start the authorization server
  • add some dummy user data (the user that will be logged in to receive access token)
  • start the MCP Resource server
  • Run the MCP client
Console.log color
  • Red: Client
  • Blue: Authorization Server
  • Green: Resource Server

Authorization Server

Run npm run dev:as to

  • build the project
  • start the authorization server
  • add some dummy user data (the user that will be logged in to receive access token)

MCP Resource Server

Run npm run dev:rs to

  • build the project
  • start the MCP Resource server

MCP Client

Run npm run dev:client to

  • build the project
  • Run the MCP client

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP Demo TypeScript: Local, SSE, Streamable HTTP and Authorized MCP Servers from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-server-template-akoskm)

REPOSITORY STATS

GitHub Stars39
Forks12

GitHub API evidence checked 2026-11-13 13:11:32.351Z (UTC). Repository-level counts are shared by all components, not individual server installs. Open issues including pull requests: 0.

Last repository push (UTC):2025-04-29

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools