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

An example MCP server that demonstrates TypeScript SDK tool registration, OAuth 2.0 bearer token validation, workspace-scoped authorization, and Firestore-backed tool handlers.
Demo MCP Resource Server with OAuth, TypeScript, and Firestore is cataloged as an MCP server attributed to portal-labs-infrastructure. An example MCP server that demonstrates TypeScript SDK tool registration, OAuth 2.0 bearer token validation, workspace-scoped authorization, and Firestore-backed tool handlers. 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.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Demo MCP Resource Server with OAuth, TypeScript, and Firestore 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.
No. It is an MCP Resource Server demo that expects OAuth 2.0 Bearer tokens issued by a separate OAuth Authorization Server you provide.
No. It is an illustrative learning resource and example application, not a production-ready plug-and-play server or SDK.
A withWorkspaceAccess higher-order component uses the userId associated with the token and validates that the user can access the requested workspace_id before running the tool handler.
README.md · c1a0c62c46d3 · 采集于 2026-11-13 10:13:49 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
This repository provides a stripped-down, illustrative implementation of a Model Context Protocol (MCP) server. It showcases the architectural patterns, security considerations (OAuth 2.0), and development practices (TypeScript, Firestore, Zod) detailed in our accompanying article:
➡️ Read the full story: "Building a Production-Ready MCP Server with OAuth, TypeScript, and Our Battle Scars"
This demo focuses on the MCP Resource Server component and assumes you have a separate OAuth 2.0 Authorization Server.
Update: MCP SDK version 1.12.0 introduced the Authorization Server Metadata (/.well-known/oauth-authorization-server) support and removes the need to proxy the oauth calls through the MCP resource server.
This repository is intended as a learning resource to:
This is NOT a production-ready, plug-and-play server for all use cases. It omits specific business logic and assumes a pre-existing OAuth Authorization Server.
workspace_id in tool arguments.withWorkspaceAccess Higher-Order Component (HOC) for authentication and workspace authorization.fetchResourceList for DRY data fetching.throw new Error() for clear error propagation.This demo represents the MCP Resource Server. It expects OAuth 2.0 Bearer tokens issued by a separate OAuth Authorization Server.
[Client / LLM with MCP Client SDK]
|
| (HTTPS Request with Bearer Token)
v
[This MCP Resource Server (Node.js / TypeScript)]
| 1. MCP SDK Middleware (parses request, extracts token)
| 2. `withWorkspaceAccess` HOC
| a. Using the userId associated with the token
| b. Validates the user can access the workspace_id in the request
| 3. Tool Handler Execution (interacts with Firestore based on validated context)
|
v
[Google Firestore (Database)]
The OAuth Authorization Server (which you would provide or have existing) is responsible for:
This Resource Server then validates the tokens received from clients.
Clone the repository:
git clone https://github.com/portal-labs-infrastructure/mcp-server-blog
cd mcp-server-blog
Install dependencies:
npm install
# or
yarn install
Set up Environment Variables:
Copy the .env.example file to a new file named .env:
cp .env.example .env
Now, edit .env and fill in the required configuration values:
# Firestore Configuration
# If using Firestore Emulator, these might not all be strictly needed,
# but ensure your gcloud CLI is configured or provide necessary emulator host.
PROJECT_ID="your-gcp-project-id"
# FIRESTORE_EMULATOR_HOST="localhost:8081" # Uncomment if using emulator and not relying on gcloud config
# OAuth 2.0 Configuration (for this Resource Server to validate tokens)
# This depends on your OAuth Authorization Server's setup.
OAUTH_ISSUER_URL="https_your_auth_server_com"
# MCP Server Configuration
BASE_URL="http://localhost:8080" # URL this server is accessible at
Important: The OAuth configuration is crucial. This server needs to know how to validate tokens issued by your Authorization Server. Consult your Auth Server's documentation.
(Optional) Seed Firestore Data: If you have seed scripts or want to manually add some sample users, OAuth tokens (matching what your Auth server would issue), and workspace data to your Firestore instance/emulator, do so now. This will make testing the tools more meaningful.
npm run dev
bash npm run build npm start
The server will typically start on http://localhost:8080 (or the port specified in .env).gcloud emulators firestore start --host-port=localhost:8081
(Adjust port if needed and update FIRESTORE_EMULATOR_HOST in .env or ensure your application automatically detects it via gcloud environment variables).Look for these patterns in the src directory:
src/index.ts: Main MCP server setup.src/controllers/mcpController.ts: Tool registration and MCP controller handling incoming requests.src/services/: Service layer for handling Firestore interactions.src/tools/: Example tool definitions.
inputSchema (Zod) and a handler.withWorkspaceAccess.src/utils/withWorkspaceAccess.ts: The Higher-Order Component for workspace checks.src/utils/fetchResourceList.ts: Example of reusable data fetching utility.src/utils/types.ts: Shared TypeScript types and Zod schemas (e.g., for EntityType, ResourceType)..
├── src/
│ ├── tools/ # Tool definitions
│ │ ├── getAgentTool.ts
│ │ └── ...
│ ├── utils/ # Shared utilities, HOCs, types
│ │ ├── withWorkspaceAccess.ts
│ │ ├── types.ts
│ │ └── ...
│ ├── services/ # Interaction logic
│ │ ├── firestoreService.ts # Firestore interaction logic
│ │ └── ...
│ ├── config/ # Configuration loading
│ └── index.ts # Main server setup
├── .env.example # Example environment variables
├── .env # Your local environment variables (ignored by git)
├── package.json
├── tsconfig.json
└── ...
This is primarily a demo repository. However, if you find bugs or have suggestions for improving the clarity of the demonstrated patterns, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
This demo is heavily inspired by the experiences and patterns discussed in the article: "Building a Production-Ready MCP Server with OAuth, TypeScript, and Our Battle Scars".
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Demo MCP Resource Server with OAuth, TypeScript, and Firestore from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/mcp-server-blog)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

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

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

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