model-enhancement-servers

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Model Enhancement Servers

模型增强服务器

Based on MCP Protocol Version: 2025-06-18
基于MCP协议版本:2025-06-18

Overview

概述

Model enhancement servers are a specialized category of MCP servers that extend LLM capabilities not by wrapping external APIs, but by providing structured reasoning frameworks, persistence mechanisms, and cognitive workflow guidance.
模型增强服务器是一类特殊的MCP服务器,它并非通过封装外部API来扩展LLM能力,而是通过提供结构化推理框架、持久化机制和认知工作流引导来实现这一目标。

Wrapper Servers vs. Model Enhancement Servers

包装器服务器 vs 模型增强服务器

Wrapper servers are like keys that open specific chests with specific treasures. They provide access to external services (Supabase, Gmail, Airtable) and are essential for integrating LLMs with existing systems.
Model enhancement servers are like pen and paper: general-purpose cognitive tools natively designed for LLM use. They extend the model's abilities across a variety of circumstances, not just specific API integrations.
Think of model enhancement servers as a bullet journal for AI. The model documents information with the server, which does basic heuristic processing to signal completion of steps and define next scopes. By directing the AI to consider only a small set of concerns during ongoing transactions, performance improves in tasks requiring memory, reasoning, and runtime lookup.
包装器服务器就像打开特定宝箱的钥匙,它们提供对外部服务(Supabase、Gmail、Airtable)的访问,是LLM与现有系统集成的必备组件。
模型增强服务器则像纸笔:是为LLM原生设计的通用认知工具。它们能在各种场景下扩展模型能力,而不仅限于特定API集成。
可以将模型增强服务器视为AI的子弹笔记。模型在服务器上记录信息,服务器会进行基本的启发式处理,以标记步骤完成情况并定义下一步范围。通过引导AI在持续交互中仅关注少量核心问题,在需要记忆、推理和运行时查找的任务中,模型性能会得到提升。

The Context Window Benefit

上下文窗口优势

Similar to how Getting Things Done (GTD) helps humans by offloading thoughts into documents, model enhancement servers help LLMs process more effectively. When we write down one thought instead of juggling a hundred, we can focus better. Context window management is critical to all entities that use attention—a scarce resource.
就像“搞定一切”(GTD)方法通过将想法记录到文档中来帮助人类一样,模型增强服务器也能帮助LLM更高效地处理信息。当我们写下一个想法而非同时处理上百个时,我们能更专注。上下文窗口管理对所有使用注意力(一种稀缺资源)的实体来说都至关重要。

"Do Nothing" as a core feature of Model Enhancement Servers

“不执行任何操作”是模型增强服务器的核心特性

A model enhancement server does not do anything, any more than a real bullet journal "does" anything: its value is entirely tied to how well it facilitates the agentic process it's meant to support.
Instead, the server "enhances" an agent's capabilities by externalizing some state that represents the agent's thinking process. As mentioned above, this externalized state allows the agent to focus on the current step. But further, because a representation of reasoning is lossy relative to the actual process of reasoning, creating the representation forces an agent to make choices about what is and is not important to the process: in this way, externalization can be modeled as a form of compression. Just as a human may improve their thinking through journaling or other forms of externalization, agents can improve their reasoning through externalization: the benefits of externalization are not confined to the carbon substrate.

模型增强服务器并不会“执行”任何操作,就像真正的子弹笔记不会“执行”任何操作一样:它的价值完全取决于对其支持的智能体流程的促进效果。
相反,服务器通过外化代表智能体思考过程的部分状态来“增强”智能体的能力。如前所述,这种外化状态能让智能体专注于当前步骤。更进一步,由于推理的表示相对于实际推理过程是有损的,创建表示会迫使智能体选择哪些内容对过程重要、哪些不重要:从这个角度看,外化可以被视为一种压缩形式。就像人类可以通过记笔记或其他外化形式提升思考能力一样,智能体也能通过外化提升推理能力:外化的优势并不局限于碳基生物。

⚠️ CRITICAL PRINCIPLE: The Server Does NOT Reason

⚠️ 关键原则:服务器不进行推理

The most important thing to understand about model enhancement servers:
关于模型增强服务器,最重要的一点是:

The agent performs reasoning. The server provides structure.

智能体执行推理,服务器提供结构。

Model enhancement servers are scaffolding, not reasoning engines. They are persistence mechanisms and workflow guides, not AI models themselves.
What the server does:
  • ✅ Records reasoning steps (journaling)
  • ✅ Maintains state and history
  • ✅ Validates input format
  • ✅ Returns metadata and progress indicators
  • ✅ Simplifies the possibility space available to the agent
  • ✅ Encourages use of structured workflows
  • ✅ Makes the process transparent and evaluable
What the server does NOT do:
  • ❌ Generate thoughts or reasoning
  • ❌ Decide what the next step should be
  • ❌ Evaluate the quality of the agent's reasoning
  • ❌ Make decisions about problem-solving approaches
  • ❌ Act as an autonomous agent
  • ❌ Perform any AI inference
模型增强服务器是脚手架,而非推理引擎。它们是持久化机制和工作流引导工具,而非AI模型本身。
服务器的职责:
  • ✅ 记录推理步骤(日志记录)
  • ✅ 维护状态和历史记录
  • ✅ 验证输入格式
  • ✅ 返回元数据和进度指标
  • ✅ 简化智能体可选择的可能性空间
  • ✅ 鼓励使用结构化工作流
  • ✅ 让过程透明且可评估
服务器不负责的内容:
  • ❌ 生成想法或推理内容
  • ❌ 决定下一步操作
  • ❌ 评估智能体推理的质量
  • ❌ 选择问题解决方法
  • ❌ 作为自主智能体行动
  • ❌ 执行任何AI推理

Why This Matters

这一点为何重要

The value of model enhancement comes from:
  1. Simplifying possibility space: Fewer choices → better focus
  2. Encouraging structured workflows: Patterns that can be evaluated and improved
  3. Making processes transparent: We (and the agent) can see and analyze what the agent did
  4. Providing persistence: The agent doesn't lose context
The server is a notebook, a journal, a whiteboard—not a tutor, not a critic, not a collaborator.
Remember: The MCP client application (the agent) does the thinking. Your server just keeps the whiteboard clean and organized.

模型增强的价值来源于:
  1. 简化可能性空间:选择越少 → 专注度越高
  2. 鼓励结构化工作流:可评估和改进的模式
  3. 过程透明化:我们(和智能体)可以查看并分析智能体的操作
  4. 提供持久化能力:智能体不会丢失上下文
服务器是笔记本、日志本、白板——而非导师、批评者或合作者。
请记住:MCP客户端应用(智能体)负责思考。你的服务器只需保持白板整洁有序即可。

Core Patterns

核心模式

1. Structured Journal Pattern

1. 结构化日志模式

Purpose: Track and persist a sequence of reasoning steps while guiding the model through a cognitive process.
Key Features:
  • Single tool with rich, descriptive guidance in the tool description
  • State tracking (history of steps, branches, revisions)
  • Support for non-linear thinking (revisions, branches, adjusting scope)
  • Dual output channels (structured JSON for model, formatted logs for humans)
When to Use:
  • Breaking down complex problems into steps
  • Planning and design requiring iteration
  • Analysis that might need course correction
  • Problems where scope isn't fully known upfront
  • Tasks requiring context maintenance across multiple steps
Example: Sequential Thinking Server
This server provides a framework for step-by-step reasoning with the ability to revise, branch, and adjust course.
Architecture:
typescript
interface ThoughtData {
  thought: string;
  thoughtNumber: number;
  totalThoughts: number;
  isRevision?: boolean;
  revisesThought?: number;
  branchFromThought?: number;
  branchId?: string;
  needsMoreThoughts?: boolean;
  nextThoughtNeeded: boolean;
}
Tool Design:
  • Name: Single, clear tool name (e.g.,
    sequentialthinking
    )
  • Description: Extensive guidance on when to use, how it works, parameter meanings, key features, workflow recommendations
  • Input Schema: Mix of required (core workflow) and optional (advanced features) fields
  • State Management: Maintain history array, track branches separately, validate input, return status and metadata
  • Output Strategy: JSON for model, formatted colored display for humans (stderr)
Variations: The Structured Journal pattern can be specialized for specific methodologies:
  • Structured Argumentation: Typed workflow states (thesis, antithesis, synthesis), relationship graphs, methodology-aware suggestions
  • Analogical Reasoning: Complex nested structures (source/target domains), multi-instance state tracking, rich metadata summaries
Novel Strategies:
  1. Typed Workflow States: Use enums to make methodology steps explicit
  2. Relationship Tracking: Maintain graphs of how entries relate
  3. Auto-ID Generation: Reduce agent cognitive load
  4. Confidence/Strength Metadata: Let agents express uncertainty numerically
  5. Complex Nested Structures: Support domain-specific decomposition
  6. Methodology-Aware Guidance: Suggest next steps based on formal structure
  7. Multi-Instance Registries: Enable building on previous work
  8. Rich State Summaries: Return contextual metadata about current state

用途:跟踪并持久化一系列推理步骤,同时引导模型完成认知过程。
关键特性:
  • 单个工具,工具描述中包含丰富的指导性内容
  • 状态跟踪(步骤、分支、修订的历史记录)
  • 支持非线性思考(修订、分支、调整范围)
  • 双输出通道(给模型的结构化JSON,给人类的格式化日志)
适用场景:
  • 将复杂问题拆解为多个步骤
  • 需要迭代的规划和设计任务
  • 可能需要调整方向的分析工作
  • 初始范围不明确的问题
  • 需要跨多步维护上下文的任务
示例:顺序思考服务器
该服务器提供支持修订、分支和方向调整的分步推理框架。
架构:
typescript
interface ThoughtData {
  thought: string;
  thoughtNumber: number;
  totalThoughts: number;
  isRevision?: boolean;
  revisesThought?: number;
  branchFromThought?: number;
  branchId?: string;
  needsMoreThoughts?: boolean;
  nextThoughtNeeded: boolean;
}
工具设计:
  • 名称:单一清晰的工具名称(例如
    sequentialthinking
  • 描述:包含何时使用、工作原理、参数含义、关键特性、工作流建议的详细指南
  • 输入Schema:混合必填(核心工作流)和可选(高级功能)字段
  • 状态管理:维护历史数组、单独跟踪分支、验证输入、返回状态和元数据
  • 输出策略:给模型的JSON格式,给人类的格式化彩色显示(stderr)
变体:结构化日志模式可针对特定方法论进行定制:
  • 结构化论证:类型化工作流状态(论点、反论点、综合)、关系图、方法论感知建议
  • 类比推理:复杂嵌套结构(源/目标领域)、多实例状态跟踪、丰富元数据摘要
创新策略:
  1. 类型化工作流状态:使用枚举明确方法论步骤
  2. 关系跟踪:维护条目间的关系图
  3. 自动ID生成:降低智能体认知负担
  4. 置信度/强度元数据:让智能体以数值形式表达不确定性
  5. 复杂嵌套结构:支持领域特定的分解
  6. 方法论感知引导:基于正式结构建议下一步
  7. 多实例注册:支持基于已有工作进行构建
  8. 丰富状态摘要:返回关于当前状态的上下文元数据

2. Literate Reasoning / Notebook Pattern

2. 可读推理 / 笔记本模式

Purpose: Provide a Jupyter-like notebook interface where models work through problems with full transparency and reproducibility.
Key Features:
  • Markdown cells for explanations and reasoning
  • Code cells for executable actions
  • Cell-by-cell execution with visible outputs
  • Re-runnable and modifiable workflows
  • Living documentation of problem-solving process
When to Use:
  • Complex multi-step processes requiring transparency
  • Debugging and tracing agent reasoning
  • Iterative problem-solving where you might modify approaches
  • Creating reusable workflow templates ("notebook presets")
  • Situations where the process matters as much as the result
The Problem It Solves:
Traditional agent interactions are "black boxes" - you get a final answer but don't see how the agent arrived at it. Notebooks provide four critical benefits:
  1. Transparency: See the agent's thought process step-by-step
  2. Reproducibility: Replay and refine workflows
  3. Built-in Gating: Control agent reasoning at the source with validation checkpoints
  4. Headless Simplicity: Serve as pure data structures via API/MCP tools without UI overhead
Architecture Pattern:
Unlike the Structured Journal pattern (which maintains state in the server), the Notebook pattern typically:
  • Uses a CLI application to serve the notebook to the model (headless - no UI needed)
  • Provides both markdown cells (guidance) and code cells (actions)
  • Allows non-linear execution (jump to cells, re-run, modify)
  • Maintains execution history and cell outputs
  • Can be persisted and shared as templates
  • Serves notebooks as data structures via MCP tools (agents interact via API, not visually)
  • Enables gating between cells (validation, checkpoints, required steps)
Notebook Structure:
typescript
interface NotebookCell {
  id: string;
  type: 'markdown' | 'code';
  content: string;
  output?: string;
  executionCount?: number;
  metadata?: Record<string, unknown>;
}

interface Notebook {
  cells: NotebookCell[];
  metadata: {
    language: string;
    title: string;
    description?: string;
  };
}
Tool Design:
  • notebook_create
    : Initialize new notebook with optional preset template
  • notebook_add_cell
    : Add markdown or code cells
  • notebook_run_cell
    : Execute a specific cell (can enforce gating rules)
  • notebook_get_cell
    : Retrieve cell content and output
  • notebook_validate_progression
    : Check if agent can proceed to next cell (gating)
  • notebook_export
    : Save notebook for sharing/reuse
Gating Example:
typescript
// Server can enforce that certain cells must be executed before others
// NOTE: Gates enforce STRUCTURE (has X been done?), not QUALITY (was X done well?)
async function runCell(cellId: string): Promise<Response> {
  const cell = notebook.getCell(cellId);
  const gates = notebook.getGatesForCell(cellId);
  
  // Check if prerequisites are met (structural validation only)
  for (const gate of gates) {
    if (!gate.isOpen()) {
      return {
        error: `Cannot execute cell ${cellId}: ${gate.requirement}`,
        suggestion: `Complete cells [${gate.requiredCells.join(', ')}] first`
      };
    }
  }
  
  // Execute cell if gates are open
  return executeCell(cell);
}
Use Cases:
  1. Guided Workflows: Pre-filled code cells with markdown explanations as tutorials
  2. Structured AI Behavior: Direct agents through logical flows
  3. Notebook Presets: Pre-made templates for common tasks (Git workflows, database queries, API integrations)
  4. Interactive Experimentation: Modify parameters and re-run to see impact
Implementation Reference:

用途:提供类似Jupyter的笔记本界面,让模型能以完全透明和可复现的方式解决问题。
关键特性:
  • 用于解释和推理的Markdown单元格
  • 用于可执行操作的代码单元格
  • 逐单元格执行,输出可见
  • 可重运行和修改的工作流
  • 问题解决过程的活文档
适用场景:
  • 需要透明性的复杂多步流程
  • 调试和追踪智能体推理
  • 可能需要修改方法的迭代式问题解决
  • 创建可复用的工作流模板(“笔记本预设”)
  • 过程与结果同等重要的场景
解决的问题:
传统智能体交互是“黑盒”——你得到最终答案,但看不到智能体如何得出答案。笔记本模式提供四个关键优势:
  1. 透明性:逐步查看智能体的思考过程
  2. 可复现性:重放和优化工作流
  3. 内置门控:通过验证检查点从源头控制智能体推理
  4. 无头简化:通过API/MCP工具作为纯数据结构提供服务,无需UI开销
架构模式:
与结构化日志模式(在服务器中维护状态)不同,笔记本模式通常:
  • 使用CLI应用向模型提供笔记本服务(无头模式 - 无需UI)
  • 同时提供Markdown单元格(引导)和代码单元格(操作)
  • 支持非线性执行(跳转到单元格、重运行、修改)
  • 维护执行历史和单元格输出
  • 可持久化并作为模板共享
  • 通过MCP工具将笔记本作为数据结构提供服务(智能体通过API交互,而非可视化界面)
  • 支持单元格间的门控(验证、检查点、必填步骤)
笔记本结构:
typescript
interface NotebookCell {
  id: string;
  type: 'markdown' | 'code';
  content: string;
  output?: string;
  executionCount?: number;
  metadata?: Record<string, unknown>;
}

interface Notebook {
  cells: NotebookCell[];
  metadata: {
    language: string;
    title: string;
    description?: string;
  };
}
工具设计:
  • notebook_create
    :使用可选预设模板初始化新笔记本
  • notebook_add_cell
    :添加Markdown或代码单元格
  • notebook_run_cell
    :执行特定单元格(可强制执行门控规则)
  • notebook_get_cell
    :检索单元格内容和输出
  • notebook_validate_progression
    :检查智能体是否可以进入下一个单元格(门控)
  • notebook_export
    :保存笔记本以便共享/复用
门控示例:
typescript
// Server can enforce that certain cells must be executed before others
// NOTE: Gates enforce STRUCTURE (has X been done?), not QUALITY (was X done well?)
async function runCell(cellId: string): Promise<Response> {
  const cell = notebook.getCell(cellId);
  const gates = notebook.getGatesForCell(cellId);
  
  // Check if prerequisites are met (structural validation only)
  for (const gate of gates) {
    if (!gate.isOpen()) {
      return {
        error: `Cannot execute cell ${cellId}: ${gate.requirement}`,
        suggestion: `Complete cells [${gate.requiredCells.join(', ')}] first`
      };
    }
  }
  
  // Execute cell if gates are open
  return executeCell(cell);
}
用例:
  1. 引导式工作流:预填充代码单元格并搭配Markdown解释作为教程
  2. 结构化AI行为:引导智能体完成逻辑流程
  3. 笔记本预设:针对常见任务(Git工作流、数据库查询、API集成)的预制模板
  4. 交互式实验:修改参数并重运行以查看影响
实现参考:

Pattern Comparison: When to Use Which

模式对比:何时选择哪种模式

Structured Journal vs. Notebook

结构化日志 vs 笔记本

Use Structured Journal when:
  • The process is primarily linear with optional branches
  • You want minimal overhead (single tool, simple state)
  • The focus is on the reasoning sequence itself
  • Human inspection is secondary (optional stderr logging)
  • The model drives the structure and pacing
  • Example: Sequential thinking, step-by-step analysis
Use Notebook when:
  • The process requires code execution and output inspection
  • Transparency and reproducibility are critical
  • You want to save/share the process as a template
  • Multiple passes and revisions are expected
  • Human inspection and modification are important
  • You need built-in validation gates between reasoning steps
  • Headless serving is preferred (agent interaction via API, no UI needed)
  • Example: Research workflows, debugging, tutorials, multi-stage validation processes
Hybrid Approach: You can combine both patterns - use a notebook where each cell represents a structured reasoning step that gets journaled.

选择结构化日志模式的场景:
  • 过程主要是线性的,可选择分支
  • 希望最小化开销(单个工具、简单状态)
  • 关注点是推理序列本身
  • 人工检查是次要的(可选stderr日志)
  • 模型驱动结构和节奏
  • 示例:顺序思考、分步分析
选择笔记本模式的场景:
  • 过程需要代码执行和输出检查
  • 透明性和可复现性至关重要
  • 希望将过程保存/共享为模板
  • 预期会有多轮迭代和修订
  • 人工检查和修改很重要
  • 需要在推理步骤间内置验证门控
  • 首选无头服务(智能体通过API交互,无需UI)
  • 示例:研究工作流、调试、教程、多阶段验证流程
混合方法: 你可以结合两种模式——使用笔记本,其中每个单元格代表一个被记录到结构化日志中的推理步骤。

Implementation Guide (TypeScript)

TypeScript实现指南

Project Setup

项目设置

typescript
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
  CallToolRequestSchema,
  ListToolsRequestSchema,
  Tool,
} from "@modelcontextprotocol/sdk/types.js";
typescript
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
  CallToolRequestSchema,
  ListToolsRequestSchema,
  Tool,
} from "@modelcontextprotocol/sdk/types.js";

Core Server Class Pattern

核心服务器类模式

typescript
class EnhancementServer {
  private state: YourStateType = initialState;
  private config: ConfigType;

  constructor() {
    this.config = {
      disableLogging: (process.env.DISABLE_LOGGING || "").toLowerCase() === "true"
    };
  }

  private validateInput(input: unknown): ValidatedType {
    // Type-safe validation - throw clear errors for invalid input
  }

  public processRequest(input: unknown): {
    content: Array<{ type: string; text: string }>;
    structuredContent?: { [key: string]: unknown };
    isError?: boolean;
  } {
    try {
      const validated = this.validateInput(input);
      this.updateState(validated);
      
      if (!this.config.disableLogging) {
        this.logToStderr(validated);
      }
      
      const responseData = this.getResponseData(validated);
      
      return {
        content: [{ type: "text", text: JSON.stringify(responseData, null, 2) }],
        structuredContent: responseData,
        isError: false
      };
    } catch (error) {
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            error: error instanceof Error ? error.message : String(error),
            status: 'failed'
          }, null, 2)
        }],
        isError: true
      };
    }
  }
}
typescript
class EnhancementServer {
  private state: YourStateType = initialState;
  private config: ConfigType;

  constructor() {
    this.config = {
      disableLogging: (process.env.DISABLE_LOGGING || "").toLowerCase() === "true"
    };
  }

  private validateInput(input: unknown): ValidatedType {
    // Type-safe validation - throw clear errors for invalid input
  }

  public processRequest(input: unknown): {
    content: Array<{ type: string; text: string }>;
    structuredContent?: { [key: string]: unknown };
    isError?: boolean;
  } {
    try {
      const validated = this.validateInput(input);
      this.updateState(validated);
      
      if (!this.config.disableLogging) {
        this.logToStderr(validated);
      }
      
      const responseData = this.getResponseData(validated);
      
      return {
        content: [{ type: "text", text: JSON.stringify(responseData, null, 2) }],
        structuredContent: responseData,
        isError: false
      };
    } catch (error) {
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            error: error instanceof Error ? error.message : String(error),
            status: 'failed'
          }, null, 2)
        }],
        isError: true
      };
    }
  }
}

Tool Definition Pattern

工具定义模式

typescript
const ENHANCEMENT_TOOL: Tool = {
  name: "toolname",
  title: "Tool Display Name",  // Optional: display precedence: title > annotations.title > name
  
  description: `Comprehensive description that guides the model:
  
When to use this tool:
- Specific use cases

Key features:
- Feature explanations

Parameters explained:
- param1: What it means and how to use it

You should:
1. Step-by-step workflow guidance
2. Expected behavior patterns
3. When to stop/continue`,

  inputSchema: {
    type: "object",
    properties: {
      requiredField: { type: "string", description: "Clear description" },
      optionalField: { type: "boolean", description: "When to use this" }
    },
    required: ["requiredField"]
  },
  
  outputSchema: {  // Optional: enables structuredContent
    type: "object",
    properties: {
      status: { type: "string", description: "Operation status" },
      metadata: { type: "object", description: "Additional metadata" }
    },
    required: ["status"]
  },
  
  annotations: {  // Optional: hints about behavior
    readOnlyHint: true,
    destructiveHint: false,
    idempotentHint: true,
    openWorldHint: false
  }
};
typescript
const ENHANCEMENT_TOOL: Tool = {
  name: "toolname",
  title: "Tool Display Name",  // Optional: display precedence: title > annotations.title > name
  
  description: `Comprehensive description that guides the model:
  
When to use this tool:
- Specific use cases

Key features:
- Feature explanations

Parameters explained:
- param1: What it means and how to use it

You should:
1. Step-by-step workflow guidance
2. Expected behavior patterns
3. When to stop/continue`,

  inputSchema: {
    type: "object",
    properties: {
      requiredField: { type: "string", description: "Clear description" },
      optionalField: { type: "boolean", description: "When to use this" }
    },
    required: ["requiredField"]
  },
  
  outputSchema: {  // Optional: enables structuredContent
    type: "object",
    properties: {
      status: { type: "string", description: "Operation status" },
      metadata: { type: "object", description: "Additional metadata" }
    },
    required: ["status"]
  },
  
  annotations: {  // Optional: hints about behavior
    readOnlyHint: true,
    destructiveHint: false,
    idempotentHint: true,
    openWorldHint: false
  }
};

Server Initialization

服务器初始化

typescript
const server = new Server(
  { name: "your-enhancement-server", version: "0.1.0" },
  { capabilities: { tools: {} } }
);

const enhancementServer = new EnhancementServer();

server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [ENHANCEMENT_TOOL],
}));

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  if (request.params.name === "toolname") {
    return enhancementServer.processRequest(request.params.arguments);
  }
  return {
    content: [{ type: "text", text: `Unknown tool: ${request.params.name}` }],
    isError: true
  };
});

async function runServer() {
  const transport = new StdioServerTransport();
  await server.connect(transport);
  console.error("Enhancement Server running on stdio");
}

runServer().catch((error) => {
  console.error("Fatal error running server:", error);
  process.exit(1);
});
typescript
const server = new Server(
  { name: "your-enhancement-server", version: "0.1.0" },
  { capabilities: { tools: {} } }
);

const enhancementServer = new EnhancementServer();

server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [ENHANCEMENT_TOOL],
}));

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  if (request.params.name === "toolname") {
    return enhancementServer.processRequest(request.params.arguments);
  }
  return {
    content: [{ type: "text", text: `Unknown tool: ${request.params.name}` }],
    isError: true
  };
});

async function runServer() {
  const transport = new StdioServerTransport();
  await server.connect(transport);
  console.error("Enhancement Server running on stdio");
}

runServer().catch((error) => {
  console.error("Fatal error running server:", error);
  process.exit(1);
});

Best Practices

最佳实践

Tool Description Writing:
  • Front-load the "when to use" guidance
  • Explain parameters in context, not just technically
  • Provide workflow steps as numbered guidance
  • Be explicit about flexibility and adaptation
State Management:
  • Keep state minimal but sufficient for context
  • Validate all inputs before updating state
  • Return metadata that helps the model understand progress
Error Handling:
  • Validate input with clear, specific error messages
  • Guide the model toward correct usage in errors
  • Always return structured responses, even for errors
  • CRITICAL: Only validate format and structure, never evaluate reasoning quality
Human Output (optional):
  • Log to stderr, never stdout (stdout is for MCP protocol)
  • Make it visually distinct and informative
  • Make it toggleable via environment variables

工具描述编写:
  • 前置“何时使用”的引导内容
  • 在上下文中解释参数,而非仅技术说明
  • 提供编号的工作流步骤引导
  • 明确说明灵活性和适应性
状态管理:
  • 保持状态精简但足以提供上下文
  • 在更新状态前验证所有输入
  • 返回帮助模型理解进度的元数据
错误处理:
  • 验证输入并返回清晰、具体的错误消息
  • 在错误中引导模型正确使用
  • 即使是错误也始终返回结构化响应
  • 关键:仅验证格式和结构,绝不评估推理质量
人类输出(可选):
  • 记录到stderr,而非stdout(stdout用于MCP协议)
  • 使其视觉上清晰且信息丰富
  • 可通过环境变量切换

Future Directions and Use Cases

未来方向和用例

As agentic networking matures, model enhancement servers enable novel patterns:
随着智能体网络的成熟,模型增强服务器将支持创新模式:

Long-Running Async Processes

长期异步流程

Model enhancement servers provide Day One mechanisms for maintaining context across extended operations:
  • Batch jobs: Track progress through multi-hour processing tasks
  • Extended research: Maintain context during deep exploration (e.g., Exa's Websets running 30+ minutes)
  • Multi-stage workflows: Coordinate phases of complex work over hours or days
模型增强服务器为跨扩展操作维护上下文提供了原生机制:
  • 批处理任务:跟踪数小时处理任务的进度
  • 深度研究:在深度探索期间维护上下文(例如Exa的Websets运行30分钟以上)
  • 多阶段工作流:协调数小时或数天的复杂工作阶段

Multi-Client Coordination

多客户端协调

Model enhancement servers can connect to multiple clients simultaneously, acting as a bulletin board where different clients post and retrieve information. This enables coordination between clients that have no other means of communication. MCP servers as proxies between clients may become the dominant use case per-server.
模型增强服务器可同时连接多个客户端,作为不同客户端发布和检索信息的公告板。这使得原本无法通信的客户端能够协调工作。MCP服务器作为客户端间的代理可能会成为每个服务器的主要用例。

Formalized Workflows

规范化工作流

Enhancement servers can support highly structured methodologies with clear definitions:
  • Scientific method: Hypothesis generation, experimentation, validation
  • Design thinking: Empathy, definition, ideation, prototyping, testing
  • Six Sigma: DMAIC (Define, Measure, Analyze, Improve, Control)
The server guides adherence to the methodology while allowing flexibility within steps.

增强服务器可支持定义明确的高度结构化方法论:
  • 科学方法:假设生成、实验、验证
  • 设计思维:共情、定义、构思、原型、测试
  • 六西格玛:DMAIC(定义、测量、分析、改进、控制)
服务器会引导智能体遵循方法论,同时允许步骤内的灵活性。

Example Servers

示例服务器

Sequential Thinking Server

顺序思考服务器

See
example-servers/sequential-thinking
for full working example.
What It Does: Guides models through step-by-step reasoning, supports revision, branching, and dynamic scope adjustment.
Key Design Decisions:
  1. Single
    sequentialthinking
    tool handles entire workflow
  2. Rich description (~50 lines of guidance)
  3. Flexible schema (required fields for core, optional for advanced)
  4. Dual output (JSON for model, formatted boxes for humans)
  5. State tracking (linear history + branch dictionary)
The Whiteboard Analogy: Each time Claude calls
sequentialthinking
, imagine Claude as a student: works out a step on a whiteboard, walks away to reflect, returns when ready for the next step. The server provides the persistent whiteboard; the model provides the reasoning.
完整工作示例请查看
example-servers/sequential-thinking
功能:引导模型完成分步推理,支持修订、分支和动态范围调整。
关键设计决策:
  1. 单个
    sequentialthinking
    工具处理整个工作流
  2. 丰富的描述(约50行引导内容)
  3. 灵活的Schema(核心必填字段,高级可选字段)
  4. 双输出(给模型的JSON,给人类的格式化框式显示)
  5. 状态跟踪(线性历史 + 分支字典)
白板类比:每次Claude调用
sequentialthinking
时,可以想象Claude是一个学生:在白板上算出一步,走开反思,准备好下一步时再回来。服务器提供持久化的白板;模型负责推理。

Structured Argumentation Server

结构化论证服务器

See
example-servers/structured-argumentation
for full working example.
What It Does: Facilitates dialectical reasoning through formal argument structures (thesis → antithesis → synthesis).
Key Features: Formal claim/premises/conclusion structure, five argument types, relationship tracking, methodology guidance based on formal dialectical structure, auto-ID generation, confidence tracking.
完整工作示例请查看
example-servers/structured-argumentation
功能:通过正式论证结构(论点→反论点→综合)促进辩证推理。
关键特性:正式的主张/前提/结论结构、五种论证类型、关系跟踪、基于正式辩证结构的方法论引导、自动ID生成、置信度跟踪。

Analogical Reasoning Server

类比推理服务器

See
example-servers/analogical-reasoning
for full working example.
What It Does: Supports systematic analogical reasoning with source/target domain mapping and element typing.
Key Features: Complex nested structures, element typing (entity/attribute/relation/process), mapping strength ratings, domain registry for reuse, inference tracking with confidence levels.
完整工作示例请查看
example-servers/analogical-reasoning
功能:支持系统类比推理,包含源/目标领域映射和元素类型定义。
关键特性:复杂嵌套结构、元素类型(实体/属性/关系/过程)、映射强度评级、可复用的领域注册、带置信度的推理跟踪。