Token-Optimized MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Token-Optimized MCP ServerFetch and distill the content at https://example.com"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Token-Optimized MCP Server
A high-performance Model Context Protocol (MCP) server built with Node.js and TypeScript. This server is purpose-built to minimize LLM token consumption through YAML serialization, structural HTML-to-Markdown distillation, and pre-flight token counting via the BPE tokenizer.
Table of Contents
Related MCP server: stripfeed-mcp-server
Overview
Modern AI agents connected via MCP suffer from context window exhaustion when tool responses contain verbose JSON payloads or raw HTML. This server addresses the problem at the architecture layer:
Optimization Strategy | Token Reduction |
YAML serialization over JSON | ~40–48% |
HTML → structured Markdown | ~60–80% |
Pre-flight token gating | Prevents overflow |
All diagnostic logging is routed to stderr to preserve the JSON-RPC protocol integrity on stdout.
Available Tools
extract_web_content
Fetches a web page, strips HTML noise, and returns clean, semantically structured Markdown optimized for LLM consumption.
Parameter | Type | Required | Description |
|
| Yes | A valid URL to fetch and convert. |
Example input:
{
"url": "https://example.com"
}Returns: Token-efficient Markdown with preserved heading hierarchy, links, and tables. Token count is logged to stderr.
query_metrics_database
Queries an internal metrics database and returns the results serialized in YAML format to reduce token overhead by approximately 45% compared to equivalent JSON.
Parameter | Type | Required | Description |
|
| Yes | A natural-language or structured query string. |
Example input:
{
"query": "Show CPU and memory usage for the last hour"
}Returns: YAML-formatted metrics payload. If the response exceeds 8,000 tokens, a warning is emitted to stderr recommending semantic chunking.
Note: The metrics database initializes automatically as an in-memory instance on server startup. No external setup, schema migration, or configuration is required.
Prerequisites
Node.js v18.0.0 or higher
npm v9+ (bundled with Node.js 18+)
Verify your installation:
node --version # Must be >= 18.0.0
npm --versionInstallation
# Clone or navigate to the project directory
cd optimized-mcp-server
# Install all dependencies
npm installDependencies at a Glance
Package | Purpose |
| Official MCP server SDK |
| Runtime input schema validation |
| BPE token counting (OpenAI compatible) |
| High-fidelity HTML → Markdown conversion |
| Native Rust-binding Markdown converter |
| JSON → YAML serialization |
Building
Compile the TypeScript source to JavaScript:
npm run buildThe compiled output is written to the build/ directory.
Configuration
To connect this server to an MCP-compatible AI host, register it in the host's configuration file. Below are copy-pasteable templates for common hosts.
Claude Desktop
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"token-optimized-server": {
"command": "node",
"args": [
"/absolute/path/to/optimized-mcp-server/build/index.js"
]
}
}
}Important: Replace
/absolute/path/to/with the actual absolute path on your system. On Windows, use double backslashes (\\) or forward slashes (/) in JSON strings.
After saving, fully quit and restart Claude Desktop to re-initialize the JSON-RPC handshake.
VS Code / Antigravity IDE
Add the following to your MCP configuration file (typically mcp_config.json in your editor's settings directory):
{
"mcpServers": {
"token-optimized-server": {
"command": "node",
"args": [
"/absolute/path/to/optimized-mcp-server/build/index.js"
]
}
}
}Windows example:
"args": [ "C:\\Users\\YourName\\projects\\optimized-mcp-server\\build\\index.js" ]
Usage
Development Mode
Run the server directly from TypeScript source using tsx (no build step required):
npm run devProduction Mode
Build first, then start the compiled server:
npm run build
npm startMCP Inspector
The MCP Inspector provides a browser-based UI for testing tools, simulating LLM requests, and inspecting JSON-RPC messages — no API keys required.
npx @modelcontextprotocol/inspector node build/index.jsThis launches a local proxy and opens the Inspector UI in your default browser. Use it to:
Verify the protocol handshake completes successfully.
Execute
extract_web_contentwith a test URL.Execute
query_metrics_databaseand confirm YAML output.Monitor
stderrlogs for token counts and threshold warnings.
Project Structure
optimized-mcp-server/
├── src/
│ └── index.ts # Core server implementation
├── build/ # Compiled JavaScript output (generated)
├── node_modules/ # Dependencies (generated)
├── package.json # Project metadata and scripts
├── tsconfig.json # TypeScript compiler configuration
├── .gitignore # Git exclusion rules
├── README.md # This fileLicense
ISC
Available Tools
2 toolsextract_web_contentA
Fetches raw HTML and converts it into structurally sound, token-efficient Markdown. Preserves semantic tags for AI readability.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses the core behavior (fetch HTML, convert to Markdown) but omits important traits like error handling for invalid URLs, size limits, or authentication requirements.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, consisting of two sentences that front-load the action and purpose. Every word adds value, with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one parameter and no output schema, the description covers the main transformation but lacks details on error behavior, response format, or any limitations. It is minimally adequate but not complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has one parameter 'url' with 0% description coverage. The description does not add meaning beyond the schema—it does not explain what formats are accepted, constraints, or behavior of the parameter. For a single-parameter tool with no schema descriptions, the description should compensate but fails to do so.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool fetches HTML and converts it to Markdown, preserving semantic tags. It uses a specific verb ('fetches') and resource ('web content'), and distinguishes from the sibling tool 'query_metrics_database' which serves a different purpose (database queries).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for extracting web content into Markdown, but lacks explicit guidance on when to use versus alternatives, prerequisites (e.g., network access), or when not to use (e.g., for non-HTML content). No alternatives are discussed.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
query_metrics_databaseC
Queries internal metrics. Outputs strictly in YAML format for maximum token efficiency.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behavioral traits. It only mentions output format (YAML) for token efficiency, but omits read/write safety, side effects, required permissions, or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, no fluff, front-loaded. However, the brevity sacrifices completeness, resulting in an under-specified description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given one parameter, no output schema, and no annotations, the description leaves out essential details about query syntax and output structure, making it incomplete for agent invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0% (no parameter descriptions in schema). The description adds no meaning to the 'query' parameter, leaving its expected format or language ambiguous.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Queries internal metrics', which is a specific verb-resource pair. The sibling tool 'extract_web_content' is about web extraction, making this tool's purpose distinct.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool vs alternatives. No prerequisites, exclusions, or context cues provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v1.0.0- First observed
extract_web_content - First observed
query_metrics_database
TDQS
The two tools have entirely distinct domains: one handles web content extraction, the other queries a metrics database. There is no overlap or ambiguity.
Both tool names follow a consistent verb_noun pattern using snake_case, making them predictable and disambiguated.
With only 2 tools, the server feels thin for its name 'Token-Optimized MCP Server' which implies a broader scope. The count is borderline acceptable.
The server name suggests a focus on token optimization, but the tools only cover web extraction and database queries. Key operations like text optimization or token analysis are missing.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Deterministic AI agent microtools, no accounts/API keys. fetch_extract: 98% token cut. 38 tools.
URL to clean markdown for LLMs: a polite, robots.txt-respecting web reader. Free, no API key
Clean Markdown and AI-readability scoring for any URL. Built for AI agents.
11Web scraping for AI agents. Converts URLs to clean, LLM-ready Markdown with anti-bot bypass.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceFetches web pages and converts them to clean, readable markdown format by extracting main content while removing navigation, ads, and other non-essential elements to minimize token usage.4-

stripfeed-mcp-serverofficial
AlicenseAqualityBmaintenanceConverts any URL to clean, token-efficient Markdown for AI agents. Strips ads, navigation, and scripts. Supports CSS selectors, batch processing (10 URLs), token counting, and smart caching.33MIT- AlicenseAqualityDmaintenanceConverts web pages and HTML strings into clean, LLM-optimized Markdown with metadata extraction and token estimation. It uses a lightweight, browserless approach to provide token-efficient output for more effective LLM processing.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables token-efficient web page fetching by converting HTML to Markdown with tiered access (outline, section, search) to minimize LLM context usage.4Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/satyamkumar68/optimized-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server