npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ff-xiaofan/fastmcp-text-segment

v1.1.0

Published

A FastMCP server with text segmentation tool - split text by natural paragraphs

Readme

FastMCP Text Segment Server

A FastMCP server for intelligent text segmentation by natural paragraphs.

npm version License: MIT

功能特性

  • ✅ 智能文本分段(自然段落识别)
  • ✅ 多种输出格式(Array、Numbered、Markdown)
  • ✅ 自动清理空段落和空白字符
  • ✅ 支持双换行和单换行分段
  • ✅ 基于 MCP 协议

快速开始

安装

npm install -g @ff-xiaofan/fastmcp-text-segment

使用

fastmcp-segment

或使用 npx(无需安装):

npx @ff-xiaofan/fastmcp-text-segment

MCP 工具

segment_text

根据自然段落对文本进行分段处理。

参数:

  • text (必需): 需要分段的文本内容
  • format (可选): 输出格式
    • "array" (默认): JSON数组格式
    • "numbered": 编号列表格式
    • "markdown": Markdown格式

示例:

{
  "text": "第一段内容\\n\\n第二段内容\\n\\n第三段内容",
  "format": "array"
}

greeting

简单的问候工具。

参数:

  • name (必需): 要问候的人的名字
  • language (可选): 'zh' 或 'en',默认 'en'

Claude Desktop 配置

编辑配置文件:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json

添加配置:

{
  "mcpServers": {
    "text-segment": {
      "command": "npx",
      "args": ["-y", "@ff-xiaofan/fastmcp-text-segment"]
    }
  }
}

分段规则

  1. 优先按双换行符(`

\r \r `)分段 2. 如果没有双换行,则按单换行符分段 3. 自动过滤空段落 4. 自动去除段落首尾空白

输出格式示例

Array 格式

[
  "第一段内容",
  "第二段内容",
  "第三段内容"
]

Numbered 格式

1. 第一段内容

2. 第二段内容

3. 第三段内容

Markdown 格式

### 段落 1

第一段内容

### 段落 2

第二段内容

### 段落 3

第三段内容

技术栈

  • MCP SDK 1.x
  • TypeScript 5.x
  • Node.js 18+
  • Zod(参数验证)

开发

# 克隆项目
git clone https://github.com/ff-xiaofan/fastmcp-text-segment.git
cd fastmcp-text-segment

# 安装依赖
npm install

# 开发模式
npm run dev

# 运行测试
npm test

# 构建
npm run build

License

MIT

相关链接