Token导航 LogoToken导航TokenDH.com
MCP Webpage Timestamps logo
浏览器工具stdio官方级别未说明来源级核验

MCP Webpage Timestamps

MCP Server

mcp-webpage-timestamps

一个用于提取网页创建、修改和发布时间的强大工具,支持多种数据源和批量处理,适用于网页抓取和内容时间分析。

工具数

2

提示词数

0

GitHub Stars

1

资源数

0
浏览器自动化批量处理TypeScriptClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Fabien-desablens

提供方

Fabien-desablens

最后核验

2026/5/17 20:22

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx mcp-webpage-timestamps

详细介绍

MCP网页时间戳

](https://www.npmjs.com/package/mcp-webpage-timestamps) ![License: MIT](https://opensource.org/licenses/MIT) ](https://nodejs.org/) ](https://smithery.ai/server/@Fabien-desablens/mcp-webpage-timestamps)

一个强大的 模型上下文协议(MCP) 用于提取网页创建、修改和发布时间戳的服务器。该工具专为网页抓取和网页内容的时间分析而设计。

特性

  • 全面的时间戳提取:从网页中提取创建、修改和发布时间戳
  • 多个数据源:支持HTML元标记、HTTP标头、JSON-LD、微数据、OpenGraph、推特卡和启发式分析
  • 信心评分:为提取的时间戳提供置信度(高/中/低)
  • 批处理:同时从多个URL中提取时间戳
  • 可配置的:可定制的超时、用户代理、重定向处理和启发式选项
  • 生产就绪:强大的错误处理、全面的日志记录和TypeScript支持

安装

快速安装

npm install -g mcp-webpage-timestamps

使用npx

npx mcp-webpage-timestamps

通过Smithery安装

通过以下方式自动安装Claude Desktop的mcp网页时间戳 史密瑟里:

npx -y @smithery/cli install @Fabien-desablens/mcp-webpage-timestamps --client claude

先决条件

  • Node.js 18.0.0或更高版本
  • npm或纱线

开发安装

git clone https://github.com/Fabien-desablens/mcp-webpage-timestamps.git
cd mcp-webpage-timestamps
npm install
npm run build

用法

作为MCP服务器

该服务器可以与任何兼容MCP的客户端一起使用。以下是如何配置它:

Claude桌面配置

添加到您的 claude_desktop_config.json:

{
  "mcpServers": {
    "webpage-timestamps": {
      "command": "npx",
      "args": ["mcp-webpage-timestamps"],
      "env": {}
    }
  }
}

临床配置

添加到MCP设置中:

{
  "mcpServers": {
    "webpage-timestamps": {
      "command": "npx",
      "args": ["mcp-webpage-timestamps"]
    }
  }
}

直接使用

# Start the server
npm start

# Or run in development mode
npm run dev

api参考

工具

extract_timestamps

从单个网页提取时间戳。

参数:

  • url (string,必填):从中提取时间戳的网页的URL
  • config (对象,可选):配置选项

配置选项:

  • timeout (number):请求超时(毫秒)(默认值:10000)
  • userAgent (string):请求的用户代理字符串
  • followRedirects (boolean):是否遵循HTTP重定向(默认值:true)
  • maxRedirects (number):要遵循的最大重定向数(默认值:5)
  • enableHeuristics (boolean):启用启发式时间戳检测(默认值:true)

例子:

{
  "name": "extract_timestamps",
  "arguments": {
    "url": "https://example.com/article",
    "config": {
      "timeout": 15000,
      "enableHeuristics": true
    }
  }
}

batch_extract_timestamps

批量从多个网页中提取时间戳。

参数:

  • urls (字符串数组,必填):从中提取时间戳的URL数组
  • config (对象,可选):与相同的配置选项 extract_timestamps

例子:

{
  "name": "batch_extract_timestamps",
  "arguments": {
    "urls": [
      "https://example.com/article1",
      "https://example.com/article2",
      "https://example.com/article3"
    ],
    "config": {
      "timeout": 10000
    }
  }
}

响应格式

这两个工具都返回具有以下结构的JSON对象:

{
  url: string;
  createdAt?: Date;
  modifiedAt?: Date;
  publishedAt?: Date;
  sources: TimestampSource[];
  confidence: 'high' | 'medium' | 'low';
  errors?: string[];
}

时间戳来源:

{
  type: 'html-meta' | 'http-header' | 'json-ld' | 'microdata' | 'opengraph' | 'twitter' | 'heuristic';
  field: string;
  value: string;
  confidence: 'high' | 'medium' | 'low';
}

支持的时间戳源

HTML元标签

  • article:published_time
  • article:modified_time
  • date
  • pubdate
  • publishdate
  • last-modified
  • dc.date.created
  • dc.date.modified
  • dcterms.created
  • dcterms.modified

HTTP头处理模块

  • Last-Modified
  • Date

JSON-LD结构化数据

  • datePublished
  • dateModified
  • dateCreated

微观数据

  • datePublished
  • dateModified

OpenGraph

  • og:article:published_time
  • og:article:modified_time
  • og:updated_time

推特卡

  • twitter:data1 (包含日期信息时)

启发式分析

  • 时间元素 datetime 属性
  • 文本中常见的日期模式
  • 与日期相关的CSS类

发展

脚本

# Development with hot reload
npm run dev

# Build the project
npm run build

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Lint code
npm run lint

# Fix linting issues
npm run lint:fix

# Format code
npm run format

测试

该项目包括综合测试:

# Run all tests
npm test

# Run tests with coverage
npm test -- --coverage

# Run specific test file
npm test -- extractor.test.ts

代码质量

  • TypeScript:完全支持TypeScript,具有严格的类型检查
  • 埃斯林特:使用推荐规则进行代码整理
  • 更漂亮:代码格式
  • 开玩笑:单元和集成测试
  • 95%以上的测试覆盖率:全面的测试套件

例子

基本用法

import { TimestampExtractor } from './src/extractor.js';

const extractor = new TimestampExtractor();
const result = await extractor.extractTimestamps('https://example.com/article');

console.log('Published:', result.publishedAt);
console.log('Modified:', result.modifiedAt);
console.log('Confidence:', result.confidence);
console.log('Sources:', result.sources.length);

自定义配置

const extractor = new TimestampExtractor({
  timeout: 15000,
  userAgent: 'MyBot/1.0',
  enableHeuristics: false,
  maxRedirects: 3
});

const result = await extractor.extractTimestamps('https://example.com');

批处理

const urls = [
  'https://example.com/article1',
  'https://example.com/article2',
  'https://example.com/article3'
];

const results = await Promise.all(
  urls.map(url => extractor.extractTimestamps(url))
);

用例

  • 内容分析:分析网络内容的时间方面
  • Web剪贴:从抓取的页面中提取时间元数据
  • SEO分析:分析发布和修改模式
  • 研究:研究网络内容的时间方面
  • 内容管理:跟踪内容生命周期和更新

错误处理

提取器优雅地处理各种错误情况:

  • 网络错误:超时、连接被拒绝、DNS解析失败
  • HTTP错误:404、500和其他HTTP状态码
  • 解析错误:HTML无效,JSON-LD格式错误,日期不可分析
  • 配置错误:无效的URL、超时值等。

所有错误都记录在 errors 响应数组,允许稳健的错误处理和调试。

贡献

我们欢迎捐款!请查看我们的 贡献指南 了解详情。

开发设置

  1. 分叉存储库
  2. 克隆你的叉子: git clone https://github.com/Fabien-desablens/mcp-webpage-timestamps.git
  3. 安装依赖项: npm install
  4. 创建分支: git checkout -b feature/your-feature
  5. 进行更改
  6. 运行测试: npm test
  7. 提交您的更改: git commit -m 'Add some feature'
  8. 推到分支: git push origin feature/your-feature
  9. 提交拉取请求

代码的风格

  • 遵循现有代码样式
  • 对所有新代码使用TypeScript
  • 添加新功能的测试
  • 根据需要更新文档

许可证

MIT许可证-请参阅 许可证 文件以获取详细信息。

支持

  • 问题:
  • 讨论:
  • 文档: 维基

更新日志

更改日志.md 查看详细的变化历史。

致谢

目录标签

目录标签

浏览器自动化批量处理TypeScriptClaude网页抓取本地部署时间分析元数据提取内容管理

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

部署方式(deploymentType,部署类型)

remote-capable

来源包(packageName,安装包名)

mcp-webpage-timestamps

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononeremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP