mcp-server-blog
Example of a MCP implementation using TypeScript and OAuth.
Install / Use
claude mcp add portal-labs-infrastructure -- npx -y github:portal-labs-infrastructure/mcp-server-blogIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
Content & MediaSupported Platforms
Tags
Our assessment of mcp-server-blog
mcp-server-blog scores 65/100 on our quality scale, 1107th of 1,175 Content & Media skills we index.
Its MCP Server is 8.6 KB long, well organised into 14 sections with 2 code examples: a thorough specification that gives an agent plenty to work with.
It has 10 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 17 months ago. Expect some instructions to reference tool versions or APIs that have since changed.
- Our last check on 2026-09-21 found the source still online.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 68/100, with 3 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-25. Automated pattern scan on 2026-09-25. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
mcp-server-blog compared with similar skills
All 4 of these similar skills score higher than mcp-server-blog; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| mcp-server-blog (this skill)by portal-labs-infrastructure | 65 | 10 | 17mo ago | MCP Server |
| Agent-Reachby Panniantong | 100 | 109.5k | 1d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.0k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.8k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 98.7k | 1d ago | MCP Server |
Frequently asked questions
- How do I install mcp-server-blog?
- Run
claude mcp add portal-labs-infrastructure -- npx -y github:portal-labs-infrastructure/mcp-server-blog. The install tabs above show the steps for each supported agent. - Which AI agents does mcp-server-blog work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is mcp-server-blog safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 68/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is mcp-server-blog still maintained?
- The repository was last updated about 17 months ago. Expect some instructions to reference tool versions or APIs that have since changed.
Skill content
View source on GitHubMCP Server Demo: OAuth, TypeScript & Firestore Patterns
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.
Purpose
This repository is intended as a learning resource to:
- Demonstrate a practical implementation of an MCP server using the TypeScript MCP SDK.
- Illustrate how to integrate OAuth 2.0 for securing tool calls.
- Showcase patterns for managing workspace context and multi-tenancy.
- Provide examples of using Zod for schema definition and validation.
- Offer insights into structuring tools, using Higher-Order Components (HOCs) for common logic, and interacting with Firestore.
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.
Key Features & Patterns Demonstrated
- MCP TypeScript SDK Integration: Core server setup and tool registration.
- OAuth 2.0 Token Validation: Securely handling Bearer tokens (via the SDK middleware).
- Workspace Context Management:
- Explicit
workspace_idin tool arguments. withWorkspaceAccessHigher-Order Component (HOC) for authentication and workspace authorization.
- Explicit
- Firestore Integration:
- Fetching user data, OAuth token information (conceptual), and tool-specific data.
- Using Firestore emulators for local development and testing.
- Zod for Schemas & Validation: Defining input schemas for tools and leveraging Zod for runtime validation.
- Type-Safe Development: Leveraging TypeScript for robust code.
- Utility Functions: Examples of
fetchResourceListfor DRY data fetching. - Standardized Error Handling: Using
throw new Error()for clear error propagation. - Example Tool Structures: Basic tool definitions showcasing the patterns.
- Environment Variable Configuration: For database and OAuth settings.
Architectural Overview
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:
- Authenticating users.
- Issuing OAuth tokens (Access Tokens, Refresh Tokens).
- Managing OAuth clients (Dynamic Discovery).
This Resource Server then validates the tokens received from clients.
Prerequisites
- Node.js (v18.x or later recommended)
- npm or yarn
- Access to a Google Cloud Project with Firestore enabled OR Google Cloud SDK configured for Firestore Emulator.
- An existing OAuth 2.0 Authorization Server.
Getting Started
-
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.examplefile to a new file named.env:cp .env.example .envNow, edit
.envand 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 atImportant: 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.
Running the Server
- Development Mode (with Nodemon for auto-restarts):
npm run dev - Production Mode:
bash npm run build npm startThe server will typically start onhttp://localhost:8080(or the port specified in.env).
Running with Firestore Emulator
- Ensure Google Cloud SDK is installed and configured.
- Start the Firestore emulator in a separate terminal:
(Adjust port if needed and updategcloud emulators firestore start --host-port=localhost:8081FIRESTORE_EMULATOR_HOSTin.envor ensure your application automatically detects it viagcloudenvironment variables). - Run the MCP server as described above. It should connect to the emulator.
Key Patterns & Concepts Demonstrated in Code
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.- Each tool will have an
inputSchema(Zod) and ahandler. - Handlers will likely be wrapped with
withWorkspaceAccess.
- Each tool will have an
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., forEntityType,ResourceType).
Directory Structure
.
├── 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
└── ...
What This Demo Is (and Isn't)
- IS: A demonstration of server-side patterns for building a secure, multi-tenant MCP Resource Server.
- IS: A way to see TypeScript, Zod, Firestore, and OAuth concepts applied in an MCP context.
- IS NOT: A complete, production-ready OAuth Authorization Server (you need to provide that).
- IS NOT: A library or SDK to be directly consumed (it's an example application).
- IS NOT: Filled with complex business logic (tools are illustrative).
Contributing
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.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
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".
Related Skills
Agent-Reach
109.5kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
79.0kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
47.8kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Scrapling
98.7k🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
