Skip to main content
Glama

Sitemap MCP Server

网站地图 MCP 服务器

通过从任意 URL 获取、解析和可视化站点地图,探索网站架构并分析网站结构。无需手动探索,即可发现隐藏页面并提取有序的层次结构。

包括适用于 Claude Desktop 的现成提示模板,让您可以分析网站、检查站点地图健康状况、提取 URL、查找缺失内容以及仅通过 URL 输入创建可视化效果。

执照PyPIPython 版本地位

演示

利用站点地图的功能获取有关任何网站的问题的答案。

点击工具按钮旁边的“附加”按钮:

图像

然后选择visualize_sitemap

现在我们输入windsurf.com:

图像

我们得到了站点地图的可视化效果:

安装

确保已安装uv

在 Claude Desktop、Cursor 或 Windsurf 中安装

将此条目添加到您的claude_desktop_config.json 、光标设置等中:

{ "mcpServers": { "sitemap": { "command": "uvx", "args": ["sitemap-mcp-server"], "env": { "TRANSPORT": "stdio" } } } }

如果 Claude 正在运行,请重启它。对于 Cursor,只需按刷新并/或在设置中启用 MCP 服务器即可。

通过 Smithery 安装

要通过Smithery自动安装 Claude Desktop 的站点地图:

npx -y @smithery/cli install @mugoosse/sitemap --client claude

MCP 检查器

npx @modelcontextprotocol/inspector env TRANSPORT=stdio uvx sitemap-mcp-server

打开 MCP Inspector,网址为http://127.0.0.1:6274 ,选择stdio transport,然后连接到 MCP 服务器。

# Start the server uvx sitemap-mcp-server # Start the MCP Inspector in a separate terminal npx @modelcontextprotocol/inspector connect http://127.0.0.1:8050

打开 MCP 检查器http://127.0.0.1:6274 ,选择sse transport,然后连接到 MCP 服务器。

上交所运输

如果您想使用 SSE 传输,请按照以下步骤操作:

  1. 启动服务器:
uvx sitemap-mcp-server
  1. 配置您的 MCP 客户端,例如光标:
{ "mcpServers": { "sitemap": { "transport": "sse", "url": "http://localhost:8050/sse" } } }

本地开发

有关从源代码构建和运行项目的说明,请参阅DEVELOPERS.md指南。

用法

工具

可通过 MCP 服务器使用以下工具:

  • get_sitemap_tree - 从网站 URL 获取并解析站点地图树
    • 参数: url (网站 URL)、 include_pages (可选,布尔值)
    • 返回:站点地图树结构的 JSON 表示
  • get_sitemap_pages - 使用过滤选项获取网站站点地图中的所有页面
    • 参数: url (网站 URL)、 limit (可选)、 include_metadata (可选)、 route (可选)、 sitemap_url (可选)、 cursor (可选)
    • 返回:带有分页元数据的页面的 JSON 列表
  • get_sitemap_stats - 获取网站站点地图的统计信息
    • 参数: url (网站 URL)
    • 返回:带有站点地图统计信息的 JSON 对象,包括页面计数、修改日期和子站点地图详细信息
  • parse_sitemap_content - 直接从 XML 或文本内容解析站点地图
    • 参数: content (站点地图 XML 内容)、 include_pages (可选,布尔值)
    • 返回:已解析站点地图的 JSON 表示

提示

服务器包含现成的提示,这些提示在 Claude Desktop 中以模板形式显示。安装服务器后,您将在“模板”菜单中看到这些模板(点击消息输入旁边的 + 图标):

  • 分析站点地图:提供网站站点地图的全面结构分析
  • 检查站点地图健康状况:评估站点地图的 SEO 和健康指标
  • 从站点地图中提取 URL :从站点地图中提取并过滤特定的 URL
  • 在站点地图中查找缺失内容:识别网站站点地图中的内容空白
  • 可视化站点地图结构:创建 Mermaid.js 图表可视化站点地图结构

要使用这些提示:

  1. 单击 Claude Desktop 中消息输入旁边的 + 图标
  2. 从列表中选择所需的模板
  3. 出现提示时填写网站网址
  4. Claude 将执行适当的站点地图分析

示例

获取完整的站点地图
{ "name": "get_sitemap_tree", "arguments": { "url": "https://example.com", "include_pages": true } }
获取具有过滤和分页功能的页面
按路线过滤
{ "name": "get_sitemap_pages", "arguments": { "url": "https://example.com", "limit": 100, "include_metadata": true, "route": "/blog/" } }
按特定子站点地图过滤
{ "name": "get_sitemap_pages", "arguments": { "url": "https://example.com", "limit": 100, "include_metadata": true, "sitemap_url": "https://example.com/blog-sitemap.xml" } }
基于游标的分页

服务器实现了基于 MCP 游标的分页,以高效处理大型站点地图:

初始请求:

{ "name": "get_sitemap_pages", "arguments": { "url": "https://example.com", "limit": 50 } }

分页响应:

{ "base_url": "https://example.com", "pages": [...], // First batch of pages "limit": 50, "nextCursor": "eyJwYWdlIjoxfQ==" }

带有游标的后续请求:

{ "name": "get_sitemap_pages", "arguments": { "url": "https://example.com", "limit": 50, "cursor": "eyJwYWdlIjoxfQ==" } }

当没有更多结果时, nextCursor字段将不会出现在响应中。

获取站点地图统计信息
{ "name": "get_sitemap_stats", "arguments": { "url": "https://example.com" } }

响应包括每个子站点地图的总体统计信息和详细统计信息:

{ "total": { "url": "https://example.com", "page_count": 150, "sitemap_count": 3, "sitemap_types": ["WebsiteSitemap", "NewsSitemap"], "priority_stats": { "min": 0.1, "max": 1.0, "avg": 0.65 }, "last_modified_count": 120 }, "subsitemaps": [ { "url": "https://example.com/sitemap.xml", "type": "WebsiteSitemap", "page_count": 100, "priority_stats": { "min": 0.3, "max": 1.0, "avg": 0.7 }, "last_modified_count": 80 }, { "url": "https://example.com/blog/sitemap.xml", "type": "WebsiteSitemap", "page_count": 50, "priority_stats": { "min": 0.1, "max": 0.9, "avg": 0.5 }, "last_modified_count": 40 } ] }

这样,MCP 客户端就能了解哪些子站点地图可能值得进一步研究。然后,您可以使用get_sitemap_pages中的sitemap_url参数来筛选特定子站点地图中的页面。

直接解析站点地图内容
{ "name": "parse_sitemap_content", "arguments": { "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"><url><loc>https://example.com/</loc></url></urlset>", "include_pages": true } }

致谢

执照

本项目遵循 MIT 许可证。详情请参阅LICENSE文件。

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

探索网站架构,发现隐藏页面,分析网站结构,并提取有序的页面层次结构,无需手动探索。帮助您大规模了解网站组织结构和内容分布。这款 MCP 可帮助您从简单的网站 URL 开始解析、获取、解析、分析和可视化网站站点地图。

  1. 演示
    1. 安装
      1. 在 Claude Desktop、Cursor 或 Windsurf 中安装
      2. 通过 Smithery 安装
      3. MCP 检查器
      4. 上交所运输
      5. 本地开发
    2. 用法
      1. 工具
      2. 提示
      3. 示例
    3. 致谢
      1. 执照

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          A powerful MCP server for fetching and transforming web content into various formats (HTML, JSON, Markdown, Plain Text) with ease.
          Last updated -
          4
          1,893
          34
          TypeScript
          MIT License
          • Apple
          • Linux
        • A
          security
          A
          license
          A
          quality
          MCP Server enabling integration with Scrapezy to retrieve structured data from websites.
          Last updated -
          1
          673
          6
          JavaScript
          MIT License
          • Apple
        • -
          security
          A
          license
          -
          quality
          A Python-based MCP server that crawls websites to extract and save content as markdown files, with features for mapping website structure and links.
          Last updated -
          3
          Python
          MIT License
        • -
          security
          A
          license
          -
          quality
          Toolset that crawls websites, generates Markdown documentation, and makes that documentation searchable via a Model Context Protocol (MCP) server for integration with tools like Cursor.
          Last updated -
          23
          Python
          MIT License
          • Linux
          • Apple

        View all related MCP servers

        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/mugoosse/sitemap-mcp-server'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server